Cooley-Tukey FFT for 16-bit Integer Numbers
This library allows calculating FFT for the signals entered as an array of 16-bit signed integer numbers. The DSP CPU instructions are not used and the code will work for any 16-bit PIC device from PIC24F to dsPIC33E. The result of the calculation is written to the same array used for the input data. The calculation algorithm is based on Cooley-Tukey FFT algorithm with decimation in frequency. The permutation is performed on the final result to order harmonics. The twiddle coefficients for the transform and result permutation tables are stored in flash (PSV .const section). The valid FFT sizes are 8, 16, 32, 64, 128, 256, 512, 1024 and 2048. The size of the variables in the array is limited by 16-bits for real and imaginary parts. To avoid the overflows and fit into 16-bits, before each iteration (radix 2 butterflies), the results are shifted one bit right (rounded). Though the rounding decreases the result precision and adds a noise to the FFT result the use of just 16-bit numbers makes the FFT calculations fast. For PIC24F @ 16MIPS (32 MHz oscillator frequency), the time required for the calculation is
About this Code Example
Please read "FFT_Help.pdf" help file located in "FFT Code" folder for more information.
- Apr 9, 2015