Skip to content

Lesson 3 of 320 min Essential path

How big is a signal

Put one number on how big a signal is, from energy and power to mean, RMS, crest factor, decibels and SNR.

Before thisKinds of signals (1.2)

1 more before it

What a signal is (1.1)

Before this1.2 · 1 more
Chapter 1 · Lesson 3 of 3

First, the picture

Here is one handclap as a signal. Drag Add up to across it and watch Total so far climb, then stop climbing.

Adding it all up

Drag the window edge across the clap: the shaded part is what gets added.

Total so far
101.6
Samples counted
19
0.08 s
Describe this picture

Two panels against time in seconds: a single handclap, 240 samples over one second, as x[n]x[n], and below it each sample squared, x[n]2x[n]^2. The part up to the window edge is shaded in both. The “Add up to” slider moves the edge from 0 to 1 s, and two readouts show “Total so far”, the sum of the shaded squares, and “Samples counted”.

Adding it all up

Kinds of signals (1.2) gave you six questions for sorting signals. None of them said how big a signal is, and that is what this page is for.

Clap your hands once and picture the clap as a signal. It has a number at every sample, mostly near zero, spiking up and down for a fraction of a second, then settling back to silence. How would you put one number on how big that clap was?

Your first idea might be to add up the values. That does not work: a signal swings above and below zero, so the positive and negative parts cancel, and you get almost nothing however loud the clap was. To avoid this, square each value first. Squaring removes the sign, so a big swing counts as big whether it went up or down.

Add up the squared values across the whole clap and you get the clap’s energy, written EE:

E=∑nx[n]2E = \sum_n x[n]^2

As in Kinds of signals (1.2), x[n]x[n] is the value at sample number nn, and x[n]2x[n]^2 is that value squared. The symbol ∑n\sum_n means “add this up over every nn you have”.

In the picture at the top of the page, the shaded part of the lower panel is what gets added.

Notice that once you pass the clap, moving the slider further barely changes the total. The clap does not last forever, so its energy has a fixed, finite value once you have included all of it.

Average per sample

Energy works well for something that starts and finishes, like a clap. But what about a sound that never stops, like the steady hum of a fan? If you added up its squared values forever, the total would keep climbing forever. Energy would be infinite, which is not a useful number.

Instead, divide by how many samples you added. Instead of a running total, you track a running average: the total so far, divided by the number of samples so far. This is average power, written PP:

P=1N∑n=0N−1x[n]2P = \frac{1}{N}\sum_{n=0}^{N-1} x[n]^2

for a long stretch of NN samples.

In words: add up the squared values over NN samples, divide by NN, and make the stretch longer until the number stops changing. A signal like the clap ends, so its energy is finite while the window keeps growing. Its average power therefore keeps shrinking toward zero. A signal like the hum keeps going, so its average power settles to a positive constant.

Switch between Handclap and Steady hum, and drag How long you listen to 0.3, 1 and 3 seconds each time.

Average per sample

Drag out how long you listen: the shaded part is what gets averaged.

Average power per sample
2.53
Samples averaged
72
Sound
0.30 s
Describe this picture

One panel, x[n]x[n] against time in seconds: a handclap or a steady hum, 720 samples over three seconds, 240 a second, chosen with the “Sound” buttons “Handclap” and “Steady hum”. The part you listen to is shaded, from 0 to the “How long you listen” slider, which runs to 3 s. Two readouts show “Average power per sample” and “Samples averaged”.

For the clap, Average power per sample reads 2.53, then 0.80, then 0.27: it keeps shrinking the longer you listen. For the hum it reads 0.54, then 0.50, then 0.50, so it settles to a constant.

That is the difference between an “energy signal” and a “power signal”: which of the two numbers, EE or PP, is finite and nonzero.

Three waveforms

The next section compares three standard shapes. Here they are first, so that nothing there is a surprise. Each rises to 1 and falls to −1-1. We call that height the amplitude.

Three waveforms

All three rise to 1 and fall to -1; only the shape differs.

Sine

A sine wave rises and falls smoothly, like a pendulum swinging.

Square

A square wave sits at the top, jumps to the bottom, sits there, and jumps back, over and over.

Triangle

A triangle wave climbs in a straight line to the top, then falls in a straight line to the bottom.

Describe this picture

A still picture of three small plots side by side, Sine, Square and Triangle, each x(t)x(t) against time in seconds over two periods, rising to 1 and falling to −1-1, with a sentence under each saying how it moves.

A sine wave rises and falls smoothly, like a pendulum swinging. A square wave sits at the top, jumps to the bottom, sits there, and jumps back, over and over. A triangle wave climbs in a straight line to the top, then falls in a straight line to the bottom.

Compare the three shapes. They have the same amplitude, so any difference in “size” comes from the shape alone.

Four everyday sizes

Energy and power are precise, but they are not the numbers you use most often. In practice you usually want one of four simpler numbers.

The mean is the plain average, with no squaring. Engineers often call it the DC value, borrowing the name from a battery’s steady “direct current”:

xˉ=1N∑n=0N−1x[n]\bar x = \frac{1}{N}\sum_{n=0}^{N-1} x[n]

