Skip to content

Reading a spectrum: scaling and units

Turn raw FFT numbers into volts, volts squared or volts squared per hertz, and learn which one reads a tone true and which reads noise true.

Before this15.2 · 4 more
Chapter 15 · Lesson 4 of 6

First, the picture

One raw spectrum, turned into volts and then into power in three steps. Watch the tone’s reading go from a bare count to its true amplitude.

From raw FFT to volts

A 1 V, 1000 Hz tone plus noise of RMS 0.1 V; f_s = 8 kHz, N = 1024, Hann window.

Raw |X[k]|: the tone's bin reads 256, or 48.2 dB. That is A × Σw/2 with Σw = 512 for this window: a count with no unit.

scaling
raw |X[k]|
tone reads
48.2 dB
0.00 / 15.00 s
Describe this picture

A 1 V, 1000 Hz tone plus noise of RMS 0.1 V, with fs=8f_s = 8 kHz, N=1024N = 1024 and a Hann window. One panel, with frequency from 0 to 4000 Hz, ticks every 1000, and a vertical axis from −70 to 60 whose title changes with the step: “|X[k]| (dB)”, then “dB re 1 V”, “dB re 1 V”, and “dB re 1 V²”. The spectrum, bins 0 to 512, is a thin solid line, and the tone’s bin is ringed. From the third step on, a dashed horizontal line marks the truth, labelled “1 V (0 dB)” and later “0.5 V² (−3.0 dB)”. One row of readouts gives the scaling and what the tone reads in dB with its reference, such as “0.0 dB re 1 V”.

The clip plays once, in 15 s, holds on its last frame and has no control. It opens on the raw ∣X[k]∣\lvert X[k]\rvert (readouts “raw |X[k]|”, “48.2 dB”): “Raw |X[k]|: the tone’s bin reads 256, or 48.2 dB. That is A × Σw/2 with Σw = 512 for this window: a count with no unit.” The whole curve then slides down 54.2 dB, and the vertical axis changes its title when the slide ends (”÷ Σw”, “−6.0 dB re 1 V”): “Divide by Σw: the tone reads 0.5, −6.0 dB re 1 V. The other half of the tone sits in the mirror bin at −1000 Hz.” Next the curve rises 6.0 dB (”× 2, one-sided”, “0.0 dB re 1 V”): “Fold the mirror half on (× 2 for every bin except 0 and N/2): the tone reads 1.00 V, 0.0 dB, its true amplitude. This is an amplitude spectrum.” Last, the curve drops 3.0 dB and the floor moves with it (“a² ÷ 2: power”, “−3.0 dB re 1 V²”), and the dashed line is now labelled “0.5 V² (−3.0 dB)”: “Square and halve: 0.500 V², −3.0 dB re 1 V², the tone’s power (its RMS squared). A power spectrum reads tones true. The noise floor, near −45 dB here, is another matter: it depends on N.” Reduced motion rests on the last frame and offers the four steps in turn.

An FFT’s numbers have no unit

The DFT (13.2) gives X[k]X[k], and nothing about it says volts. Its size depends on how many samples you took and on which window you used. Read it as it comes, and the same 1 V tone shows a different number every time you change NN or the window.

This page turns ∣X[k]∣\lvert X[k]\rvert into three quantities that do have units. The amplitude spectrum is in volts (V), and reads a tone’s amplitude. The power spectrum is in V², and reads a tone’s power. The power spectral density, or PSD, is in V² per hertz, and reads how much noise power sits in each hertz. Each reads one kind of signal true, and I will show you which and why.

I use one test signal for the whole page: a 1 V tone at 1000 Hz plus white noise of RMS 0.1 V, sampled at fs=8f_s=8 kHz and cut by a Hann window (Window functions compared, 15.2). Its truths are known in advance. The tone’s amplitude is 1 V. Its power is A2/2=0.5A^2/2=0.5 V², which is −3.01-3.01 dB re 1 V². The noise power is Pnoise=0.12=0.01P_\text{noise}=0.1^2=0.01 V².

White noise spreads its power evenly from −fs/2-f_s/2 to fs/2f_s/2 (Oversampling and noise shaping, 11.3). Folded onto positive frequencies only, which I call the one-sided form, that is a density of 2Pnoise/fs2P_\text{noise}/f_s. Here it is 2(0.1)2/8000=2.5×10−62(0.1)^2/8000=2.5\times10^{-6} V²/Hz, or −56.02-56.02 dB re 1 V²/Hz.

