How one-cycle RMS is calculated from a COMTRADE record
The window, the step, the formula and the per-unit reference SagSwell uses for the RMS trend of every channel, with a worked example and how it differs from the IEC 61000-4-30 half-cycle refresh.
Every sag, swell and interruption SagSwell reports starts from one calculation: the RMS value of each channel over one cycle, recomputed as the window slides along the record. This page sets out exactly how that is done, so you can check a figure by hand or explain it in a report.
The window
The window holds one cycle of samples at the nominal power frequency taken from the .cfg file (50 or 60 Hz):
N = round(fs / f0) fs = sampling rate, f0 = nominal frequency
The sampling rate is not read from the .cfg alone. SagSwell takes the median interval between the first two thousand time stamps in the .dat file, because a .cfg that declares one rate while the time stamps say another is common enough to matter.
The step
The window moves forward by an eighth of a cycle (N / 8 samples, at least one). Each position gives one point of the RMS trend, time-stamped at the centre of its window. On very long records the step is widened so the trend has no more than about four thousand points.
The formula
For each window position, two values are computed from the same N samples xj:
True RMS = √( (1/N) · Σ x_j² ) Fundamental RMS = |X1| / √2, X1 = (2/N) · Σ x_j · e^(−j·2π·f0·j/fs)
The true RMS includes every harmonic and is what the sag and swell detection uses, as IEEE 1159 and IEC 61000-4-30 do. The fundamental RMS comes from a one-cycle Fourier filter and feeds the phasors and sequence components.
A worked example
| Record | fs | f0 | N (samples) | Step | Step in time |
|---|---|---|---|---|---|
| 22 kV feeder sample | 3.2 kHz | 50 Hz | 64 | 8 | 2.5 ms |
| 132 kV fault sample | 4.8 kHz | 50 Hz | 96 | 12 | 2.5 ms |
| A 60 Hz relay at 16 samples/cycle | 960 Hz | 60 Hz | 16 | 2 | 2.08 ms |
Both sample records can be opened in SagSwell and the RMS tab compared with these figures.
Per unit: what the value is divided by
The RMS trend is shown in volts or amps and in per unit. The per-unit base is, in order of preference:
- A nominal declared for the channel, when one has been entered.
- A nominal declared for the site (for voltage channels).
- The median one-cycle RMS of the whole record for that channel.
The median is used rather than the opening cycles because recorders do not always trigger before the disturbance. A record triggered on the recovery opens with the voltage already low; taking the first cycles as 1.0 pu would turn the return to normal into an impossible swell of several hundred per cent. The median is the level the record spends most of its time at, so a disturbance that lasts less than half the record does not move it. A record that is mostly disturbed still needs a declared nominal, and the file check asks for one.
How this compares with IEC 61000-4-30
IEC 61000-4-30 defines Urms(1/2): the RMS over one cycle, refreshed every half cycle, and it applies hysteresis to the thresholds. SagSwell uses the same one-cycle window, refreshes it four times as often and applies no hysteresis. The magnitudes agree; the start and end of an event can differ by a fraction of a cycle, and a voltage hovering right at a threshold can split into several short events where a Class A meter reports one. SagSwell reads records; it is not a Class A instrument and does not claim to be one.
Limits worth knowing
- The window length uses the nominal frequency. During a large frequency excursion it no longer spans exactly one cycle and the RMS ripples slightly.
- When fs / f0 is not a whole number, N is rounded and the window is a fraction of a sample long or short.
- A channel with nothing connected to it is recognised as dead and left out of the event detection.
The next step, turning this trend into events, is in how sags and swells are detected.
Questions people ask
- How many samples are in a one-cycle RMS window?
- The sampling rate divided by the power frequency, rounded to a whole number: 64 samples at 3.2 kHz on a 50 Hz system, 80 at 4.8 kHz on 60 Hz.
- Why is RMS taken over one cycle rather than one sample?
- RMS is a mean over time. Over less than a cycle the result depends on where the window starts on the sine wave; over exactly one cycle it does not, which is what makes it a stable measure of the voltage level.
- What is the per-unit reference if no nominal voltage is entered?
- The median one-cycle RMS of the whole record, channel by channel. It is the level the record spends most of its time at, so it is not thrown off by a record that starts during a disturbance. A declared nominal voltage replaces it when one is entered.
- Does SagSwell follow IEC 61000-4-30?
- It uses the same one-cycle window but refreshes it every eighth of a cycle instead of every half cycle, and it applies no hysteresis. Durations can therefore differ from a Class A instrument by a fraction of a cycle. SagSwell is a record viewer, not a Class A meter.
References
- IEC 61000-4-30:2015, Testing and measurement techniques — Power quality measurement methods (Urms(1/2) definition)
- IEEE Std 1159-2019, IEEE Recommended Practice for Monitoring Electric Power Quality
Free tools
- COMTRADE to CSV converter
- COMTRADE file checker
- ITIC (CBEMA) curve checker
- Symmetrical components calculator (positive, negative, zero sequence)
- Sample COMTRADE files
More guides
- How to open COMTRADE files online (.cfg, .dat, .cff)
- The COMTRADE file format explained (IEEE C37.111)
- The COMTRADE .cfg file, line by line (with an annotated example)
- COMTRADE viewer for Mac, Linux and Chromebook (no install)
- Free COMTRADE viewers compared (2026): browser, desktop and code
- Voltage sags, swells and interruptions: the IEEE 1159 categories
- ITIC (CBEMA) curve: chart, corner points and SEMI F47
- Harmonics and THD from a fault record: what IEEE 519 does and does not tell you
- Opening COMTRADE records in SagSwell: files, pairs, zip and demo records
- The waveform view: zoom, cursors, channels and values at the cursor
- The record summary: sampling, frequency, voltage range, THD, unbalance and trip
- The harmonics view: spectrum, IEEE 519 limits by bus voltage and NEMA MG-1 derating
- The file check: what SagSwell read, inferred or found wrong in a COMTRADE file
- Events, sites and notes: grouping records from several recorders
- What SagSwell Pro adds: diagnosis, event replay, PQ timeline, reports and sharing
- Is it safe to open COMTRADE files online? Where your records go
- How to read a fault record: a step-by-step method
- Voltage sag types A to G: what the three phases tell you about the fault
- Fault, motor start or transformer energising? Telling sag causes apart in a record
- CT saturation in fault records: how to recognise it
- Transformer inrush or internal fault? Reading the difference in a record
- How sags, swells and interruptions are detected and classified
- How harmonics and THD are calculated from a COMTRADE record
- How phasors and symmetrical components are calculated
- How to get COMTRADE files from an SEL relay
- How to export COMTRADE fault records from Siemens SIPROTEC 5 (DIGSI 5)
- How to get COMTRADE disturbance records from ABB Relion relays (PCM600)
- How to extract COMTRADE disturbance records from MiCOM P40 Agile relays (S1 Agile)
- How to get COMTRADE oscillography from GE Multilin UR relays
- SIGRA alternative: a free browser viewer for COMTRADE fault records
- WaveWin alternative: opening COMTRADE without installing software
- TransView alternative: a browser COMTRADE viewer for power-quality questions