Project Ne10
An Open Optimized Software Library Project for the ARM Architecture
Loading...
Searching...
No Matches
NE10_dsp.h
1/*
2 * Copyright 2012-15 ARM Limited and Contributors.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of ARM Limited nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28/*
29 * NE10 Library : inc/NE10_dsp.h
30 */
31
32
33#include "NE10_types.h"
34
35#ifndef NE10_DSP_H
36#define NE10_DSP_H
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
43// function prototypes:
45
46 /* fft functions*/
47
48 /* function pointers*/
49 extern ne10_fft_cfg_float32_t (*ne10_fft_alloc_c2c_float32) (ne10_int32_t nfft);
50 extern ne10_fft_cfg_int32_t (*ne10_fft_alloc_c2c_int32) (ne10_int32_t nfft);
51
52 extern void (*ne10_fft_c2c_1d_float32) (ne10_fft_cpx_float32_t *fout,
55 ne10_int32_t inverse_fft);
56
57 extern void (*ne10_fft_r2c_1d_float32) (ne10_fft_cpx_float32_t *fout,
58 ne10_float32_t *fin,
60
61 extern void (*ne10_fft_c2r_1d_float32) (ne10_float32_t *fout,
64
65 extern void (*ne10_fft_c2c_1d_int32) (ne10_fft_cpx_int32_t *fout,
68 ne10_int32_t inverse_fft,
69 ne10_int32_t scaled_flag);
70
71 extern void (*ne10_fft_r2c_1d_int32) (ne10_fft_cpx_int32_t *fout,
72 ne10_int32_t *fin,
74 ne10_int32_t scaled_flag);
75
76 extern void (*ne10_fft_c2r_1d_int32) (ne10_int32_t *fout,
79 ne10_int32_t scaled_flag);
80
81 extern void (*ne10_fft_c2c_1d_int16) (ne10_fft_cpx_int16_t *fout,
84 ne10_int32_t inverse_fft,
85 ne10_int32_t scaled_flag);
86
87 extern void (*ne10_fft_r2c_1d_int16) (ne10_fft_cpx_int16_t *fout,
88 ne10_int16_t *fin,
90 ne10_int32_t scaled_flag);
91
92 extern void (*ne10_fft_c2r_1d_int16) (ne10_int16_t *fout,
95 ne10_int32_t scaled_flag);
96
97 /* init functions*/
98 extern ne10_fft_cfg_int16_t ne10_fft_alloc_c2c_int16 (ne10_int32_t nfft);
99
100 /* destroy functions */
101 extern void ne10_fft_destroy_c2c_float32 (ne10_fft_cfg_float32_t);
102 extern void ne10_fft_destroy_c2c_int32 (ne10_fft_cfg_int32_t);
103 extern void ne10_fft_destroy_c2c_int16 (ne10_fft_cfg_int16_t);
104
105 extern void ne10_fft_destroy_r2c_float32 (ne10_fft_r2c_cfg_float32_t);
106 extern void ne10_fft_destroy_r2c_int32 (ne10_fft_r2c_cfg_int32_t);
107 extern void ne10_fft_destroy_r2c_int16 (ne10_fft_r2c_cfg_int16_t);
108
110 extern ne10_fft_r2c_cfg_int32_t ne10_fft_alloc_r2c_int32 (ne10_int32_t nfft);
111 extern ne10_fft_r2c_cfg_int16_t ne10_fft_alloc_r2c_int16 (ne10_int32_t nfft);
112
113 /* C version*/
114 extern ne10_fft_cfg_float32_t ne10_fft_alloc_c2c_float32_c (ne10_int32_t nfft);
115 extern ne10_fft_cfg_int32_t ne10_fft_alloc_c2c_int32_c (ne10_int32_t nfft);
116
120 ne10_int32_t inverse_fft);
121
123 ne10_float32_t *fin,
125
126 extern void ne10_fft_c2r_1d_float32_c (ne10_float32_t *fout,
129
133 ne10_int32_t inverse_fft,
134 ne10_int32_t scaled_flag);
135
137 ne10_int32_t *fin,
139 ne10_int32_t scaled_flag);
140
141 extern void ne10_fft_c2r_1d_int32_c (ne10_int32_t *fout,
144 ne10_int32_t scaled_flag);
145
149 ne10_int32_t inverse_fft,
150 ne10_int32_t scaled_flag);
151
153 ne10_int16_t *fin,
155 ne10_int32_t scaled_flag);
156
157 extern void ne10_fft_c2r_1d_int16_c (ne10_int16_t *fout,
160 ne10_int32_t scaled_flag);
161
162
163 /* NEON version*/
165 extern ne10_fft_cfg_int32_t ne10_fft_alloc_c2c_int32_neon (ne10_int32_t nfft);
166
170 ne10_int32_t inverse_fft);
171
173 ne10_float32_t *fin,
175
176 extern void ne10_fft_c2r_1d_float32_neon (ne10_float32_t *fout,
179
183 ne10_int32_t inverse_fft,
184 ne10_int32_t scaled_flag);
185
187 ne10_int32_t *fin,
189 ne10_int32_t scaled_flag);
190
191 extern void ne10_fft_c2r_1d_int32_neon (ne10_int32_t *fout,
194 ne10_int32_t scaled_flag);
195
199 ne10_int32_t inverse_fft,
200 ne10_int32_t scaled_flag);
201
203 ne10_int16_t *fin,
205 ne10_int32_t scaled_flag);
206
207 extern void ne10_fft_c2r_1d_int16_neon (ne10_int16_t *fout,
210 ne10_int32_t scaled_flag);
211
212 /* fir functions*/
213
214 /* function pointers*/
215 extern void (*ne10_fir_float) (const ne10_fir_instance_f32_t * S,
216 ne10_float32_t * pSrc,
217 ne10_float32_t * pDst,
218 ne10_uint32_t blockSize);
219
220 extern void (*ne10_fir_decimate_float) (const ne10_fir_decimate_instance_f32_t * S,
221 ne10_float32_t * pSrc,
222 ne10_float32_t * pDst,
223 ne10_uint32_t blockSize);
224
225 extern void (*ne10_fir_interpolate_float) (const ne10_fir_interpolate_instance_f32_t * S,
226 ne10_float32_t * pSrc,
227 ne10_float32_t * pDst,
228 ne10_uint32_t blockSize);
229
230 extern void (*ne10_fir_lattice_float) (const ne10_fir_lattice_instance_f32_t * S,
231 ne10_float32_t * pSrc,
232 ne10_float32_t * pDst,
233 ne10_uint32_t blockSize);
234
235 extern void (*ne10_fir_sparse_float) (ne10_fir_sparse_instance_f32_t * S,
236 ne10_float32_t * pSrc,
237 ne10_float32_t * pDst,
238 ne10_float32_t * pScratchIn,
239 ne10_uint32_t blockSize);
240
241
242 /* init functions*/
243 extern ne10_result_t ne10_fir_init_float (ne10_fir_instance_f32_t * S,
244 ne10_uint16_t numTaps,
245 ne10_float32_t * pCoeffs,
246 ne10_float32_t * pState,
247 ne10_uint32_t blockSize);
248
249 extern ne10_result_t ne10_fir_decimate_init_float (ne10_fir_decimate_instance_f32_t * S,
250 ne10_uint16_t numTaps,
251 ne10_uint8_t M,
252 ne10_float32_t * pCoeffs,
253 ne10_float32_t * pState,
254 ne10_uint32_t blockSize);
255
256 extern ne10_result_t ne10_fir_interpolate_init_float (ne10_fir_interpolate_instance_f32_t * S,
257 ne10_uint8_t L,
258 ne10_uint16_t numTaps,
259 ne10_float32_t * pCoeffs,
260 ne10_float32_t * pState,
261 ne10_uint32_t blockSize);
262
263 extern ne10_result_t ne10_fir_lattice_init_float (ne10_fir_lattice_instance_f32_t * S,
264 ne10_uint16_t numStages,
265 ne10_float32_t * pCoeffs,
266 ne10_float32_t * pState);
267
268 extern ne10_result_t ne10_fir_sparse_init_float (ne10_fir_sparse_instance_f32_t * S,
269 ne10_uint16_t numTaps,
270 ne10_float32_t * pCoeffs,
271 ne10_float32_t * pState,
272 ne10_int32_t * pTapDelay,
273 ne10_uint16_t maxDelay,
274 ne10_uint32_t blockSize);
275
276 /* C version*/
277 extern void ne10_fir_float_c (const ne10_fir_instance_f32_t * S,
278 ne10_float32_t * pSrc,
279 ne10_float32_t * pDst,
280 ne10_uint32_t blockSize);
281
283 ne10_float32_t * pSrc,
284 ne10_float32_t * pDst,
285 ne10_uint32_t blockSize);
286
288 ne10_float32_t * pSrc,
289 ne10_float32_t * pDst,
290 ne10_uint32_t blockSize);
291
293 ne10_float32_t * pSrc,
294 ne10_float32_t * pDst,
295 ne10_uint32_t blockSize);
296
298 ne10_float32_t * pSrc,
299 ne10_float32_t * pDst,
300 ne10_float32_t * pScratchIn,
301 ne10_uint32_t blockSize);
302
303
304 /* NEON version*/
305
310#ifdef ENABLE_NE10_FIR_FLOAT_NEON
311 extern void ne10_fir_float_neon (const ne10_fir_instance_f32_t * S,
312 ne10_float32_t * pSrc,
313 ne10_float32_t * pDst,
314 ne10_uint32_t blockSize)
315 asm ("ne10_fir_float_neon");
316#endif // ENABLE_NE10_FIR_FLOAT_NEON
//end of FIR group
318
323#ifdef ENABLE_NE10_FIR_DECIMATE_FLOAT_NEON
324 extern void ne10_fir_decimate_float_neon (const ne10_fir_decimate_instance_f32_t * S,
325 ne10_float32_t *pSrc,
326 ne10_float32_t *pDst,
327 ne10_uint32_t blockSize) asm ("ne10_fir_decimate_float_neon");
328
//end of FIR_decimate group
330#endif // ENABLE_NE10_FIR_DECIMATE_FLOAT_NEON
335#ifdef ENABLE_NE10_FIR_INTERPOLATE_FLOAT_NEON
336 extern void ne10_fir_interpolate_float_neon (const ne10_fir_interpolate_instance_f32_t * S,
337 ne10_float32_t *pSrc,
338 ne10_float32_t *pDst,
339 ne10_uint32_t blockSize) asm ("ne10_fir_interpolate_float_neon");
340#endif // ENABLE_NE10_FIR_INTERPOLATE_FLOAT_NEON
//end of FIR_interpolate group
342
347#ifdef ENABLE_NE10_FIR_LATTICE_FLOAT_NEON
348 extern void ne10_fir_lattice_float_neon (const ne10_fir_lattice_instance_f32_t * S,
349 ne10_float32_t * pSrc,
350 ne10_float32_t * pDst,
351 ne10_uint32_t blockSize) asm ("ne10_fir_lattice_float_neon");
352#endif // ENABLE_NE10_FIR_LATTICE_FLOAT_NEON
//end of FIR_Lattice group
354
359#ifdef ENABLE_NE10_FIR_SPARSE_FLOAT_NEON
360 extern void ne10_fir_sparse_float_neon (ne10_fir_sparse_instance_f32_t * S,
361 ne10_float32_t * pSrc,
362 ne10_float32_t * pDst,
363 ne10_float32_t * pScratch,
364 ne10_uint32_t blockSize)
365 asm ("ne10_fir_sparse_float_neon");
366#endif // ENABLE_NE10_FIR_SPARSE_FLOAT_NEON
//end of FIR_sparse group
368
369
370 /* iir functions*/
371
372 /* function pointers*/
373 extern void (*ne10_iir_lattice_float) (const ne10_iir_lattice_instance_f32_t * S,
374 ne10_float32_t * pSrc,
375 ne10_float32_t * pDst,
376 ne10_uint32_t blockSize);
377
378 /* init functions*/
380 ne10_uint16_t numStages,
381 ne10_float32_t * pkCoeffs,
382 ne10_float32_t * pvCoeffs,
383 ne10_float32_t * pState,
384 ne10_uint32_t blockSize);
385
386
387 /* C version*/
389 ne10_float32_t * pSrc,
390 ne10_float32_t * pDst,
391 ne10_uint32_t blockSize);
392
393 /* NEON version*/
394
399#ifdef ENABLE_NE10_IIR_LATTICE_FLOAT_NEON
400 extern void ne10_iir_lattice_float_neon (const ne10_iir_lattice_instance_f32_t * S,
401 ne10_float32_t * pSrc,
402 ne10_float32_t * pDst,
403 ne10_uint32_t blockSize) asm ("ne10_iir_lattice_float_neon");
404#endif // ENABLE_NE10_IIR_LATTICE_FLOAT_NEON
//end of IIR_Lattice group
406
407#ifdef __cplusplus
408}
409#endif
410
411#endif
void ne10_fft_c2c_1d_float32_neon(ne10_fft_cpx_float32_t *fout, ne10_fft_cpx_float32_t *fin, ne10_fft_cfg_float32_t cfg, ne10_int32_t inverse_fft)
Mixed radix-2/3/4/5 complex FFT/IFFT of float(32-bit) data.
void ne10_fft_c2c_1d_int32_c(ne10_fft_cpx_int32_t *fout, ne10_fft_cpx_int32_t *fin, ne10_fft_cfg_int32_t cfg, ne10_int32_t inverse_fft, ne10_int32_t scaled_flag)
Mixed radix-2/4 complex FFT/IFFT of 32-bit fixed point data.
void ne10_fft_c2c_1d_int16_neon(ne10_fft_cpx_int16_t *fout, ne10_fft_cpx_int16_t *fin, ne10_fft_cfg_int16_t cfg, ne10_int32_t inverse_fft, ne10_int32_t scaled_flag)
Mixed radix-2/4 complex FFT/IFFT of 16-bit fixed point data.
ne10_fft_cfg_float32_t ne10_fft_alloc_c2c_float32_neon(ne10_int32_t nfft)
User-callable function to allocate all necessary storage space for the fft.
Definition NE10_fft.c:337
void ne10_fft_c2c_1d_float32_c(ne10_fft_cpx_float32_t *fout, ne10_fft_cpx_float32_t *fin, ne10_fft_cfg_float32_t cfg, ne10_int32_t inverse_fft)
Mixed radix-2/3/4/5 complex FFT/IFFT of float(32-bit) data.
ne10_fft_cfg_int32_t ne10_fft_alloc_c2c_int32_neon(ne10_int32_t nfft)
User-callable function to allocate all necessary storage space for the fft.
Definition NE10_fft.c:435
void ne10_fft_c2c_1d_int16_c(ne10_fft_cpx_int16_t *fout, ne10_fft_cpx_int16_t *fin, ne10_fft_cfg_int16_t cfg, ne10_int32_t inverse_fft, ne10_int32_t scaled_flag)
Mixed radix-2/4 complex FFT/IFFT of 16-bit fixed point data.
ne10_fft_cfg_int32_t ne10_fft_alloc_c2c_int32_c(ne10_int32_t nfft)
User-callable function to allocate all necessary storage space for the fft.
ne10_fft_cfg_float32_t ne10_fft_alloc_c2c_float32_c(ne10_int32_t nfft)
User-callable function to allocate all necessary storage space for the fft.
void ne10_fft_c2c_1d_int32_neon(ne10_fft_cpx_int32_t *fout, ne10_fft_cpx_int32_t *fin, ne10_fft_cfg_int32_t cfg, ne10_int32_t inverse_fft, ne10_int32_t scaled_flag)
Mixed radix-2/4 complex FFT/IFFT of 32-bit fixed point data.
ne10_fft_cfg_int16_t ne10_fft_alloc_c2c_int16(ne10_int32_t nfft)
User-callable function to allocate all necessary storage space for the fft.
ne10_result_t ne10_iir_lattice_init_float(ne10_iir_lattice_instance_f32_t *S, ne10_uint16_t numStages, ne10_float32_t *pkCoeffs, ne10_float32_t *pvCoeffs, ne10_float32_t *pState, ne10_uint32_t blockSize)
Initialization function for the floating-point IIR lattice filter.
void ne10_iir_lattice_float_c(const ne10_iir_lattice_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)
Processing function for the floating-point IIR lattice filter.
Definition NE10_iir.c:118
void ne10_fir_decimate_float_c(const ne10_fir_decimate_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)
Processing function for the floating-point FIR decimator.
Definition NE10_fir.c:452
void ne10_fir_interpolate_float_c(const ne10_fir_interpolate_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)
Processing function for the floating-point FIR interpolator.
Definition NE10_fir.c:712
void ne10_fir_lattice_float_c(const ne10_fir_lattice_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)
Processing function for the floating-point FIR lattice filter.
Definition NE10_fir.c:972
void ne10_fir_sparse_float_c(ne10_fir_sparse_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_float32_t *pScratchIn, ne10_uint32_t blockSize)
Processing function for the floating-point sparse FIR filter.
Definition NE10_fir.c:1439
void ne10_fir_float_c(const ne10_fir_instance_f32_t *S, ne10_float32_t *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)
Definition NE10_fir.c:121
void ne10_fft_r2c_1d_int16_neon(ne10_fft_cpx_int16_t *fout, ne10_int16_t *fin, ne10_fft_r2c_cfg_int16_t cfg, ne10_int32_t scaled_flag)
Mixed radix-2/4 FFT (real to complex) of int16 data.
ne10_fft_r2c_cfg_float32_t ne10_fft_alloc_r2c_float32(ne10_int32_t nfft)
User-callable function to allocate all necessary storage space for the fft (r2c/c2r).
void ne10_fft_c2r_1d_int16_c(ne10_int16_t *fout, ne10_fft_cpx_int16_t *fin, ne10_fft_r2c_cfg_int16_t cfg, ne10_int32_t scaled_flag)
Mixed radix-2/4 IFFT (complex to real) of int16 data.
void ne10_fft_r2c_1d_float32_neon(ne10_fft_cpx_float32_t *fout, ne10_float32_t *fin, ne10_fft_r2c_cfg_float32_t cfg)
Mixed radix-2/4 FFT (real to complex) of float(32-bit) data.
ne10_fft_r2c_cfg_int16_t ne10_fft_alloc_r2c_int16(ne10_int32_t nfft)
User-callable function to allocate all necessary storage space for the fft (r2c/c2r).
void ne10_fft_r2c_1d_int32_neon(ne10_fft_cpx_int32_t *fout, ne10_int32_t *fin, ne10_fft_r2c_cfg_int32_t cfg, ne10_int32_t scaled_flag)
Mixed radix-2/4 FFT (real to complex) of int32 data.
void ne10_fft_c2r_1d_int32_neon(ne10_int32_t *fout, ne10_fft_cpx_int32_t *fin, ne10_fft_r2c_cfg_int32_t cfg, ne10_int32_t scaled_flag)
Mixed radix-2/4 IFFT (complex to real) of int32 data.
void ne10_fft_r2c_1d_int32_c(ne10_fft_cpx_int32_t *fout, ne10_int32_t *fin, ne10_fft_r2c_cfg_int32_t cfg, ne10_int32_t scaled_flag)
Mixed radix-2/4 FFT (real to complex) of int32 data.
void ne10_fft_r2c_1d_int16_c(ne10_fft_cpx_int16_t *fout, ne10_int16_t *fin, ne10_fft_r2c_cfg_int16_t cfg, ne10_int32_t scaled_flag)
Mixed radix-2/4 FFT (real to complex) of int16 data.
void ne10_fft_c2r_1d_int32_c(ne10_int32_t *fout, ne10_fft_cpx_int32_t *fin, ne10_fft_r2c_cfg_int32_t cfg, ne10_int32_t scaled_flag)
Mixed radix-2/4 IFFT (complex to real) of int32 data.
void ne10_fft_r2c_1d_float32_c(ne10_fft_cpx_float32_t *fout, ne10_float32_t *fin, ne10_fft_r2c_cfg_float32_t cfg)
Mixed radix-2/4 FFT (real to complex) of float(32-bit) data.
void ne10_fft_c2r_1d_int16_neon(ne10_int16_t *fout, ne10_fft_cpx_int16_t *fin, ne10_fft_r2c_cfg_int16_t cfg, ne10_int32_t scaled_flag)
Mixed radix-2/4 IFFT (complex to real) of int16 data.
void ne10_fft_c2r_1d_float32_c(ne10_float32_t *fout, ne10_fft_cpx_float32_t *fin, ne10_fft_r2c_cfg_float32_t cfg)
Mixed radix-2/4 IFFT (complex to real) of float(32-bit) data.
ne10_fft_r2c_cfg_int32_t ne10_fft_alloc_r2c_int32(ne10_int32_t nfft)
User-callable function to allocate all necessary storage space for the fft (r2c/c2r).
void ne10_fft_c2r_1d_float32_neon(ne10_float32_t *fout, ne10_fft_cpx_float32_t *fin, ne10_fft_r2c_cfg_float32_t cfg)
Mixed radix-2/4 IFFT (complex to real) of float(32-bit) data.
structure for the 16 bits fixed point FFT function.
Definition NE10_types.h:298
structure for the 32 bits fixed point FFT function.
Definition NE10_types.h:329
structure for the floating point FFT state
Definition NE10_types.h:241
Instance structure for the floating-point FIR Decimation.
Definition NE10_types.h:385
Instance structure for the floating-point FIR filter.
Definition NE10_types.h:365
Instance structure for the floating-point FIR Interpolation.
Definition NE10_types.h:396
Instance structure for the floating point FIR Lattice filter.
Definition NE10_types.h:375
Instance structure for the floating-point FIR Sparse filter.
Definition NE10_types.h:407
Instance structure for the floating point IIR Lattice filter.
Definition NE10_types.h:420