Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

what can I do now?Who can help me in this question?

Status
Not open for further replies.

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])
 
Replies continue below

Recommended for you

Leakage. Your time domain signal does not include an integer number of cycles

M

--
Dr Michael F Platten
 
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 time domain signal includes one cycle for the cycle is 2.I found that I regards w(angle frequency) as f(frequency) for mistake.The figures of FFT is the same as that of directly integration after I replace the f with 2*pi*f
 
Your signal still includes one too many points for an integer number of cycles. Your time vector should be

t = 0:1/fs:2-1/fs

instead of

t = 0:1/fs:2

M

--
Dr Michael F Platten
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor