← All tutorials

Audio & Signals Basics

A signal’s path, and two ways to see it.

On this page

1 Two ways to look at one signal 2 One signal down the chain 3 What each page answers 4 Where signals go wrong 5 References

A sound reaches a model through a chain of stages, from the microphone to the features a model reads. Each page covers one stage (Figure 4), and every stage can be judged in two domains, time and frequency.

1 Two ways to look at one signal

A signal has two standard descriptions. The time domain shows when things happen; the frequency domain shows which frequencies are present.

The clip, made up for this page (illustrative) and sampled 8,000 times per second, holds a three-note chord and one click at 30 ms. Levels are in decibels (dB) against the loudest peak; 20 dB down is ten times smaller in amplitude.

Time view click 0 30 60 time (ms) Frequency view 0 250 500 frequency (Hz) 0 dB −60 220 277 330 the click, spread flat
Figure 1. 1The click is one spike in time. 2The chord is three peaks. 3The click is a flat floor.

A click holds every frequency at once, so it spreads into a flat floor. The Fourier transform moves a signal between the two domains; it is built from scratch on the Fourier transform page.

1.1 Decibels turn ratios into steps

A graphic equalizer (EQ), the row of sliders in a music app, sets each band’s gain in decibels (Anushiravani 2016). Pushing its 1 kHz slider to +6 dB about doubles the amplitude in that band (exactly at 6.02 dB) and about quadruples its power.

dB level amplitude power ×10 ÷10 ÷10 ÷10 +20 0 −20 −40 −60 +20 dB ×10 ×100 a microphone preamp stage +10 dB ×3.16 ×10 speech 10 times the noise power +6.02 dB ×2 ×4 a doubled EQ band 0 dB ×1 ×1 the reference −3.01 dB ×0.707 ×0.5 a filter’s cutoff (half power) −60 dB ×0.001 ×0.000001 an echo at T60, the 60 dB fade time
Figure 2. 1Each 20 dB band is ×10 or ÷10 in amplitude. 2Power is amplitude squared.

The mark labels are example uses. A bel is one tenfold step in power and a decibel is a tenth of a bel, so gains that multiply add in dB: a +20 dB preamp and then the +6.02 dB slider give +26.02 dB. One more bit in the analog-to-digital converter (ADC) of section 2 doubles its number of levels, 6.02 dB.

A level in decibels, from power or from amplitude.
L = 10 log10 P1P0 dB
The level L of a measured power P1 against a reference power P0. The log10 counts powers of ten, which is why multiplying ratios adds levels. The 10 turns bels, one tenfold power step each, into tenths: decibels.
L = 20 log10 A1A0 dB
The same level from amplitudes, such as microphone voltages or sample values: A1 is the amplitude measured, A0 the reference.
20 = 10 × 2
Power goes as amplitude squared, and the square comes out of the log as the 2. So a doubling is 3 dB on a power plot such as a PSD (power spectral density) and 6 dB on a waveform or a magnitude spectrum.

Both lines give the slider’s +6.02 dB, from power ×4 or from amplitude ×2. Every dB value has a reference. On these pages it is the loudest frequency in a spectrum plot, the noise for an SNR (signal-to-noise ratio), or a filter’s input for its gain.

Later pages use the same scale for the SNR each ADC bit adds, how much a filter cuts, how far a window leaks and the PSD.

2 One signal down the chain

Samples taken at 8 kHz hold frequencies only up to half that rate, the 4 kHz Nyquist frequency, so an anti-alias filter must cut a 5.2 kHz whistle, added with some hiss to the made-up clip (illustrative), before the ADC samples. Any whistle the filter lets through folds back to the rate minus its frequency, 8 − 5.2 = 2.8 kHz, inside the speech band of an 8 kHz phone call or speech recognizer.

Figure 3. 1Nyquist, 4 kHz. 2Whistle, 5.2 kHz. 3Folded, 2.8 kHz.

Past 4 kHz the folded whistle survives every later stage, and at 2 kHz the band above 2 kHz is lost as well.

3 What each page answers

The thesis cited in Section 1.1 is about editing audio by example. Its methods take an example recording and make another recording sound like it in tone (the EQ), background noise and room. In this series, spectral subtraction and the Wiener filter reduce background noise, and equalization matching (Power Spectral Density, section 5) copies the tone of another recording, and Reverberation and Dereverberation measures a room and removes its late tail.

Capture 1 ADCHow is a voltage turned into numbers? 2 Aliasing and anti-aliasingWhat if sampling is too slow? Look at frequency 3 LTI and convolution(linear time-invariant)What does a filter or a room do to a signal? 4 Fourier transform and FFT(fast Fourier transform)What is a spectrum? 5 FIR and IIR filters(finite and infinite impulse response)Which frequencies stay, and which go? 6 STFT and spectrograms(short-time Fourier transform)How does the spectrum change over time? 7 Power spectral densityHow is noise power spread over frequency? Clean and describe 8 Spectral subtractionCan that noise be taken away? 9 Wiener filterWhat is the best gain for each frequency? 10 ReverberationWhat does a room do, and can it be undone? 11 MFCC and audio features(mel-frequency cepstral coefficients)Which few numbers describe a sound?
Figure 4. The eleven pages in reading order, by stage. Each box opens its page.

4 Where signals go wrong

Five stages each have one classic failure, and each page explains its own.

What you seeCauseFix
Flat-topped peaksInput past the ADC’s range (clipping)Lower the gain (ADC)
Tones never in the roomSampling too slowly (aliasing)Filter before sampling (Aliasing)
One tone smeared across frequenciesAbrupt edges of each short slice, or frame (leakage)Taper each frame (STFT)
A click late or bent after filteringThe filter’s phase (its timing shift at each frequency) and delayLinear or zero phase (Filters)
Short isolated tones after denoisingNoise peaks above the estimate (musical noise)Subtract more, or keep a minimum gain (Spectral subtraction)

The series starts with how a voltage becomes numbers, on ADC Fundamentals.

5 References