Total Harmonic Distortion

Purpose

Calculate total harmonic distortion of periodic signal

Library

Control / Measurements

Description

../../_images/thd.svg

This block calculates the total harmonic distortion of a periodic input signal. The sample time and the fundamental frequency can be specified.

The THD is defined as:

\[\text{THD} = \sqrt{\frac{\sum_{\nu\ge2} U_\nu^2}{U_1^2}} = \sqrt{\frac{U_{\text{rms}}^2 - U_0^2 - U_1^2}{U_1^2}}\]

where \(U_\nu\) is the RMS value of the \(\nu\)-th harmonic of the input signal and \(U_{\text{rms}}\) is its overall RMS value.

Example Model

  • See the example model “Total Harmonic Distortion”.

  • Find it in PLECS under Help > PLECS Documentation > List of Example Models.

Parameters

Sample time

A scalar specifying the sampling period or a two-element vector specifying the sampling period and offset, in seconds \((\mathrm{s})\). See also the Discrete-Periodic sample time type in section Sample Times. If a sample time of 0 is specified, a continuous implementation based on the Moving Average block is active. The Discrete-Periodic implementation can potentially force a variable-step solver to take small integration steps. This may slow down the simulation. The default value of this parameter is 0.

Fundamental frequency

The fundamental frequency of the periodic input signal in hertz \((\mathrm{Hz})\).