[討論] DFT

作者: yuwei0418 (新手)   2014-11-17 22:28:24
想請問大家
這樣的離散傅立葉寫法有沒有錯誤?
請大家給我一點意見QQ
t=0:0.01:8;
n=length(t);
pt=sind(t);
dt=t(2)-t(1);
T=(n-1)*dt
df=1/T;
fre=linspace(0,(n-1)*df,n);
Tn=1;
Wn=2*pi/Tn;
k=20000;
m=k/(Wn^2);
j=sqrt(-1);
c=2*m*Wn*0.1;
w=fre*2*pi;
Hw=1./(-m.*(w.^2)+j*c.*w+k);
cw=zeros(n,n);
for i=1:n;
for k=1:n
cw(k,i)=dt*pt(k)*exp(-j*w(i)*t(k));
end
Cw(i)=sum(cw(:,i));
end
ut=zeros(n,n);
dw=w(2)-w(1);
for i=1:n
for k=1:n
ut(k,i)=(dw/2/pi)*Hw(k)*Cw(k)*exp(j*w(k)*t(i));
UT(i)=abs(sum(ut(:,i)));
end
end

Links booklink

Contact Us: admin [ a t ] ucptt.com