Regular readers know that I try not to bring calculus into my articles on electronics. Even among geeks, relatively few folks are fluent in it. Many college calculus classes are a rapid-fire of poorly-explained formulas that take a long time to memorize — and only a moment to forget.
My target audience are hobbyists who might not have taken this coursework in the first place, or who remember none of it after a decade of churning out JavaScript. This is why many of my articles try to buck the trend and explain “calculus-worthy” concepts using simple math. Some of the notable examples include the write-ups on capacitive reactance, the behavior of RC filters, or the mechanics of superheterodyne receivers.
Today, I’d like to take an angry swipe at the derivation of the formula for the root-mean-square voltage (Vrms) that is currently the #1 hit on Google:
I think we can do better than that.
Hol’ up, what’s root-mean-square voltage?
This section assumes familiarity with voltage and impedance. If you need a refresher, review this article first.
Every now and then, we want to figure out the power that’s delivered by a given voltage to a load of known impedance; a good example is sizing the amplifier circuitry for driving an audio speaker.
In the article linked above, we derived the following formula:
This equation makes sense if the voltage is constant — but what if the signal changes over time?
To answer that question, let’s study a toy example of a 10 Ω load and a supply voltage that changes in three discrete steps. In this setup, we can calculate power in each slice separately:
With this done, we can compute a simple arithmetic mean to get the average power delivered to the load over time:
The result is correct, but in some contexts, it’s useful to instead calculate the equivalent DC voltage that would deliver the same average power to the load. If you have that figure, you can plug it into a variety of power-related equations without doing any extra math.
How do we do that? Is it just an arithmetic mean of the voltages in each time slice? Let’s find out:
The results don’t match. The problem is the V² term in the power equation. To figure out the correct approach, we can just solve the power equation for our toy example symbolically.
The component equations are P0 = V0 / R, P1 = V1 / R, and P3 = V3 / R, so:
Upon closer inspection, we can restate this as:
The first half of the expression is just an arithmetic mean of the squares of voltages, sitting right where the V² part used to! Another way to put this is that we’re squaring the original waveform first, and then calculating a standard arithmetic mean of that.
Anyway, let’s call that weird mean x and and confirm that the math checks out:
But what is x in physical terms? It’s not a substitute for voltage in the original power expression; remember that it took place of the square of voltage (V²). To get the power-equivalent voltage we talked about, we need to calculate a square root of this value.
And that’s what “root mean square” voltage (Vrms) is: it’s the square root of mean value of a squared waveform. In this case, Vrms = √34 ≈ 5.831 V.
Vrms for sine waves
In analog electronics, we often work with sine signals — and that’s where Wikipedia usually hits you with calculus. Calculating Vrms for a square wave is simple and analogous to the experiment we conducted before; but can we pull this off for a sine wave?
The answer is yes! Let’s start with a fundamental model of a sine-wave signal of a given amplitude Vp is:
The timing expression might be scaled differently and there might be constant offset added, but it doesn’t change anything of consequence.
Now, let’s have a look at the most basic, visual explanation of sine and cosine in the context of right-angle triangles:
It should be fairly obvious that if we choose the hypotenuse (the long edge) to have a length of n, then the height of the vertical edge is equal to sin(a) × n and the length of the horizontal edge is cos(a) × n.
This being a right triangle, we can also describe the relationship between its sides using the Pythagorean theorem:
As it happens, we already know the values for these! Let’s plug them in and see what comes out:
We have… something. But is this what we need?
Recall that for the Vrms value of any signal, we need to calculate the square root (1) of the mean value (2) of the squared waveform (3). Our waveform is given by Vp × sin(t).
Step (1) is easy, but it actually needs to wait until we’re done with everything else. Step (3) also isn’t hard: the squared form is Vp² × sin²(t). For simplicity, we can set the constant part — Vp² — aside. It’s just a scaling factor, so we can multiply the mean by that. But now we need to figure out the mean of sin²(t)…
Well, let’s look for inspiration in the plot of a single full period of sin(t) and cos(t):
Next, let’s do some advanced mathematical surgery on the cosine part:
This precision modification makes it clear that within every period, sin(t) and cos(t) go through the exact same values, just at an offset with respect to t. For every sin(<sth>) = 0.5, there’s a matching cos(<sth>) = 0.5, except in a different spot. Logically, the same must be true for sin²(t) and cos²(t).
It follows that within the full period, the mean of sin²(t) and cos²(t) must be equal: we’re summing the same values and there’s the same number of them.
Previously, we didn’t know what to do with this equation:
…but if that equation holds true for individual values, it must also hold for the median of all values. To use a simpler example: if you only allow $5 bills in a piggy bank, then the median value of all bills in the piggy bank will also be $5.
Anyway, if we denote the sin²(t) period mean as Sm and cos²(t) period mean as Cm, we can tap into the formula above and assert that:
Further, because we’ve established that both means have the same value within a full period of the function, we can get rid of Cm, replacing it with Sm:
Now, Sm is the mean of the squared waveform with an amplitude of 1 — but it’s still missing the Vp² scaling term that we set aside earlier on. We need to plug that in; just as importantly, we need to complete the last step of computing the root mean square and actually take that square root:
As they say in France, viola!
👉 For a catalog of my other articles about electronics and math, click here.
I write well-researched, original articles about geek culture, electronic circuit design, and more. If you like the content, please subscribe. It’s increasingly difficult to stay in touch with readers via social media; my typical post on X is shown to less than 5% of my followers and gets a ~0.2% clickthrough rate.
Beautiful analysis. Could you write a post for when V/I are out of sync? Please keep posting!