Total Harmonic Distortion
Total harmonic distortion measurement
Simscape / Electrical / Control / Measurements
The Total Harmonic Distortion block calculates the total harmonic distortion (THD) percentage using these equations:
Mi is the root mean squared (RMS) value of the harmonic magnitude that corresponds to the ith harmonic order.
M is VRMS or IRMS.
is the sum of all harmonic components.
u — Harmonic magnitude
scalar | vector
THD (%) — Total harmonic distortion
scalar | vector
Total harmonic distortion as a percentage.
Fundamental frequency — Fundamental frequency in Hz
Fundamental frequency, in Hz.
Sample time (-1 for inherited) — Block sample time
-1 (default) | nonnegative scalar
Time between consecutive block executions. During execution, the block produces outputs and, if appropriate, updates its internal state. For more information, see What Is Sample Time? and Specify Sample Time.
For inherited discrete-time operation, specify
discrete-time operation, specify a positive integer. For continuous-time
To improve accuracy, set this value at least 10 times smaller than the Time constant parameter.
If this block is in a masked subsystem, or another variant subsystem that allows either continuous or discrete operation, promote the sample time parameter to ensure correct switching between the continuous and discrete implementations of the block. For more information, see Promote Block Parameters on a Mask.
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Introduced in R2019b