|
Sound Open Firmware
|
Fast Fourier Transform (FFT) and Inverse FFT (IFFT) interfaces. More...


Go to the source code of this file.
Data Structures | |
| struct | fft_plan |
| struct | fft_multi_plan |
Macros | |
| #define | FFT_GENERIC |
| #define | FFT_SIZE_MIN 1 |
| #define | FFT_SIZE_MAX 1024 |
| #define | FFT_MULTI_COUNT_MAX 3 |
Functions | |
| struct fft_plan * | mod_fft_plan_new (struct processing_module *mod, void *inb, void *outb, uint32_t size, int bits) |
| Allocate and initialize an FFT execution plan. | |
| void | fft_execute_16 (struct fft_plan *plan, bool ifft) |
| Execute a 16-bit complex FFT or IFFT according to an initialized plan. | |
| void | fft_execute_32 (struct fft_plan *plan, bool ifft) |
| Execute a 32-bit complex FFT or IFFT according to an initialized plan. | |
| void | mod_fft_plan_free (struct processing_module *mod, struct fft_plan *plan) |
| Free an allocated FFT execution plan and its internal buffers. | |
| struct fft_multi_plan * | mod_fft_multi_plan_new (struct processing_module *mod, void *inb, void *outb, uint32_t size, int bits) |
| mod_fft_multi_plan_new() - Prepare FFT for 2^N size and some other FFT sizes | |
| void | fft_multi_execute_32 (struct fft_multi_plan *plan, bool ifft) |
| fft_multi_execute_32() - Calculate Fast Fourier Transform (FFT) for 2^size and other | |
| void | mod_fft_multi_plan_free (struct processing_module *mod, struct fft_multi_plan *plan) |
| mod_fft_multi_plan_free() - Free the FFT plan | |
| void | dft3_32 (struct icomplex32 *input, struct icomplex32 *output) |
| dft3_32() - Discrete Fourier Transform (DFT) for size 3. | |
Fast Fourier Transform (FFT) and Inverse FFT (IFFT) interfaces.
| #define FFT_GENERIC |
| #define FFT_MULTI_COUNT_MAX 3 |
| #define FFT_SIZE_MAX 1024 |
| #define FFT_SIZE_MIN 1 |
| void dft3_32 | ( | struct icomplex32 * | input, |
| struct icomplex32 * | output | ||
| ) |
dft3_32() - Discrete Fourier Transform (DFT) for size 3.
| input | Pointer to complex values input array, Q1.31. |
| output | Pointer to complex values output array, Q1.31, scaled down by 1/3. |
This function is useful for calculating some non power of two FFTs. E.g. the FFT for size 1536 is done with three 512 size FFTs and one 3 size DFT.
| void fft_execute_16 | ( | struct fft_plan * | plan, |
| bool | ifft | ||
| ) |
Execute a 16-bit complex FFT or IFFT according to an initialized plan.
| plan | Pointer to the initialized 16-bit FFT plan. |
| ifft | True for Inverse Fast Fourier Transform, false for forward FFT. |
| void fft_execute_32 | ( | struct fft_plan * | plan, |
| bool | ifft | ||
| ) |
Execute a 32-bit complex FFT or IFFT according to an initialized plan.
| plan | Pointer to the initialized 32-bit FFT plan. |
| ifft | True for Inverse Fast Fourier Transform, false for forward FFT. |
| void fft_multi_execute_32 | ( | struct fft_multi_plan * | plan, |
| bool | ifft | ||
| ) |
fft_multi_execute_32() - Calculate Fast Fourier Transform (FFT) for 2^size and other
| plan | Pointer to FFT plan created with mod_fft_multi_plan_new() |
| ifft | Value 0 calculates FFT, value 1 calculates IFFT |
This function calculates the FFT with the buffers defined with mod_fft_multi_plan_new().
| void mod_fft_multi_plan_free | ( | struct processing_module * | mod, |
| struct fft_multi_plan * | plan | ||
| ) |
mod_fft_multi_plan_free() - Free the FFT plan
| mod | Pointer to module |
| plan | Pointe to FFT plan |
This function frees the allocations done internally by the function mod_fft_multi_plan_new(). The input and output buffers need to be freed separately.
| struct fft_multi_plan * mod_fft_multi_plan_new | ( | struct processing_module * | mod, |
| void * | inb, | ||
| void * | outb, | ||
| uint32_t | size, | ||
| int | bits | ||
| ) |
mod_fft_multi_plan_new() - Prepare FFT for 2^N size and some other FFT sizes
| mod | Pointer to module |
| inb | Buffer to use for complex input data |
| outb | Buffer to use for complex output data |
| size | Size of FFT as number of bins |
| bits | World length of FFT. Currently only 32 is supported. |
This function does the preparations to calculate FFT. If the size is power of two the operation is similar to mod_fft_plan_new(). Some other FFT sizes like 1536 is supported by allocated multiple FFT plans and by wrapping all needed for similar usage as power of two size FFT.
| void mod_fft_plan_free | ( | struct processing_module * | mod, |
| struct fft_plan * | plan | ||
| ) |
Free an allocated FFT execution plan and its internal buffers.
| mod | Processing module that owns the plan. |
| plan | Pointer to the FFT plan to free. |
| struct fft_plan * mod_fft_plan_new | ( | struct processing_module * | mod, |
| void * | inb, | ||
| void * | outb, | ||
| uint32_t | size, | ||
| int | bits | ||
| ) |
Allocate and initialize an FFT execution plan.
| mod | Processing module requesting the plan (for memory allocation). |
| inb | Pointer to input buffer for complex data. |
| outb | Pointer to output buffer for complex results. |
| size | FFT transform size in number of complex bins. |
| bits | Sample word length in bits (16 or 32). |