6.4.14 TwidFactorInit
Description
TwidFactorInit generates the first half of the set of twiddle factors required by a Discrete Fourier Transform or Discrete Cosine Transform, and places the result in the complex destination vector.
Effectively, the set contains the values:
- For conjFlag = 0:
- For conjFlag != 0:
Prototype
fractcomplex* TwidFactorInit (int log2N, fractcomplex* twidFactors, int conjFlag);
Arguments
Parameters |
Description |
---|---|
log2N |
Based 2 logarithm of N (N = number of complex factors needed by a FFT) |
twidFactors |
Pointer to the complex twiddle factors |
conjFlag |
Flag to indicate whether or not conjugate values are to be generated |
Returns
Pointer to the base address of twiddle factors.
Remarks
N must be an integer power of 2.
Only the first N/2 twiddle factors are generated.
The value of conjFlag determines the sign of the exponent in the Fourier transform's exponential function. For Forward Fourier transforms, conjFlag should be set to 0. For inverse Fourier transforms and Discrete Cosine Transforms (DCT), conjFlag must be set to 1 to ensure a correct computation.
A complex vector of size N/2 must have already been allocated and assigned to twidFactors prior to invoking the function. The complex vector should be allocated in X-Data memory.
Factors computed in floating-point arithmetic and converted to 1.31 complex fractionals.
Source File
- inittwid_aa.c