Texas Instruments TMS320C67 DSP Series Programmer's Reference Manual page 42

Library
Hide thumbs Also See for TMS320C67 DSP Series:
Table of Contents

Advertisement

w[k+5] = (float)y_t;
k+=6;
}
}
}
This redundant set of twiddle factors is size 2*N float samples. The function
is accurate to about 130dB of signal to noise ratio to the DFT function below:
void dft(int N, float x[], float y[])
{
int k,i, index;
const float PI = 3.14159654;
float * p_x;
float arg, fx_0, fx_1, fy_0, fy_1, co, si;
for(k = 0; k<N; k++)
{
p_x = x;
fy_0 = 0;
fy_1 = 0;
for(i=0; i<N; i++)
{
fx_0 = p_x[0];
fx_1 = p_x[1];
p_x += 2;
index = (i*k) % N;
arg = 2*PI*index/N;
co = cos(arg);
si = -sin(arg);
fy_0 += ((fx_0 * co) - (fx_1 * si));
fy_1 += ((fx_1 * co) + (fx_0 * si));
}
y[2*k] = fy_0;
y[2*k+1] = fy_1;
}
}
The function takes the table and input data and calculates the fft producing the
frequency domain data in the Y array. As the fft allows every input point to effect
every output point in a cache based system such as the c6711, this causes
cache thrashing. This is mitigated by allowing the main fft of size N to be divid-
ed into several steps, allowing as much data reuse as possible. For example
the following function:
DSPF_sp_fftSPxSP(1024, &x[0],&w[0],y,brev,4, 0,1024);
is equvalent to:
DSPF_sp_fftSPxSP(1024,&x[2*0], &w[0] , y,brev,256, 0,1024;
DSPF_sp_fftSPxSP(256, &x[2*0], &w[2*768],y,brev,4, 0,1024;
DSPF_sp_fftSPxSP(256, &x[2*256],&w[2*768],y,brev,4, 256,1024;
DSPF_sp_fftSPxSP(256, &x[2*512],&w[2*768],y,brev,4, 512,1024;
DSPF_sp_fftSPxSP(256, &x[2*768],&w[2*768],y,brev,4, 768,1024;
Notice how the first fft function is called on the entire 1K data set it covers the
first pass of the fft until the butterfly size is 256. The following 4 ffts do 256 pt
DSPF_sp_fftSPxSP
DSPLIB Reference
4-17

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C67 DSP Series and is the answer not in the manual?

Questions and answers

Table of Contents