在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 5890|回复: 11

怎樣用matlab寫Radix-2 FFT?

[复制链接]
发表于 2008-11-23 18:23:14 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
本帖最后由 eecsseudl 于 2013-4-29 09:57 编辑

怎樣用matlab寫Radix-2 FFT?






发表于 2008-11-27 23:18:16 | 显示全部楼层
顶一下!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
发表于 2008-11-27 23:39:33 | 显示全部楼层
挺简单的吧
发表于 2008-11-29 20:38:24 | 显示全部楼层
谢谢谢谢谢谢
发表于 2010-1-7 13:46:12 | 显示全部楼层
心机版
发表于 2011-5-27 09:25:53 | 显示全部楼层
呵呵,用下
发表于 2011-6-4 13:04:47 | 显示全部楼层
希望對板主有用。





  1. function  X = radix2(x,inverse)
  2. x = [1 1 1 1 0 0 0 0 ];
  3. inverse = 1;
  4. switch inverse
  5.     case 1
  6. xcheck=x;
  7. p=nextpow2(length(x));
  8. x=[x zeros(1,(2^p)-length(x))];
  9. N=length(x);
  10. M=N/2;                                                                     % Index Helping for Controlling range of indices of the Butterfly at Each Stage (Shrinking)
  11. for stage=1:log2(N);                                                       % No of times decimation has to occur
  12.          for index=0:(N/(2^(stage-1))):(N-1);                              % Adjusting the index variations of the butterfly in each stage
  13.              for n=0:M-1;                                                  % Within a stage, for a given index (single) as reference, develop a local Butterfly Index
  14.                       a=x(n+index+1)+ x(n+index+M+1);
  15.                       AA = exp((-j*(2*pi)/N)*(2^(stage-1))*(n));
  16.                       a = fi(AA);
  17.                       b=(x(n+index+1)- x(n+index+M+1)).* AA;
  18.                       x(n+1+index)=a;
  19.                       x(n+M+1+index)=b;                                    % In place Computation
  20.              end;
  21.          end;
  22. M=M/2;                                                                     % Used for creating Butterfly Pairs (INDEXing the wings) (Shrinkage)
  23. end;
  24. X=bitrevorder(x);                                                          % Bit reversing X[k] to obtain X[k] 0<k<N-1
  25. % Ycheck=fft(xcheck,N)
  26.                                                                            % Cross Check the answer using inbuilt FFT
  27.     case 2
  28. xcheck=x;      
  29. x=x';
  30. p=nextpow2(length(x));
  31. x=[x zeros(1,(2^p)-length(x))];
  32. N=length(x);
  33. M=N/2;                                                                     % Index Helping for Controlling range of indices of the Butterfly at Each Stage (Shrinking)
  34. for stage=1:log2(N);                                                       % No of times decimation has to occur
  35.          for index=0:(N/(2^(stage-1))):(N-1);                              % Adjusting the index variations of the butterfly in each stage
  36.              for n=0:M-1;                                                  % Within a stage, for a given index (single) as reference, develop a local Butterfly Index
  37.                       a=x(n+index+1)+ x(n+index+M+1);
  38.                       b=(x(n+index+1)- x(n+index+M+1)).*exp((-j*(2*pi)/N)*(2^(stage-1))*(n));
  39.                       x(n+1+index)=a;
  40.                       x(n+M+1+index)=b;                                    % In place Computation
  41.              end;
  42.          end;
  43. M=M/2;                                                                     % Used for creating Butterfly Pairs (INDEXing the wings) (Shrinkage)
  44. end;
  45. X=bitrevorder(x) ;                                                         % Bit reversing X[k] to obtain X[k] 0<k<N-1
  46. X = X'/N
  47. end
  48. % Ycheck=ifft(xcheck,N)                                                        
  49.                                                                            % Cross Check the answer using inbuilt IFFT
  50. end



复制代码
发表于 2011-7-11 23:51:50 | 显示全部楼层
学习,谢谢!!!!!!!
发表于 2011-7-19 16:14:24 | 显示全部楼层
感谢分享学习资料
发表于 2012-7-19 10:05:59 | 显示全部楼层
感谢分享!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-19 01:00 , Processed in 0.035481 second(s), 10 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表