The idea of the C program is roughly to clarify, usually not programming, a lot of minor issues, but fortunately accompanied by a mother-in-law, quickly resolved. Draw a 16-point FFT. This is not an optimized program, but it should be the case for a clear idea. The next step is FPGA. Japanese words are not backed up yet. This week is messy, and every week is messy.
Similar to the previous program, the four-point data input is divided into eight equations in the real imaginary part.
About the rotation factor, WNP = e ^ (-J * 2 * pI * P/N) = cos (-J * 2 * pI * P/N) + J * sin (-J * 2 * pI * P/N), cos [p] = cos (-J * 2 * pI * P/N) using the lookup method ), sin [p] = J * sin (-J * 2 * pI * P/N ). Because the base 4fft of 16 points has two levels of operations, the second level uses the most types of rotation factors, which are 4 ^ (2-1) = 4, so four WNP types need to be calculated, each type contains WNP and wn2p
, Wn3p. Therefore, a total of 3x4 = 12 WNP records need to be calculated. Each part contains the sin value and cos value. There are 12 groups of values.
DATAR [k] is the real part of the first input data, and DATAR [K + B] is the real part of the second input data, which is separated by B data, and so on.
The part of the FFT operation is as follows. Is there any ~~ :
Tr = DATAR [k]; TBR = DATAR [K + B]; t2br = DATAR [K + 2 * B]; t3br = DATAR [K + 3 * B];
Ti = datai [k]; Trauma = datai [K + B]; t2bi = datai [K + 2 * B]; t3bi = datai [K + 3 * B];
DATAR [k] = tr + TBR * Cos [p]-trauma * sin [p] + t2br * Cos [2 * p]-t2bi * sin [2 * p] + t3br * Cos [3 * p]-t3bi * sin [3 * p];
Datai [k] = Ti + TBR * sin [p] + trauma * Cos [p] + t2br * sin [2 * p] + t2bi * Cos [2 * p] + t3br * sin [3 * p] + t2bi * Cos [3 * p];
DATAR [K + B] = tr + TBR * sin [p] + trauma * Cos [p]-t2br * Cos [2 * p] + t2bi * sin [2 * p] -t3br * sin [3 * p]-t3bi * Cos [3 * p];
Datai [K + B] = Ti-TBR * Cos [p] + trauma * sin [p]-t2br * sin [2 * p]-t2bi * Cos [2 * p] + t3br * Cos [3 * p]-t3bi * sin [3 * p];
DATAR [K + 2 * B] = tr-TBR * Cos [p] + trauma * sin [p] + t2br * Cos [2 * p]-t2bi * sin [2 * p]-t3br * Cos [3 * p] + t3bi * sin [3 * p];
Datai [K + 2 * B] = Ti-TBR * sin [p]-trauma * Cos [p] + t2br * sin [2 * p] + t2bi * Cos [2 * p]-t3br * sin [3 * p]-t3bi * Cos [3 * p];
DATAR [K + 3 * B] = tr-TBR * sin [p]-trauma * Cos [p]-t2br * Cos [2 * p] + t2bi * sin [2 * p] + t3br * sin [3 * p] + t3bi * Cos [3 * p];
Datai [K + 3 * B] = Ti + TBR * Cos [p]-trauma * sin [p]-t2br * sin [2 * p]-t2bi * Cos [2 * p]-t3br * Cos [3 * p] + t3bi * sin [3 * p];