This MATLAB script performs a Fourier Transform analysis on a sinusoidal signal. It calculates the amplitude and phase spectrum of the signal, which is essential for understanding the frequency components of the signal.
- Clear Variables: Starts with a clean workspace by clearing all variables.
- Signal Definition: Defines a sinusoidal signal
g(t)
with a frequency of 60 Hz. - Fourier Transform: Computes the discrete Fourier transform of the absolute value of
g(t)
. - Spectrum Calculation: Calculates both the amplitude and phase spectrum of the signal.
- Visualization: Plots the first five harmonics of the amplitude and phase spectrum.
To use this script, simply run it in your MATLAB environment. Ensure you have MATLAB installed on your machine.
The script will display:
- The DC value of
g(t)
. - Two subplots showing the amplitude and phase spectrum of the signal.
Feel free to fork this project and contribute by adding more features or improving the existing code.
This project is open-sourced under the MIT license. See the LICENSE file for more details.
- Thanks to the MATLAB community for the continuous support and inspiration.
- Special shoutout to MathWorks for creating such a powerful tool for scientific computing.