This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

pe_calculateThdPercent

Compute the total harmonic distortion (THD) percentage

Syntax

[thdPercent] = pe_calculateThdPercent(harmonicOrder,harmonicMagnitude)

Description

example

[thdPercent] = pe_calculateThdPercent(harmonicOrder,harmonicMagnitude) calculates the total harmonic distortion (THD) percentage using these equations:

M=harmonic magnitude2,

and

%THD=100i=2nMi2M1,

where:

  • Mi is the root mean square (RMS) value of the harmonic magnitude corresponding to the ith harmonic order.

  • M is VRMS or IRMS as required.

You can use the pe_getHarmonics function to obtain the vectors of harmonic order and harmonic magnitude for a simscape.logging.Node.

Examples

collapse all

Calculate the THD from harmonic orders [1;5;7;11;13] and harmonic magnitudes [1.1756e+03;0.0437e+03;0.0221e+03;0.0173e+03;0.0127e+03].

harmonicOrder = [1;5;7;11;13];
harmonicMagnitude = [1.1756e+03;0.0437e+03;0.0221e+03;0.0173e+03;...
    0.0127e+03];
thdPercent = pe_calculateThdPercent( harmonicOrder, harmonicMagnitude )
thdPercent = 4.5480

Input Arguments

collapse all

Harmonic orders from 0 up to and including number of harmonics, specified as a vector.

Example: [1;5;7;11;13]

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Harmonic magnitudes from the 0th harmonic up to and including the number of harmonics included in the analysis, specified as a vector.

Example: [1.1756e+03;0.0437e+03;0.0221e+03;0.0173e+03;0.0127e+03]

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Introduced in R2014a