It tells you whether the signal sits above or below zero on average. The peak is the single largest value the signal reaches, ignoring sign:

xpeak=max⁡n∣x[n]∣x_\text{peak} = \max_n \lvert x[n] \rvert

The RMS (root-mean-square) value is an “effective average size” that, unlike the plain mean, does not cancel positive against negative. The name reads right to left: square every value, average the squares, then take the square root of that average:

xrms=1N∑n=0N−1x[n]2x_\text{rms} = \sqrt{\frac{1}{N}\sum_{n=0}^{N-1} x[n]^2}

RMS is closely related to power: it is P\sqrt{P} over the window you average on. Finally, the crest factor compares peak to RMS:

CF=xpeakxrms\mathrm{CF} = \frac{x_\text{peak}}{x_\text{rms}}

A high crest factor means the waveform spends most of its time well below its highest value, a spiky shape. A crest factor near 1 means it stays close to its peak almost all the time, a flat-topped shape.

Switch between Sine, Square and Triangle, all at the same peak amplitude, and watch which readouts move.

Four everyday sizes

Same peak, different shape.

Mean
0.00
Peak
1.00
RMS
0.71
Crest factor
1.41
Waveform
Describe this picture

One plot, x[n]x[n] against time in seconds, of a sine, square or triangle wave at peak amplitude 1, chosen with the “Waveform” buttons. Four readouts show “Mean”, “Peak”, “RMS” and “Crest factor”, to two decimals. For the square wave a line on the plot is labelled “peak = RMS”.

Notice that Peak never moves, because it is fixed by how the waveform was built. RMS and Crest factor do move. For the square wave the plot labels the line “peak = RMS”, because the two are equal and the crest factor is 1. The triangle spends more time away from its peak, so its RMS is lowest and its crest factor is highest.

Where do those RMS values come from? Take amplitude 1 and average the squared values over one period.

  • Sine. Use the identity sin⁡2θ=12(1−cos⁡2θ)\sin^2\theta = \tfrac12(1-\cos 2\theta). The cosine part averages to zero, so the average of x2x^2 is 12\tfrac12 and xrms=1/2≈0.707x_\text{rms} = 1/\sqrt2 \approx 0.707.
  • Square. The value is always ±1\pm 1, so x2=1x^2 = 1 everywhere and xrms=1x_\text{rms} = 1.
  • Triangle. Every straight segment sweeps the magnitude evenly from 0 to 1. The average of u2u^2 for uu from 0 to 1, where uu is the height as a fraction of the peak, is 13\tfrac13 (in calculus terms, ∫01u2 du=13\int_0^1 u^2\,du=\tfrac13), so xrms=1/3≈0.577x_\text{rms} = 1/\sqrt3 \approx 0.577.

Signal and noise, in decibels

Loudness ranges are enormous: the quietest sound you can hear and the loudest sound that hurts differ by a factor of roughly a trillion in power. Numbers that large are awkward to write down, compare or read off a meter. A logarithmic scale called decibels (dB) solves this.

For a power ratio, the level in decibels is ten times the base-10 logarithm of the ratio. Multiplying the power by 10 always adds 10 dB, whatever you started from:

LdB=10log⁡10PPrefL_\text{dB} = 10\log_{10}\frac{P}{P_\text{ref}}

Amplitude is easier to measure than power, so let’s convert. Power is proportional to the amplitude squared, so P/Pref=(xrms/xref)2P/P_\text{ref} = (x_\text{rms}/x_\text{ref})^2. Because log⁡10(a2)=2log⁡10a\log_{10}(a^2) = 2\log_{10} a, the factor of 10 becomes 20:

LdB=10log⁡10(xrmsxref)2=20log⁡10xrmsxref\begin{aligned} L_\text{dB} &= 10\log_{10}\left(\frac{x_\text{rms}}{x_\text{ref}}\right)^2 \\ &= 20\log_{10}\frac{x_\text{rms}}{x_\text{ref}} \end{aligned}

A meter that reports level relative to the loudest value a digital system can hold gives you dBFS (“dB full scale”):

LdBFS=20log⁡10xxFSL_\text{dBFS} = 20\log_{10}\frac{x}{x_\text{FS}}

with xFS=1x_\text{FS} = 1, the full-scale peak.

Here xx is the level you measure, and xFSx_\text{FS} is the full-scale value the system can hold. On this page we measure the level xx as an RMS value.

Once you can measure size in dB, you can measure how clean a recording is. Signal-to-noise ratio (SNR) compares the size of the part you want to the size of the part you do not, in dB:

SNRdB=20log⁡10xsignal,rmsxnoise,rms\mathrm{SNR}_\text{dB} = 20\log_{10}\frac{x_{\text{signal,rms}}}{x_{\text{noise,rms}}}

Here xsignal,rmsx_{\text{signal,rms}} is the RMS of the signal alone and xnoise,rmsx_{\text{noise,rms}} is the RMS of the noise alone. A bigger SNR means the wanted part dominates the unwanted part by more.

Drag How much noise up and down, and watch Signal-to-noise.

