Texas Instruments TMS320C64X Security Camera User Manual


 
DSP_fft16x16t
4-107 C64x+ DSPLIB Reference
Complex Forward Mixed Radix 16- x 16-Bit FFT With Truncation
DSP_fft16x16t
Function void DSP_fft16x16t(const short * restrict w, int nx, short * restrict x, short * re-
strict y)
Arguments w[2*nx] Pointer to complex Q.15 FFT coefficients.
nx Length of FFT in complex samples. Must be power of 2 or 4
, and 16 nx 32768.
x[2*nx] Pointer to complex 16-bit data input.
y[2*nx] Pointer to complex 16-bit data output.
Description This routine computes a complex forward mixed radix FFT with truncation and
digit reversal. Input data x[ ], output data y[ ], and coefficients w[ ] are 16-bit.
The output is returned in the separate array y[ ] in normal order. Each complex
value is stored with interleaved real and imaginary parts. The code uses a
special ordering of FFT coefficients (also called twiddle factors) and memory
accesses to improve performance in the presence of cache.
Algorithm This is the C equivalent of the assembly code without restrictions. Note that
the assembly code is hand optimized and restrictions may apply.
/*−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−*/
/* The following macro is used to obtain a digit reversed index, of a given */
/* number i, into j where the number of bits in ”i” is ”m”. For the natural */
/* form of C code, this is done by first interchanging every set of ”2 bit” */
/* pairs, followed by exchanging nibbles, followed by exchanging bytes, and */
/* finally halfwords. To give an example, consider the following number: */
/* */
/* N = FEDCBA9876543210, where each digit represents a bit, the following */
/* steps illustrate the changes as the exchanges are performed: */
/* M = DCFE98BA54761032 is the number after every ”2 bits” are exchanged. */
/* O = 98BADCFE10325476 is the number after every nibble is exchanged. */
/* P = 1032547698BADCFE is the number after every byte is exchanged. */
/* Since only 16 digits were considered this represents the digit reversed */
/* index. Since the numbers are represented as 32 bits, there is one more */
/* step typically of exchanging the half words as well. */
/*−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−*/
#if TMS320C6X