⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example 3-1.c

📁 《基于TI DSP的通用算法实现》程序代码
💻 C
字号:

;Example 3 - 1. Generation of Twiddle Factor for Float-Point Complex Radix-2 FFT C Listing


/***************************************************************/
/*	twiFactor --- pointer to the twiddle factor array      */
/*	wLen        --- length of FFT			       */
/***************************************************************/

struct	complexData{
            float re;
            float im;
        };

void gen_w_r2(struct complexData * twiFactor, int wLen)
{
     int 	iFactor;
     float stepFactor;
      
     stepFactor=2.0*pi/wLen;      
     for (iFactor=0; iFactor<(wLen>>1); iFactor++){
            twiFactor[iFactor].re = cos(stepFactor*iFactor);
            twiFactor[iFactor].im = sin(stepFactor*iFactor);
               			// w[n] = exp(j*2*pi*n/N), n=0,1,...,(N/2-1).
     }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -