Harmonic Spectrum and Total Harmonic Distortion

Plots the Harmonic Spectrum showing the integer multiple harmonics components of a specified signal in the Matlab workspace.
1K Downloads
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

A. INPUT
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 (2024). Harmonic Spectrum and Total Harmonic Distortion (https://www.mathworks.com/matlabcentral/fileexchange/77092-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!
Version Published Release Notes
1.1.1

- Inputs both row and column vector variables.
- Displays error message for insufficient length of selected signal.

1.1.0

- Compatibility with older version of Matlab from Matlab 2015a
- GUI Updated

1.0.0