Two facts from earlier pages carry the rest. A tone of amplitude AA sitting on bin kk reads ∣X[k]∣=A∑w[n]/2\lvert X[k]\rvert=A\sum w[n]/2 (Window functions compared, 15.2), where the sum runs over the window’s NN samples. Half of the tone sits in bin kk and half in its mirror bin N−kN-k (The DFT, 13.2).

From raw FFT to volts

Three plain steps turn ∣X[k]∣\lvert X[k]\rvert into the tone’s amplitude. Divide by ∑w\sum w, which removes the window’s gain and the length NN together. Fold the negative half onto the positive half by multiplying by 2. Then the peak reads volts. Squaring and halving that amplitude gives power. It is like a kitchen scale: a raw count, minus the bowl, times the calibration, is grams.

The picture at the top of this page follows these steps for the page’s test signal, with N=1024N=1024. The raw ∣X[k]∣\lvert X[k]\rvert of the tone’s bin reads 256, or 48.2 dB: a count with no unit. For N=1024N=1024 the Hann window sums to 512, so the tone reads 1×512/2=2561\times512/2=256, which is 20log⁡10256=48.220\log_{10}256=48.2 dB.

Dividing by ∑w\sum w slides the whole curve down 54.2 dB, which is 20log⁡1051220\log_{10}512. The tone now reads 0.5, −6.0-6.0 dB re 1 V. The other half of the tone sits in the mirror bin at −1000-1000 Hz.

Folding the mirror half on raises the curve 6.0 dB, the factor 2. The tone reads 1.00 V, 0.0 dB, its true amplitude: this is an amplitude spectrum. Bins 0 and N/2N/2 have no mirror partner, so they are not doubled.

Squaring and halving drops the curve 3.0 dB, and the floor moves with it. The tone reads 0.500 V², −3.0-3.0 dB re 1 V², its power, which is its RMS squared. A power spectrum reads tones true. The noise floor, near −45-45 dB here, is another matter: it depends on NN.

Written out, the amplitude and power spectra of a one-sided bin kk are

Ak=2∣X[k]∣∑nw[n],Ak22=2∣X[k]∣2(∑nw[n])2.A_k=\frac{2\lvert X[k]\rvert}{\sum_n w[n]},\qquad \frac{A_k^2}{2}=\frac{2\lvert X[k]\rvert^2}{\big(\sum_n w[n]\big)^2}.

The second is the power spectrum. Its unit is V², and for a tone it reads the power, A2/2A^2/2. The noise floor is a separate matter, and the next section turns to it.

Why the floor depends on N

A white noise sample of power PnoiseP_\text{noise} is multiplied by the window and added up, so a bin of pure noise has mean square Pnoise∑w2P_\text{noise}\sum w^2. Put that in the power-spectrum formula and you get a floor of

2Pnoise∑w2(∑w)2=2Pnoise ENBWN,\frac{2P_\text{noise}\sum w^2}{\big(\sum w\big)^2}=\frac{2P_\text{noise}\,\mathrm{ENBW}}{N},

because ENBW=N∑w2/(∑w)2\mathrm{ENBW}=N\sum w^2\big/\big(\sum w\big)^2 (Window functions compared, 15.2). The tone’s reading did not change with NN, but the floor falls as NN grows. Another way to say it: each bin is fs/Nf_s/N wide, so it collects the noise of ENBW⋅fs/N\mathrm{ENBW}\cdot f_s/N hertz. A longer record has narrower bins and each one catches less.

For the Hann window at N=1024N=1024 the floor is 2(0.01)(1.5)/1024=2.93×10−52(0.01)(1.5)/1024=2.93\times10^{-5} V², which is −45.33-45.33 dB re 1 V². Four times the length lowers it by 10log⁡104=6.0210\log_{10}4=6.02 dB.

Longer records: the tone stays, the floor moves

The cure is to divide by the width of a bin in hertz. A bin’s noise width is ENBW⋅fs/N\mathrm{ENBW}\cdot f_s/N, so dividing the power spectrum by it gives

Sx1s(fk)=2∣X[k]∣2fs∑nw[n]2.S_x^{\text{1s}}(f_k)=\frac{2\lvert X[k]\rvert^2}{f_s\sum_n w[n]^2}.

