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
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!