huang9431
Mechanical
- Mar 29, 2006
- 2
I found there is great difference between the result of the fourier transform using directly integration and that using FFT.What's the reason?
??The FT using FFT
fp=1024; % FFT Point
fs=20; % Sampling frequency
t=0:1/fs:2;
y=sin(pi*t);
Y=abs(fft(y,fp))/fp;
f=fs*(0:fp/2)/fp;
plot(f,Y(1:fp/2+1));
??The FT using directly integration
syms t real
syms w real
y=int(sin(pi*t)*exp(-i*w*t),t,0,2);
the result of directly integration:
-pi*(-1+((-1)^(w/pi))^2)/(w^2-pi^2)/((-1)^(w/pi))^2
the output of the directly integration
fplot('abs(-pi*(-1+((-1)^(w/pi))^2)/(w^2-pi^2)/((-1)^(w/pi))^2)',[0 30])
??The FT using FFT
fp=1024; % FFT Point
fs=20; % Sampling frequency
t=0:1/fs:2;
y=sin(pi*t);
Y=abs(fft(y,fp))/fp;
f=fs*(0:fp/2)/fp;
plot(f,Y(1:fp/2+1));
??The FT using directly integration
syms t real
syms w real
y=int(sin(pi*t)*exp(-i*w*t),t,0,2);
the result of directly integration:
-pi*(-1+((-1)^(w/pi))^2)/(w^2-pi^2)/((-1)^(w/pi))^2
the output of the directly integration
fplot('abs(-pi*(-1+((-1)^(w/pi))^2)/(w^2-pi^2)/((-1)^(w/pi))^2)',[0 30])