image thumbnail

Harmonic Spectrum and Total Harmonic Distortion

version 1.1.1 (13.3 KB) by Thomas Joseph
Plots the Harmonic Spectrum showing the integer multiple harmonics components of a specified signal in the Matlab workspace.


Updated 24 Jun 2020

View License

Harmonic Spectrum & Total Harmonic Distortion of a Signal
Determines the Harmonic Spectrum of a Signal
- Spectrum of integer multiple Harmonics
- Magnitude of Harmonic components
- Phase of Harmonic Components
Determines the THD of the Signal
- THD and WTHD
- Fundamental Amplitude
- RMS of the Signal

1. Select Signal from Workspace (Click REFRESH to update list of variables)
2. Sampling time of the signal in seconds (s)

B. FFT Settings
1. Fundamental Frequency in Hz
2. Start time for FFT analysis in seconds (s)
3. No. of Cycles to be used for the FFT analysis
Once the inputs are given and FFT setting are modified
Click on 'PLOT' to get the results.

C. PLOT settings
- Base for the plot (actual/fundamental amplitude)
- Starting and Ending Frequency Order
- Minimum and Maximum Amplitude
- Title & Labels
- Plot Line Width
- Axis Text Size
- Plot Colour

D. SAVE Figure
- Click on save to save the harmonic Spectrum by specifying filename and the file type as extension.

Cite As

Thomas Joseph (2022). Harmonic Spectrum and Total Harmonic Distortion (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015a
Compatible with R2015a to R2019b
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!