This is the power spectral density, in V²/Hz, written Sx1s(f)S_x^{\text{1s}}(f), where the superscript “1s” means one-sided. Put the noise floor into it, and the factors of NN cancel: 2Pnoise∑w2/(fs∑w2)=2Pnoise/fs2P_\text{noise}\sum w^2/(f_s\sum w^2)=2P_\text{noise}/f_s, the truth from the start. Now I will show the trade at three lengths and then in reverse.

Watch the dotted floor: in the power spectrum it falls as NN grows, and in the density it sits on the truth line at every NN.

Longer records: the tone stays, the floor moves

The same signal, first as a power spectrum (V²), then as a power spectral density (V²/Hz), for N = 256, 1024 and 4096.

Power spectrum, N = 256: the tone reads −3.0 dB re 1 V², its true power. The noise floor sits near −39 dB.

N
256
bin spacing
31.25 Hz
tone peak
−3.0 dB
noise floor
−39.1 dB
0.00 / 17.00 s
Describe this picture

The same signal, first as a power spectrum (V²), then as a power spectral density (V²/Hz), for NN = 256, 1024 and 4096. One panel, with frequency from 0 to 4000 Hz and a vertical axis from −70 to 0, ticks at 0, −20, −40 and −60, titled “dB re 1 V²” in the first part and “dB re 1 V²/Hz” in the second. The one-sided spectrum is a thin solid line. A dashed truth line is labelled “tone power, −3.0 dB” in the first part and “noise density, −56.0 dB” in the second, and the measured floor is a dotted level labelled “floor”. The readouts are NN and the bin spacing, then the tone peak and the noise floor.

The clip plays once, in 17 s, and holds on its last frame. It starts as a power spectrum at N=256N=256 (bin spacing 31.25 Hz, tone peak −3.0 dB): “Power spectrum, N = 256: the tone reads −3.0 dB re 1 V², its true power. The noise floor sits near −39 dB.” At N=1024N=1024 (7.81 Hz): “N = 1024: the tone still reads −3.0 dB, but the floor is 6 dB lower, near −45 dB. Each bin is narrower and collects less noise.” At N=4096N=4096 (1.95 Hz): “N = 4096: floor near −51 dB. The noise did not change; only the bins did. A power spectrum misreads noise by an amount that depends on N.” Then the scaling changes to density, and the whole curve slides down 4.7 dB: “Divide by each bin’s noise width, ENBW × f_s/N = 2.93 Hz: a density. The floor now reads −56 dB re 1 V²/Hz, the true noise density. The tone’s peak reads −7.7 dB, a number with no meaning for a tone.” The clip then goes back down in length. At N=1024N=1024: “N = 1024: the floor stays at −56 dB; the tone’s peak drops to −13.7 dB.” At the end: “N = 256: floor still −56 dB, tone −19.7 dB. A density reads noise true at every N; a power spectrum reads tones true. Choose the scaling for what you measure.”

When the clip has finished, a control named “Record length N”, reading “1024 samples”, sets NN from 256 to 8192 in powers of two; the hint reads “Drag across the plot, or use the arrow keys, to set N (256 to 8192).” Home and End jump to 256 and 8192. At 256, 1024 and 4096 the caption is the one above for that length. At 2048 and 8192 it reads, with the live tone value, “N = 8192: the floor stays near −56 dB; the tone’s peak reads −4.7 dB.”

As a power spectrum, the tone reads −3.0-3.0 dB re 1 V², its true power, at every length. The floor sits near −39-39 dB at N=256N=256, −45-45 dB at 1024 and −51-51 dB at 4096, 6 dB lower each time NN grows four times. The noise did not change; only the bins did. A power spectrum misreads noise by an amount that depends on NN.

Then the scaling changes to density. The floor now reads −56-56 dB re 1 V²/Hz, the true noise density. At N=4096N=4096 each bin’s noise width is ENBW⋅fs/N=1.5×8000/4096=2.93\mathrm{ENBW}\cdot f_s/N=1.5\times8000/4096=2.93 Hz, and the slide is 10log⁡10(N/(fs ENBW))=−4.6710\log_{10}\big(N/(f_s\,\mathrm{ENBW})\big)=-4.67 dB.

