当前位置:网站首页>radix-4 FFT principle and C language code implementation
radix-4 FFT principle and C language code implementation
2022-08-11 07:14:00 【KPer_Yang】
Table of Contents
References:
"Digital Signal Processing" edited by Deng Xiaoling, Xu Meixuan, etc.
1. Extract by frequency
2. Extract by time:
3. C code implementation
//radix-4 FFT decimation by frequency/********************************************************************* @brief radix-4 FFT decimated by frequency* @param x: A double-type one-dimensional array of length n, which starts to store the real part of the data to be transformed, and finally stores the real part of the transformation result* @param y: a double-type one-dimensional array of length n, which starts to store the imaginary part of the data to be transformed, and finally stores the imaginary part of the transformation result* @param n: n=4^m, m is a positive integer* @note Note that a radix-4 FFT requires n to be a power of 4.Compared with radix-2, the multiplication amount of radix-4 is reduced by 25%, and the addition amount is slightly reduced;* @Sample usage: call directly****************************************************************/void radix_4_FFT(x, y, n){int n;double x[], y[];int i, j, k, m, i1, i2, i3, n1, n2;double a, b, c, e, r1, r2, r3, r4, s1, s2, s3, s4;double co1, co2, co3, si1, si2, si3;for(j = 1, i=1; i < 10; ++i){m = i;j = 4*j;if(j == n) break;}n2 = n;for(k = 1; k <= m; ++k){n1 = n2;n2 = n2 / 4;e = 6.28318530718/n1;a = 0;for(j = 0; j < n2; ++j){b = a + a;c = a + b;co1 = cos(a);co2 = cos(b);co3 = cos(c);si1 = sin(a);si2 = sin(b);si3 = sin(c);a = (j + 1) * e;for(i = j; i < n; i = i + n1){i1 = i + n2;i2 = i1 + n2;i3 = i2 + n2;r1 = x[i] + x[i2];r3 = x[i] - x[i2];s1 = y[i] + y[i2];s3 = y[i] - y[i2];r2 = x[i1] + x[i3];r4 = x[i1] - x[i3];s2 = y[i1] + y[i3];s4 = y[i1] - y[i3];x[i] = r1 - r2;r2 = r1 - r2;r1 = r3 - s4;r3 = r3 + s4;y[i] = s1 + s2;s2 = s2 - s2;s1 = s3 + r4;s3 = s3 - r4;x[i1] = co1 * r3 + si1 * s3;y[i1] = col * s3 - si1 * r3;x[i2] = co2 * r3 + si2 * s3;y[i2] = co2 * s3 - si2 * r3;x[i3] = co3 * r3 + si3 * s3;y[i3] = co3 * s3 - si3 * r3;}}}n1 = n - 1;for(j = 0; i = 0; i < n1; ++i){if(i < j){r1 = x[j];s1 = y[j];x[j] = x[i];y[j] = y[i];x[i] = r1;y[i] = s1;}k = n / 4;while(3 * k < (j + 1)){j = j - 3*k;k = k / 4;}j = j + k;}}
边栏推荐
- 快速了解集成学习
- Redis + lua implements distributed interface current limiting implementation scheme
- 空间点模式方法_一阶效应和二阶效应
- HCIP 重发布/路由策略实验
- HCIP-生成树(802.1D ,标准生成树/802.1W : RSTP 快速生成树/802.1S : MST 多生成树)
- 矩阵分析——微分、积分、极限
- HCIA knowledge review
- OA项目之我的会议(会议排座&送审)
- Amazon Get AMAZON Product Details API Return Value Description
- LabelEncoder和LabelBinarizer的区别
猜你喜欢
HCIP-Spanning Tree (802.1D, Standard Spanning Tree/802.1W: RSTP Rapid Spanning Tree/802.1S: MST Multiple Spanning Tree)
淘宝API接口参考
八股文之jvm
MySQL01
HCIP experiments (pap, chap, HDLC, MGRE, RIP)
HCIP-BGP的选路实验
Taobao API common interface and acquisition method
HCIP BGP built adjacent experiment
HCIP BGP neighbor building, federation, and aggregation experiments
1688商品详情接口
随机推荐
pytorch调整模型学习率
HCIA knowledge review
求过去半年内连续30天以上每天都有1000元以上成交的商铺
LabelEncoder和LabelBinarizer的区别
导航定位中的坐标系
Class definition, class inheritance, and the use of super
从mask-rcnn到shp
radix-4 FFT 原理和C语言代码实现
已解决EROR 1064 (42000): You have an error in. your SOL syntax. check the manual that corresponds to yo
Cobbleland 博览会 基础系列 1
一个小时快速熟悉MySQL基本用法
什么是Inductive learning和Transductive learning
快速了解集成学习
Top20 bracket matching
Amazon Get AMAZON Product Details API Return Value Description
iptables nat
《Show and Tell: A Neural Image Caption Generator》论文解读
iptables 使用脚本来管理规则
TOP2两数相加
iptables 基础配置