DFT(离散傅里叶变换)

/******************************************************************************* ** 程序名称:离散傅里叶变换(DFT ) ** 程序描述:本程序对指定的离散序列进行离散傅里叶变换 ** 程序作者:宋元瑞 ** 最后修改:2011年4月1日 *******************************************************************************/ #include #include #define N 32 //序列长度 #define PI 3.1415926535 typedef double ElementType; //原始数据序列的数据类型,可以在这里设置 typedef struct //复数结构体,用于实现傅里叶运算 { ElementType real,imag; }complex; complex dataResult[N]; //傅里叶运算的频域结果序列的值(复数) ElementType dataSource[N]; //输入的原始数据序列 ElementType dataFinualResult[N]; //最终频域序列结果(dataResult[N]的模,实数) void FFT_Calculate_OneNode(int k)//计算频域上一个点的DFT值 { int n = 0; complex ResultThisNode; complex part[N]; ResultThisNode.real = 0; ResultThisNode.imag = 0; for(n=0; n

你可能感兴趣的:(C语言)