Going back down in length, the floor stays at −56-56 dB, and the tone’s peak drops, to −13.7-13.7 dB at N=1024N=1024 and −19.7-19.7 dB at 256. A density reads noise true at every NN; a power spectrum reads tones true. Choose the scaling for what you measure.

Why does the tone’s peak move in the density? The tone’s power is fixed at 0.5 V², and it all lands in one bin whose noise width is ENBW⋅fs/N\mathrm{ENBW}\cdot f_s/N hertz. Its density there is the power divided by that width, which changes with NN, so a density cannot read a tone. Its peak is 0.5/2.93=0.1710.5/2.93=0.171 V²/Hz at N=4096N=4096, which is −7.68-7.68 dB.

When the clip has finished, drag across the plot to set NN yourself, from 256 to 8192. In the density view the dotted floor sits on the truth line at every NN you set. The tone’s peak is what changes.

The maths behind it · variance per unit frequency

A PSD is a variance per unit frequency: integrate it over frequency and you get the noise’s variance, as a probability density integrates to 1. The noise floor’s average is an estimate of that density, and its scatter from bin to bin is the subject of The periodogram (25.1).

One spectrum, four units

Here are all the scalings in one place, for one-sided bins 1≤k≤N/2−11\le k\le N/2-1.

You wantFormulaUnitIn dB
Amplitude2∣X[k]∣/∑w2\lvert X[k]\rvert/\sum wVdB re 1 V
RMS amplitudeamplitude /2\big/\sqrt2VdB re 1 V
Power spectrum2∣X[k]∣2/(∑w)22\lvert X[k]\rvert^2/(\sum w)^2V²dB re 1 V²
PSD2∣X[k]∣2/(fs∑w2)2\lvert X[k]\rvert^2/(f_s\sum w^2)V²/HzdB re 1 V²/Hz

Fig. Bins 0 and N/2 are not doubled. SciPy’s periodogram(…, scaling=‘spectrum’) returns the power spectrum and scaling=‘density’ the PSD, both one-sided for real input.

For a digital signal with full scale xFS=1x_\text{FS}=1, the amplitude in dB becomes dBFS (Signal size, 1.3), and the PSD becomes dBFS/Hz. A full-scale sine reads −3.01-3.01 dBFS by RMS and 0 dBFS by peak, and this site uses the peak form unless it says otherwise. Amplitudes and RMS use 20log⁡1020\log_{10}. Powers and densities use 10log⁡1010\log_{10}. Always write the reference after the dB.

Window sums connect to the numbers of 15.2: ∑w=N CG\sum w=N\,\mathrm{CG} and ∑w2=N CG2 ENBW\sum w^2=N\,\mathrm{CG}^2\,\mathrm{ENBW}, where CG\mathrm{CG} is the coherent gain. NumPy’s np.hanning is the symmetric Hann, so its sums differ slightly from the periodic window used here.

Getting a tone’s power from a PSD

A PSD does not read a tone, but you can still get the tone’s power out of it. Add the density over the tone’s lobe and multiply by the bin spacing fs/Nf_s/N. For this page’s tone the sum is ∑Sx1s⋅fs/N=0.500\sum S_x^{\text{1s}}\cdot f_s/N=0.500 V², the true power.

Do the same with the power spectrum and you overcount. The lobe of a power spectrum adds to 0.7500.750 V², which is 0.5×ENBW=0.5×1.50.5\times\mathrm{ENBW}=0.5\times1.5, because every bin of the lobe is already a power, not a density. With no noise, SciPy’s periodogram(x, 8000, window='hann', scaling='spectrum') reads 0.500 V² at the tone’s bin. With the noise of the instrument’s signal, that bin reads 0.5003 V² for one draw: 0.5 plus the noise in that bin.

Noise density in everyday terms: 2.5×10−6=1.58\sqrt{2.5\times10^{-6}}=1.58 mV per root hertz. That is how data sheets quote it, and squaring it gives back the PSD.

dBFS/Hz

A converter’s noise floor is usually quoted in dBFS/Hz. Take a 16-bit converter at 48 kHz. Its quantisation noise has power Δ2/12=7.76×10−11\Delta^2/12=7.76\times10^{-11} re full scale squared, which is −101.1-101.1 dB (Quantization & noise, 11.1). Spread over 0 to 24 kHz, the one-sided density is −144.9-144.9 dBFS/Hz. A full-scale sine is −3.01-3.01 dBFS, so the signal-to-noise ratio is 98.0998.09 dB, which is the 6.02B+1.766.02B+1.76 of 11.1 with B=16B=16 before rounding.

