📄 dspf_sp_fftspxsp.h
字号:
/* ======================================================================== */
/* */
/* TEXAS INSTRUMENTS, INC. */
/* */
/* NAME */
/* DSPF_sp_fftSPxSP - Floating point FFT with complex input */
/* */
/* USAGE */
/* This routine is C-callable and can be called as: */
/* */
/* void DSPF_sp_fftSPxSP( */
/* int N, float * ptr_x, float * ptr_w, float * ptr_y, */
/* unsigned char * brev, int n_min, int offset, int n_max); */
/* */
/* N = length of fft in complex samples, power of 2 such that */
/* N>=8 and N <= 16384. */
/* ptr_x = pointer to complex data input */
/* ptr_w = pointer to complex twiddle factor (see below) */
/* ptr_y = pointer to complex output data */
/* brev = pointer to bit reverse table containing 64 entries */
/* n_min = smallest fft butterfly used in computation */
/* used for decomposing fft into subffts, see notes */
/* offset = index in complex samples of sub-fft from start of */
/* main fft */
/* n_max = size of main fft in complex samples */
/* */
/* DESCRIPTION */
/* The benchmark performs a mixed radix forwards fft using */
/* a special sequence of coefficients generated in the following */
/* way: */
/* */
/* // generate vector of twiddle factors for optimized */
/* algorithm // */
/* void tw_gen(float * w, int N) */
/* { */
/* int j, k; */
/* double x_t, y_t, theta1, theta2, theta3; */
/* const double PI = 3.141592654; */
/* */
/* for (j=1, k=0; j <= N>>2; j = j<<2) */
/* { */
/* for (i=0; i < N>>2; i+=j) */
/* { */
/* theta1 = 2*PI*i/N; */
/* x_t = cos(theta1); */
/* y_t = sin(theta1); */
/* w[k] = (float)x_t; */
/* w[k+1] = (float)y_t; */
/* */
/* theta2 = 4*PI*i/N; */
/* x_t = cos(theta2); */
/* y_t = sin(theta2); */
/* w[k+2] = (float)x_t; */
/* w[k+3] = (float)y_t; */
/* */
/* theta3 = 6*PI*i/N; */
/* x_t = cos(theta3); */
/* y_t = sin(theta3); */
/* w[k+4] = (float)x_t; */
/* 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 */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -