Why do I get a high frequency oscillation when I take the FFT of a rectangular pulse?

20 views (last 30 days)
Why do I get a high frequency oscillation when I take the FFT of a rectangular pulse?
I am taking the FFT of a Rectangular Pulse and I expect a nice smooth Sinc wave. But what I get is a Sinc wave with a high frequency oscillation. Why is this?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The results you are getting from the FFT are correct and expected. The reason for the oscillations is because the Rectangular Pulse is not centered about zero, which results in a phase shift of the FFT output. The phase shift is essentially negating every other element (odd samples) of the output of the FFT which causes the high frequency oscillation you're observing. This is explained by the time-shifted Fourier Transform Theorem.
One way to avoid the oscillations is to use FFTSHIFT on the Rectangular Pulse before taking the FFT. For example if "rect" is the Rectangular Pulse:
fftrect=fftshift(fft(fftshift(rect)));

More Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!