The maths behind it · Parseval's theorem

Parseval says the DFT keeps the length of the data vector, up to the factor NN. Every scaling here is that one length bookkeeping, split into “per tone” and “per hertz”.

Worked example

  1. Chain, N=1024N=1024, Hann (∑w=512\sum w=512, ∑w2=384\sum w^2=384, ENBW 1.5). The tone is 256 (48.16 dB), then 0.5 (−6.02-6.02 dB re 1 V), then 1.000 V (0.00 dB), then 0.500 V² (−3.01-3.01 dB re 1 V²). The expected noise floor at those four steps is 5.84, −48.34-48.34, −42.32-42.32 and −45.33-45.33 dB.
  2. Floors and peaks. For NN of 256, 1024, 4096 and 8192 the power-spectrum floor is −39.31-39.31, −45.33-45.33, −51.35-51.35 and −54.36-54.36 dB re 1 V². The density tone peak is −19.72-19.72, −13.70-13.70, −7.68-7.68 and −4.67-4.67 dB re 1 V²/Hz. The density floor is −56.02-56.02 dB at every NN. The bin noise widths are 46.88, 11.72, 2.93 and 1.46 Hz.
  3. Truth. Sx1s=2Pnoise/fs=2(0.1)2/8000=2.5×10−6S_x^{\text{1s}}=2P_\text{noise}/f_s=2(0.1)^2/8000=2.5\times10^{-6} V²/Hz, which is −56.02-56.02 dB re 1 V²/Hz, or 1.58 mV/√Hz.
  4. Tone power from the PSD. Lobe sum times fs/Nf_s/N is 0.5000 V². The power-spectrum lobe sum is 0.7500 V², which is 0.5×ENBW0.5\times\mathrm{ENBW}.
  5. dBFS/Hz. A 16-bit converter at 48 kHz gives −144.9-144.9 dBFS/Hz, and at 44.1 kHz −144.5-144.5. A 24-bit converter at 48 kHz gives −193.1-193.1 dBFS/Hz. The SNR of a full-scale sine is 98.09 dB at 16 bits and 146.26 dB at 24 bits.

Where you’ll meet this

Spectrograms & the STFT (15.5) draws these levels in dB for every frame. The periodogram (25.1) and Averaged periodograms: Bartlett and Welch (25.2) estimate a PSD and ask how much it scatters. Power spectral density (24.4) defines the PSD of a random process.

Reference card

QuantityFormula (one-sided, 0<k<N/20 < k < N/2)Reads true
Amplitude spectrum2∣X[k]∣/∑w[n]2\lvert X[k]\rvert/\sum w[n] (V)a tone’s amplitude
Power spectrum2∣X[k]∣2/(∑w[n])22\lvert X[k]\rvert^2/\big(\sum w[n]\big)^2 (V²)a tone’s power A2/2A^2/2
PSDSx1s(fk)=2∣X[k]∣2/(fs∑w[n]2)S_x^{\text{1s}}(f_k)=2\lvert X[k]\rvert^2/\big(f_s\sum w[n]^2\big) (V²/Hz)a noise density
White noiseSx1s=2Pnoise/fsS_x^{\text{1s}}=2P_\text{noise}/f_sflat to fs/2f_s/2
Bin noise widthENBW⋅fs/N\mathrm{ENBW}\cdot f_s/N Hzpower = PSD × this
Window sums∑w=N CG\sum w=N\,\mathrm{CG}, ∑w2=N CG2 ENBW\sum w^2=N\,\mathrm{CG}^2\,\mathrm{ENBW}15.2
Tone power from a PSD∑lobeSx1s(fk)⋅fs/N\sum_\text{lobe}S_x^{\text{1s}}(f_k)\cdot f_s/Nsum the lobe
dBdB re 1 V: 20log⁡1020\log_{10}; dB re 1 V², re 1 V²/Hz: 10log⁡1010\log_{10}name the reference
SciPyperiodogram/welch, scaling='spectrum' or 'density'one-sided for real xx

End of lesson 15.4

Where to go next.

Phasorium
LibraryEvery lesson, in order

Parts

About Phasorium
Look