blockTotalHarmonicDistortion
Extends from Interfaces.SISO (Single Input Single Output continuous control block).
Information
This block determines the total harmonic distortion (THD) over the given period 1/f.
Consider that the input u consists of harmonic RMS components
U1, U2, U3, etc.
The total RMS component is then determined by:
The calculation of the total harmonic distortion is based on the parameter useFirstHarmonic.
The default value useFirstHarmonic = true represents the standard THD calculation used in
electrical engineering.
The non-default value useFirstHarmonic = false
calculates the THD typically used for the assessment of audio signals.
If useFirstHarmonic = true, the total higher harmonic content (harmonic order numbers > 1)
refers to the RMS value of the fundamental wave:
If useFirstHarmonic = false, the total higher harmonic content (harmonic order numbers > 1)
refers to the total RMS:
In case of a zero input signal or within the first period of calculation, the boolean output signal
valid becomes false to indicate that the calculation result is not valid. Valid
calculations are indicated by valid = true.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| SI.Frequency | f | Base frequency | |
| Boolean | useFirstHarmonic | true | THD with respect to first harmonic, if true; otherwise with respect to total RMS |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| RealInput | u (from SISO) | Connector of Real input signal | |
| RealOutput | y (from SISO) | Connector of Real output signal | |
| Interfaces.BooleanOutput | valid | True, if output y is valid |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Harmonic | harmonic | ||
| RootMeanSquare | rootMeanSquare | ||
| Logical.GreaterThreshold | greaterThreshold | ||
| Division | division | ||
| Nonlinear.Limiter | limiter | ||
| Pythagoras | pythagoras | ||
| Logical.And | andValid | ||
| Sources.BooleanExpression | booleanExpression | ||
| Logical.Switch | switch1 |