Sign in

How harmonics and THD are calculated from a COMTRADE record

Which cycles are analysed, how each harmonic is measured, why nothing above the Nyquist order is reported, and the THD and K-factor formulas SagSwell uses.

Updated · SagSwell

The Harmonics tab in SagSwell shows, for every voltage and current channel, the amplitude of each harmonic, the THD and the K-factor. This page describes the calculation behind those numbers and the limits a COMTRADE record places on them.

Which cycles are analysed

  • Before the event: up to eight whole cycles of the record’s quiet part, ending a quarter of a cycle before the first sag or swell (or before fault inception). Short pre-trigger sections give fewer cycles, down to one.
  • During the event: two cycles starting at the deepest point of the disturbance.

Whole cycles matter: a Fourier transform over a non-integer number of cycles spreads the fundamental into the neighbouring harmonics and inflates THD.

How each harmonic is measured

For harmonic order h, over the M samples of the window:

X_h = (2/M) · Σ x_k · e^(−j·2π·h·f0·k/fs)        V_h (RMS) = |X_h| / √2

Each order is evaluated directly at h × f0, the nominal frequency from the .cfg. The window is rectangular, which is exact when it holds whole cycles at the nominal frequency.

Nothing above the Nyquist order

A recorder sampling n points per cycle cannot see anything above harmonic n/2. Worse, asking for a higher order does not return zero: it returns an alias of a lower one. On a power meter sampling 32 points per cycle, orders 31 and 33 fold straight back onto the fundamental. A real meter record read without this limit gave a voltage THD of 124.8% where the true value was 1.7%.

Nyquist order = floor( fs / (2 · f0) )      reported up to min(50, Nyquist order)

SagSwell stops the spectrum at the Nyquist order and says on the chart where it stopped, so a short spectrum is shown as short rather than padded with aliases.

THD and K-factor

THD = √( V2² + V3² + … + V_H² ) / V1 × 100 %

K   = Σ h² · I_h²  /  Σ I_h²          (h = 1 … H)

H is the highest order reported. THD is not given for a channel with no meaningful fundamental, such as an unused current input reading a few milliamps of noise.

Reading the result

A record lasts seconds, and IEEE 519 is assessed statistically over days or weeks, so a record’s THD is a snapshot of one moment, not an assessment of a site. The IEEE 519 guide covers the limits and why that distinction matters. The variable-speed-drive sample is a good record to try the Harmonics tab on.

Questions people ask

What is the highest harmonic a COMTRADE record can show?
Half the number of samples per cycle (the Nyquist order). At 32 samples per cycle that is the 16th harmonic; at 128 samples per cycle, the 64th. SagSwell reports up to the 50th or the Nyquist order, whichever is lower.
Which part of the record is used for THD?
Two windows: up to eight whole cycles of the undisturbed part before the first event, and two cycles at the deepest point of the disturbance. The pre-event figure is the one to compare with steady-state limits.
Why does a channel show no THD at all?
Because THD is a percentage of the fundamental. A channel with nothing connected has no fundamental, only noise, and dividing by almost zero would give a meaningless figure in the thousands of per cent, so none is shown.
Is THD the same as TDD?
No. THD divides by the fundamental at that moment; TDD (used for currents in IEEE 519) divides by the maximum demand current, which a short record does not contain.

References

  • IEEE Std 519-2022, IEEE Standard for Harmonic Control in Electric Power Systems
  • IEC 61000-4-7:2002+A1:2008, General guide on harmonics and interharmonics measurements
  • IEEE Std C57.110-2018, Recommended Practice for Establishing Liquid-Immersed and Dry-Type Power Transformer Capability When Supplying Nonsinusoidal Load Currents (K-factor)

Free tools

More guides