In the previous video, we took a peak at peak value, peak to peak value and average value
of a sinusoidal signal.
In the domain of electrical engineering and in audio as well,averages are quite important,
and the instantaneous peaks - not so much.
Though we looked at a simple average calculation of sinusoid in the earlier video, that isn’t
how the effective average of a signal is calculated.
The reason for this is basically dependent on what we are trying to find when calculating
the average.
A very important aspect of a signal is the energy that it carries over time.
That’s the power of the signal within a given period of time.
And the RMS value or the root mean square value is needed when calculating the energy
associated with the given signal.
Let’s back up a little before we get carried away.
We’ll put a few bullet points here about the topics that we need to discuss to fully
understand what we just termed as RMS values.
We’ll get to each one of these inturn.
The very first thing we need to talk about is just a brief summary of some electrical
theory to discuss the power drawn from a resistive load in a circuit.
This seems like an off the board topic and doesn’t seem related to audio.
But we are indeed talking about electrical audio signals in the analog domain, so some
discussion of this is warranted.
Next, we’ll derive the equation for what we referred to as the RMS value of voltage
and we’ll visualize what it means and what it looks like
Next, we’ll look at the RMS values for common waveforms and signals, including sinusoids,
square waves, triangle waves, and some others.
Finally, we’ll talk about what an RMS value or an average value means in the context of
audio signal and the sounds that we listen to.
So, why is RMS calculations needed in the first place?
This section of electrical theory is going to be very brief and limited, and if you’re
interested in more of this, I’d highly recommend an electronics 101 lecture, mainly along the
topics of Ohm's law and Watt’s law.
There are plenty of good explainer videos on Youtube.
Let’s say there’s a DC voltage source of around 5V applied to a resistive load,
like a light bulb.
The light bulb would draw a certain amount of current from the source, let's say around
2A.
We can then calculate the power drawn by the bulb in the circuit through Watt’s law by
simply multiplying the voltage and the current.
We can calculate that the bulb draws a power of 10W.
We can do that because this is a DC source and the voltage drop is constant, and doesn’t
change, and we can assume that the current drawn is constant as well.
The instantaneous power drawn from the source, that is the power drawn at any given time
is always the same.
But what if we were to replace the DC source with an AC source.
The AC source is by definition an alternating source of current, and in simple cases, is
a sinusoid at 50-60Hz, much like our test signal that we’ve been discussing the topic
with.
What’s the power drawn by the bulb?
How do we calculate that?
Well, if we apply the formula as is, the instantaneous power would keep changing as the voltage and
current oscillates.
Since AC is typically a periodic function, it makes more sense to calculate the average
power drawn instead.
So, the average power or the mean power is basically the mean of the instantaneous power.
Since we are assuming that it’s a purely resistive load, by using Ohm's law, we can
substitute current here, with voltage divided by resistance.
Since resistance is constant, the average doesn’t apply to the resistance, and we
get the following formula.
In essence, what we are theoretically trying to do here is to replace the AC source with
an equivalent DC source, such that the average power drawn by the bulb would be the same.
If we go by that principle, the equivalent DC voltage would be equal to the square root
of the mean of the squares of the instantaneous AC voltage.
And this is where the term RMS comes from.
It’s the root of the mean of the squares.
Basically, RMS voltage value is just the DC equivalent of an AC source.
So there's a bit of theory for you from an electrical engineering perspective on where
the RMS value comes from.
It might not seem very relevant to you from an audio engineering perspective, but RMS
measurements are dominant everywhere.
For example, the output voltage of the electrical mains in your home, which is 110 V in the
states and 220V everywhere else, that’s an RMS value that’s been indicated.
The peak voltage of a 110V RMS main is around 170V and the Peak to Peak voltage is twice
that at around 340V.
These are values that you hardly ever see.
Similarly, on the spec sheets all audio electronic equipment like amplifiers and powered speakers,
their voltage and current ratings and operating conditions unless otherwise stated are all
RMS values.
A multimeter when measuring AC voltage is giving you a calculated RMS value.
A VU meter which measures the levels of audio signals on onboard analog mixers, they calculate
the RMS voltage of the audio signal being passed through.
The RMS measurements are everywhere, and soon we’ll be calculating and using them as well,
but it’s good to be grounded in its roots and appreciate where it comes from.
So, let’s look at the formula for calculating the RMS value.
Here it is.
It looks a bit complicated, but it really isn’t.
Just think about the abbreviation when in doubt.
Root Mean Square.
This formula has all of that in that particular order.
Similar exercise as the video before, let’s go into the Desmos graphing calculator and
try to visualize this.
So let’s create a function definition f(t) = sin(t) which is basically a sine function
over time.
As you can see, the function completes its period every 2Pi interval of time.
We know now that RMS is root mean squared, but let’s go backwards when analyzing.
Squared.
We square the function f(t).
This is the graph that we get when squaring it.
The square of any number is always a positive number, and so the function is restricted
to the positive amplitude axis.
Next, we have the mean, and mean is basically the average of all values of this function
over its period.
So we integrate this function with respect to time over the period of 0 to 2Pi.
Let’s define the period as T = 2Pi, and then apply integration.
Once we’ve integrated it, we need to divide it by the period.
This is because mean or average is basically the sum of values divided by the number of
values being summed.
Finally, we take the root or the square root of the right hand side, and we get the final
result.
The RMS value of a period of a sinusoid is around 0.707, which is basically the peak
value which is 1 in this case divided by root 2.
This is applicable for all sinusoids.
For all sinusoids, the RMS value is 1/root 2 of the peak value.
Let’s look at another type of signal.
A triangle wave.
This is a perfect triangle waveform, and isn’t a combination of sinusoidal harmonics like
it should be, but it’s fine for this demonstration.
As you can see the value of the RMS is around 0.577 which is the peak amplitude divided
by root 3.
Let’s look at a square wave now.
Again, this is an approximation of an idealistic square wave and isn’t a combination of sinusoidal
harmonics in the general sense, but it works for this demonstration of calculating the
RMS.
And as you can see, the RMS is around 1.
It isn’t quite 1, because it’s not a perfect square wave, but it tends towards 1.
That means for a square wave, the RMS value is equal to the peak amplitude.
So, summing up, the RMS value is based on the energy that is contained in a given signal,
you can think about it as the average of time varying signals over a given period of time.
Now the question is, how is this applicable to audio and what does an RMS value signify
in the context of audio signals?
We can think about audio signals as electrical signals.
They are in-fact electrical signals.
Their voltage is time varying.
Rarely are audio signals ever pure sinusoids or even harmonic for that matter.
Real world audio signals are complex.
So to find the power associated with these signals, RMS calculations are the way to go,
but as you can imagine, complex real world signals like speech don't have any discernible
periodicity associated with them.
For these signals, we need to apply time weighting, and we’ll discuss that in future videos.
But why calculate RMS at all?
When we listen to sounds, we don't perceive the loudness of sounds based on the peaks
that they contain.
I’ve got two clips here, one is an uncompressed drum signal.
And here’s another clip with compressed metal music.
I’ve normalized both of these tracks such that both their peaks are equal.
Let’s listen to them in turns.
As you could hear, though the peaks are normalized, the perceived loudness of the second track
is far greater than the first.
The drum track has large transients when the drums are hit, but they decay fast.
The amount of time that you experience the transient is really important for our apparent
perception of loudness.
Large but short transients don’t sound loud to us.
Whereas high levels sustain over larger lengths of time do infact sound loud.
If you observe the meters here, the light green indicates peak levels and the darker
green represents RMS levels.
As you can, when they’re played side by side, their peak levels match up, but their
RMS levels are way off.
The RMS level, though not a perfect metric of subjective loudness,is the simplest way
to get an idea of how loud a signal is.
It’s easy to calculate and easy to implement.
It doesn’t take into account the frequency aspect of the sound source, but it does take
into account the temporal aspect of the sound source.
In the next video, we’ll explore more about the temporal aspect of sound.
We’ll see how the duration of transients of a sound plays an integral part in determining
loudness.
We’ll keep the discussion of RMS going and we’ll talk about Time weighting.