Fast Fourier Transform (FFT) Animation using Matlab
Code for the following animation : https://www.youtube.com/watch?v=-GYB7khbIA0
We show the progress of Fast Fourier Transform (FFT) of a time-domain signal as it changes in time. Matlab's fft() function is used for illustration, hence it should be noted that the function is assumed to be periodic. The number of FFT points is assumed to be same as the samples of time domain signal to prevent zero padding when the full domain is filled.
In the beginning a sinusoidal signal at 50 Hertz (1*sin(2*pi*50*t)) starts to develop and slowly fills the full domain. Then, another sinusoidal signal at a higher amplitude and 100 Hertz (1.5*sin(2*pi*100*t)) is added to this signal. Later, a third sinusoidal signal at 200 Hz replaces the 100 Hz one. Following this, a DC component (0 Hz) is inserted and finally, the DC component is removed. At each stage, the the development of frequency components can clearly be observed. In the frequency spectrum, first a 50Hz component starts to build up along with lower and higher frequencies. The reason for wider spectrum is the fact that sinusoidal signal fills the domain within an increasing time window (hence introduction of sinc components). Once the full domain is filled with the sinusoidal, then only 50 Hz component remains due to the fact that the signal assumes to be periodic in Matlab fft function.
Cite As
Mehmet E. Yavuz (2025). Fast Fourier Transform (FFT) Animation using Matlab (https://www.mathworks.com/matlabcentral/fileexchange/53674-fast-fourier-transform-fft-animation-using-matlab), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Signal Processing > Signal Processing Toolbox > Transforms, Correlation, and Modeling > Transforms > Discrete Fourier and Cosine Transforms > Fast Fourier Transforms >
Tags
Communities
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
html/
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 | Snapshot included |