Sub topic 8
Why We Need RMS and How It Is Defined
This chapter assumes you know Ohm's law and the power relation P = V·I. It also assumes you can read an integral as an area or a mean, and you know the sine function and its period. It explains what RMS is and why it is defined as it is. The next chapter derives the specific result Vrms = Vm/√2 for a sine wave.
The problem: the average of an AC signal is zero
Take a voltage v(t) = Vm sin(ωt + φ). Over one full period the positive half-cycle and the negative half-cycle cancel exactly. The average value is therefore zero, whatever the amplitude.
That is a poor description of what the signal does. A 120 V outlet connected to a space heater makes the heater hot. A zero average would suggest nothing is happening. The average is zero because direction of current flow alternates. A resistor heats the same way for either direction of current.
So we need a single number that:
- does not cancel between positive and negative half-cycles,
- tells us how much heating or work the signal can do, and
- can be compared directly with a DC value.
RMS is that number.
What the number should mean
Start with the physical requirement and work backward to the formula. A resistor R carrying voltage v(t) dissipates instantaneous power
p(t) = v(t)² / R
Because v² is never negative, p(t) is never negative. Positive and negative voltages both deliver heat, and the contributions add instead of cancelling.
The average power over a period T is
P = (1/T) ∫₀ᵀ v(t)²/R dt = (1/R) · [(1/T) ∫₀ᵀ v(t)² dt]
The bracketed quantity is the mean of the squared voltage. For a DC source Vdc the same resistor dissipates P = Vdc²/R. We define the "equivalent DC value" as the Vdc that gives the same average power. Setting the two expressions equal gives
Vdc² = (1/T) ∫₀ᵀ v(t)² dt
Taking the square root gives the definition.
The definition
For a periodic voltage with period T:
Vrms = √[ (1/T) ∫₀ᵀ v(t)² dt ]
and the same form holds for a current:
Irms = √[ (1/T) ∫₀ᵀ i(t)² dt ]
The name lists the operations in reverse order of how you perform them. You do them in this order:
- Square the signal at every instant.
- Take the mean of the squares over one period.
- Take the square root of that mean.
Each step has a reason:
- Squaring removes the sign, so negative half-cycles count as positive heating.
- The mean makes the result independent of how long you observe, as long as you cover whole periods.
- The root returns the result to volts. After squaring, the unit is volts squared, which is not comparable to a DC voltage.
RMS equals the DC value that heats equally
From the derivation above, if a periodic voltage with RMS value Vrms is applied to a resistor R, the average power is
P = Vrms² / R = Irms² R = Vrms · Irms
These are the same forms as the DC power formulas, with RMS values in place of DC values. This is why the voltage of a wall outlet is quoted as an RMS value. A 120 V RMS supply heats a resistor as much as a 120 V DC source would.
Two cautions apply:
- The equivalence is about average power in a resistor. It says nothing about the instantaneous power, which still varies during the cycle.
- The formula P = Vrms · Irms holds as written only when voltage and current are in phase, as in a resistor. For loads with a phase difference, the power also depends on that difference, which later chapters cover.
Worked example with three signals
Consider three voltages applied to the same resistor. Assume each has an amplitude of 10 V.
DC, 10 V. v² = 100 V² always, so the mean is 100 and Vrms = 10 V.
Square wave, +10 V for half the period and −10 V for the other half. v² = 100 V² at every instant, since squaring removes the sign. The mean is 100 and Vrms = 10 V. The average value is 0 V.
Unipolar pulse, 10 V for half the period and 0 V for the other half. v² is 100 V² for half the time and 0 for the other half. The mean of the squares is 50 V², so Vrms = √50 ≈ 7.07 V. The average value is 5 V.
| Signal | Average value | RMS value |
|---|---|---|
| DC, 10 V | 10 V | 10 V |
| Square wave, ±10 V | 0 V | 10 V |
| Pulse, 0 or 10 V, half the time each | 5 V | 7.07 V |
The table shows that average and RMS are different measurements. The square wave averages 0 V yet heats a resistor exactly like 10 V DC. The pulse has an average of 5 V but an RMS of 7.07 V, because the heating depends on v², not on v. If you wrongly used the average to compute heating in the pulse case, you would get 5²/R, which is half the real power of 7.07²/R = 50/R.
RMS with a DC offset
A signal often contains a constant part plus a varying part: v(t) = V₀ + vac(t), where vac(t) averages to zero over a period. Expand the square:
mean of v² = mean of (V₀² + 2V₀·vac + vac²) = V₀² + 2V₀·(mean of vac) + mean of vac²
The middle term is zero because vac averages to zero. So
Vrms² = V₀² + Vac,rms²
The DC part and the AC part combine as the root of the sum of squares, not by simple addition. For example, a 3 V DC level with an AC component of 4 V RMS gives Vrms = √(9 + 16) = 5 V, not 7 V.
Computing RMS numerically
The code below applies the definition directly to sampled signals. It checks the three signals from the table and then shows what happens when you do not cover a whole period.
import numpy as np
def rms(samples):
"""Root mean square of evenly spaced samples covering whole periods."""
samples = np.asarray(samples, dtype=float)
return np.sqrt(np.mean(samples ** 2))
N = 100000
t = np.arange(N) / N # one period, normalized so T = 1
dc = np.full(N, 10.0)
square = np.where(t < 0.5, 10.0, -10.0)
pulse = np.where(t < 0.5, 10.0, 0.0)
for name, v in [("DC", dc), ("square", square), ("pulse", pulse)]:
print(f"{name:7s} mean = {np.mean(v):6.3f} rms = {rms(v):6.3f}")
# Whole period versus a partial period of a unit-amplitude sine
s = np.sin(2 * np.pi * t)
print(f"full period: rms = {rms(s):.3f}")
print(f"first eighth: rms = {rms(s[: N // 8]):.3f}")The first three lines print RMS values of 10.000, 10.000 and 7.071, with means of 10.000, 0.000 and 5.000. The sine over a full period gives 0.707. Over only the first eighth of a period it gives 0.426, which is wrong as a description of the signal.
Other points to keep in mind
- RMS is defined for any waveform, not only sine waves. The factor 0.707 (that is, 1/√2) applies only to a sine wave. Other shapes have other ratios between peak and RMS.
- For non-periodic signals, you can apply the same formula over a long observation window. The window should be long compared with the slowest variation.
- RMS is always non-negative and is zero only when the signal is zero at all times.
- For a signal with zero average, the RMS value equals the standard deviation of the signal. This analogy is useful when you analyze noise.
Exercise
A voltage is 6 V for one quarter of each period and 0 V for the remaining three quarters. Find its average value and its RMS value.
Show answer
The average is (1/4)(6) = 1.5 V. The mean of the squares is (1/4)(36) = 9 V², so Vrms = √9 = 3 V. The RMS value is twice the average because heating depends on v², not v.
Exercise
A signal consists of a 3 V DC level plus an AC part whose RMS value is 4 V. What is the RMS value of the total signal, and what power does it deliver to a 5 Ω resistor?
Show answer
Vrms = √(3² + 4²) = 5 V, because the DC and AC parts combine as a root of the sum of squares. The power is Vrms²/R = 25/5 = 5 W.