THD of Harmonics

A GUI based MATLAB script that illustrates the effect of harmonic orders towards the Total Harmonic Distortion percentage of a system.

You are now following this Submission

%The purpose of this GUI is to provide a better illustration of how the number of orders affects Total Harmonic Distortion percentage.
%Up to the 16th order is available for the adjustment.
%User is allowed to adjust the magnitude and phase for each harmonic order.
%The magnitude for each harmonic order CAN ONLY BE ADJUSTED by the slider.
%The ">>" sign located besides time-domain plot allows the user to amplify the graph plot.
%The "same exes plot" sign labeled at the top right of the frequency-domain plot allows the user to plot all harmonic order at same axes.
%Originally written by Dr. Rodney Tan at Oct 2018.

Cite As

Roy Teong (2026). THD of Harmonics (https://www.mathworks.com/matlabcentral/fileexchange/72181-thd-of-harmonics), MATLAB Central File Exchange. Retrieved .

Acknowledgements

Inspired by: Power Quality Harmonic Interactive Demo

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0