Signal and noise, in decibels

Turn up the noise and watch the SNR fall.

tone alonetone + noise
Noise level
-40.0 dB
Signal-to-noise
40.0 dB
-40 dB
Describe this picture

One plot, the level against time in seconds, of the tone alone in grey and the tone plus noise over it. The “How much noise” slider runs from −60-60 to 0 dB. The “Noise level” readout is the noise’s RMS in dB relative to the tone’s RMS, and “Signal-to-noise” is the SNR; both are measured from the samples drawn, to one decimal. It starts at −40-40 dB: “Noise level” reads −40.0-40.0 dB and “Signal-to-noise” reads 40.040.0 dB.

Notice that each dB you add to Noise level takes exactly one dB off Signal-to-noise. In dB a ratio becomes a difference, so each dB of noise comes straight off the SNR.

Worked example

A full-scale sine, in dBFS. Take a sine wave with peak A=1A = 1, the largest value a system scaled to ±1\pm 1 can hold. Its average squared value is x2‾=1/2\overline{x^2} = 1/2, as in the working above, so

xrms=12=0.70711LdBFS=20log⁡1012=−3.0103 dBFS\begin{aligned} x_\text{rms} &= \frac{1}{\sqrt2} = 0.70711 \\ L_\text{dBFS} &= 20\log_{10}\frac{1}{\sqrt2} = -3.0103\,\text{dBFS} \end{aligned}

Measured by RMS, a sine at the loudest amplitude the system can hold reads about −3-3 dBFS, not 0, because a sine’s RMS is always below its peak. Measured by peak, it reads 0 dBFS. AES17 also calls it 0 dBFS, because it defines 0 dBFS as the RMS of a full-scale sine.

SNR from an amplitude ratio. Say the tone has amplitude Asig=0.9A_\text{sig} = 0.9. As a simple stand-in for noise, use a second sine with amplitude Anoise=0.009A_\text{noise} = 0.009. The amplitude ratio is Anoise/Asig=0.01A_\text{noise}/A_\text{sig} = 0.01, which is −40-40 dB, since 10−40/20=0.0110^{-40/20} = 0.01. Both are sinusoids, so the 1/21/\sqrt2 RMS factor is the same on top and bottom and cancels from the ratio:

SNRdB=20log⁡10AsigAnoise=20log⁡10100=40.0 dB exactly.\mathrm{SNR}_\text{dB} = 20\log_{10}\frac{A_\text{sig}}{A_\text{noise}} = 20\log_{10}100 = 40.0\,\text{dB exactly.}

Crest factor, three waveforms at the same peak (A=1A = 1). The sine has CF=2=1.41421\mathrm{CF} = \sqrt2 = 1.41421 (3.01033.0103 dB), the square wave (always at ±A\pm A) has CF=1\mathrm{CF} = 1 (00 dB), and the triangle has CF=3=1.73205\mathrm{CF} = \sqrt3 = 1.73205 (4.77124.7712 dB).

Where you’ll meet this

A phone’s signal-strength bars are a rough dB scale on received power. A microphone’s spec sheet quotes how much noise it adds, and how loud a sound it can take, in dB. A recording app’s level meter reads RMS, or sometimes peak, against a 0 dBFS ceiling. It warns you when a signal is about to hit that ceiling and have its tops flattened, which engineers call clipping. Each of these is the same small set of numbers from this page, read off a different device.

Reference card

QuantityFormulaNotes
Energy (discrete)E=∑nx[n]2E=\sum_n x[n]^2Finite for any finite excerpt
Average power (discrete)P=1N∑n=0N−1x[n]2P=\frac1N\sum_{n=0}^{N-1} x[n]^2, NN largeEnergy signal: finite EE, P=0P=0. Power signal: finite, positive PP
Mean (DC)xˉ=1N∑n=0N−1x[n]\bar x=\frac1N\sum_{n=0}^{N-1} x[n]Plain average, no squaring
RMSxrms=1N∑n=0N−1x[n]2x_\text{rms}=\sqrt{\frac1N\sum_{n=0}^{N-1} x[n]^2}“Square, average, square-root”
Peakxpeak=max⁡n∣x[n]∣x_\text{peak}=\max_n\lvert x[n]\rvertLargest magnitude reached
Crest factorCF=xpeak/xrms\mathrm{CF}=x_\text{peak}/x_\text{rms}11 (0 dB) square, 2\sqrt2 (3.01 dB) sine, 3\sqrt3 (4.77 dB) triangle
dBFSLdBFS=20log⁡10(x/xFS)L_\text{dBFS}=20\log_{10}(x/x_\text{FS})xFS=1x_\text{FS}=1 (full-scale peak); full-scale sine measured by RMS reads −3.01-3.01 dBFS
SNRSNRdB=20log⁡10(xsignal,rms/xnoise,rms)\mathrm{SNR}_\text{dB}=20\log_{10}(x_{\text{signal,rms}}/x_{\text{noise,rms}})1 dB more noise = 1 dB less SNR

End of lesson 1.3

Where to go next.

Phasorium
LibraryEvery lesson, in order

Parts

About Phasorium
Look