Motorola DSP Developer's Kit |
Motorola DSP Developer's Kit | ![]() ![]() |
Y = mot###_ifft( X )
This function returns the discrete Fourier transform (DFT) of the input for real vector X
Input/Output
Input: Vector Xe (even index input data, located in X memory), and vector Xo (odd index input data, located in Y memory)
Output: Vector Yr (real data of output), and vector Yi (imaginary data of output)
Algorithm
First, use the algorithm in FFT-C.ASM to calculate the length/2 complex data FFT.
Then, use the split algorithm to calculate the final results.
No scaling is required for the input data; the output data should be scaled up by 2^(r2+1)
.
For example, after the FFT is done and r2=7
, to get true FFT values, every output item has to be shifted left 8 bits.
The scaling algorithm is described below:
for (k =0; k < size/2 -1; k++) { H1r = (Xr[k] + Xr[size-k]) / 2; H1i = (Xi[k] - Xi[size-k]) / 2; H2r = (Xi[k] + Xi[size-k]) / 2; H2i = (Xr[size-k] - Xr[k]) / 2; Yr[k] = H1r + (C2r[k]*H2r - C2i[k]*H2i); Yr[size-k] = H1r - (C2r[k]*H2r - C2r[k]*H2i); Yi[k] = H1i + (C2i[k]*H2r- C2r[k]*H2i); Yi[size-k] = -(H1i) + (C2i[k]*H2r - C2r[k]*H2i); }
Memory & Register
The above two symbols are also used as output symbols.
p:$F000 = half the length of the input real vector
p:$F001 = the address offset of the coefficient lookup table, C1 (used by Fft-c)
p:$F002 = the address offset of the coefficient lookup table, C2 (used by split)
p:$F003 = the address offset of the output vector
Status Register
The assembly function ifft-r.asm
does not explicitly set any status registers/bits during the function execution.
Data Size Limit
The length of vector X can't be larger than the continuous available data memory size.
Data Range Limit
The value of input vector X must be between -1.0 and +1.0.
![]() | filter-c.asm | ifft-c.asm | ![]() |