資源簡介
2的整數(shù)次冪點數(shù)的離散傅里葉變換MATLAB代碼
代碼片段和文件信息
%采用基2時間抽取法編寫,N必須為2的整數(shù)倍
%function?[xn_fft]=fft_N(xn)
clc
clear
N=1024;????????????????????????????????????????????????%采樣點數(shù)
T=0.8;??????????????????????????????????????????????%數(shù)據(jù)時常
%fs=(N-1)/T;?????????????????????????????????????????%采樣頻率
t=linspace(0TN);
%f1=50;
%f2=150;
%f3=250;
f1=50;
xn=220*sin(2*pi*f1*t)+50*sin(2*pi*3*f1*t)+20*sin(2*pi*5*f1*t)+15*sin(2*pi*7*f1*t);
%xn(1:2048)=0;
%xn(2049:6144)=1;
%xn(6145:8192)=0;
WN=exp(-j*pi*2/N);??????????????????????????????%WN表示底數(shù)N=2的變換因子
n=N;
num=0;
while?n>1
????n=n/2;
????num=num+1;
end
M=num;?????????????????????????????????????????????????????%M表示總共要運算的級數(shù),數(shù)據(jù)長度對于2的指數(shù)
double?XK_1[];
double?XK_2[];
double?xn1[];
int?num_new[];
num_new(1)=1;
for?num=(M-1):-1:0
????N_new=length(num_new);
????num_increase=2^num;
????for?num_1=1:N_new
????????n
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3429??2010-06-03?22:49??t_2_fft.m
-----------?---------??----------?-----??----
?????????????????3429????????????????????1
評論
共有 條評論