Why do I have "inside" oscillations when I take the fft of my data

Hi,
I have a data sample that I need to take into the frequency domain, unfortunately I get these oscillations in between the actual negatives and positive values of what I expect, on the left is the sampled signal and on the right the real and imaginary part of its fft.
imag(fftshift(fft(sample)))
real(fftshift(fft(sample)))
Yet what I expect should look like this,
Where did I go wrong about the fft?
Thank you.

4 Comments

Nevermind, someone already answered that elsewhere, sorry.
https://fr.mathworks.com/matlabcentral/answers/94522-why-do-i-get-a-high-frequency-oscillation-when-i-take-the-fft-of-a-rectangular-pulse?s_tid=answers_rc1-1_p1_MLT
hello
well , how does your fft plot looks like if you restraint the x range to -50 / 50 THz ? your plot range is -200 / 200 THz
Well , that was another issue linked to the fact that I plotted using the angular frequency instead of the frequency. Here is what I get now with all issues solved.
glad you found the solution
have a nice day !

Sign in to comment.

Answers (0)

Products

Release

R2024a

Tags

Asked:

on 24 Jun 2025

Commented:

on 24 Jun 2025

Community Treasure Hunt

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

Start Hunting!