Software development and audio programming by Jaime Osvaldo, New York.
DSP Dictionary
Definitions and interactive examples of digital signal processing.
Digital Audio
Sample rate sets time resolution, while bit depth sets amplitude resolution.
Sampling and quantization
Continuous signalQuantized samples
t[n] = n / 16000; step = 2 / 16
Gain
Gain multiplies every sample, changing amplitude while preserving frequency.
InputOutput
y[n] = 1.0 × x[n]
Delay
A delay repeats a stored signal later, with feedback controlling how long the echoes last.
An impulse and its echoes
Original impulseImpulse + echoes
y[n] = x[n] + feedback × y[n − D]
Panning
Panning distributes a mono signal between the left and right channels.
Left channel
Mono inputLeft channel
Right channel
Mono inputRight channel
θ = (pan + 1) × π / 4; L = cos(θ) × x; R = sin(θ) × x
Filter
A filter passes some frequencies and attenuates others.
What passes through?
UnchangedFilter responseCutoff
H(z) = (b₀ + b₁z⁻¹ + b₂z⁻²) / (a₀ + a₁z⁻¹ + a₂z⁻²)
EQ
EQ boosts or cuts a frequency band, with Q setting its width.
A bell-shaped EQ band
UnchangedFilter responseBand center
A = 10^(gain / 40); α = sin(2πf₀ / Fs) / (2Q)
Reverb
Reverb extends a sound with reflections that decay over time.
From a short impulse to a decaying tail
Dry impulseDry + reflectionsWet decay envelope
envelope(t) = 10^(−3t / T60); output = (1 − mix) × dry + mix × reflections
Convolution
Convolution applies an impulse response to every input sample.
The impulse response h[n]
Impulse response
The convolution output
InputConvolved output
y[n] = Σ x[k] × h[n − k]
Cross-Correlation
Cross-correlation finds the time shift where two signals match best.
Two versions of one signal
Signal ASignal B
Where do they line up?
CorrelationBest match
Rxy[k] = Σ x[n] × y[n − k] / √(Σx² × Σy²)
Compression
Compression reduces level differences above a threshold.
Input level becomes output level
Unity gainCompressed levelSelected input
Apply that gain to the waveform
InputCompressed
Above -24.0 dB: output dB = threshold + (input dB − threshold) / 4.0
Limiting
A limiter reduces gain to keep peaks below a ceiling.
Gain reduction preserves the tone's shape
InputIdeal limiterHard-clipping comparison
gain = min(1, ceiling amplitude / detected peak amplitude); y[n] = gain × x[n]
Noise Gate
A noise gate attenuates a signal when its level falls below a threshold.
The envelope decides when to open
Input envelopeGated envelopeThreshold
The resulting gain control
Gate gain
gain dB = 0 if envelope ≥ -35.0 dB, otherwise -36.0 dB
Expansion
Downward expansion makes quiet passages quieter below a threshold.
Downward expansion transfer curve
Unity gainDownward expansionSelected input
Below -24.0 dB: output dB = threshold + (input dB − threshold) × 2.0
Multiband Compression
Multiband compression controls the dynamics of separate frequency bands.
Selected low band
Selected band beforeSelected band afterThreshold
Three independent band envelopes
Low band · below 250 HzMid band · 250 Hz–4 kHzHigh band · above 4 kHz
selected band output dB = threshold + (band input dB − threshold) / ratio, above threshold
De-Essing
De-essing reduces excessive high-frequency sibilance.
The high-frequency detector
Sibilant band beforeSibilant band afterThreshold
Split-band processing preserves the voice body
Voice body · below 6 kHz, unchangedSibilant band · above 6 kHz, processed
high-band gain dB = compressed high-band envelope dB − original high-band envelope dB
Saturation
Saturation rounds waveform peaks and adds harmonics.
Soft clipping
InputOutput
y = 0.00x + 1.00 tanh(2.00x) / tanh(2.00)
Distortion
Hard clipping flattens waveform peaks and adds harmonics.
Hard clipping
InputOutputCeiling
y = clamp(2.0x, −0.70, 0.70)
Aliasing
Frequencies above half the sample rate fold into lower frequencies when sampled.
Different waves, identical samples
Original toneObserved toneSamples
f_alias = |fold(12000, 16000)| = 4000 Hz
Oversampling
Oversampling raises the processing rate before filtering and returning to the output rate.
Output at the original sample rate
1× output1× outputFundamental
shape(x) = x − 0.3x³; process → low-pass → downsample
LFO
An LFO is a slow oscillation that moves a parameter over time.
LFO control signal
LFO
control(t) = 0.75 × sin(2π × 0.5 × t)
Modulation Effects
Modulation uses one signal to move a parameter of another.
The gain envelope
Moving gain
The envelope multiplies the waveform
InputOutput
gain(t) = 1 − depth/2 + (depth/2) × sin(2π × rate × t); y(t) = gain(t) × x(t)
Chorus
Chorus blends a signal with a delayed copy whose timing keeps changing.
The LFO moves the delay
Delay timeSelected time
The blend at this instant
DryDry + delayed copy
D(t) = 20 ms + depth × sin(2π × rate × t); y(t) = 0.5x(t) + 0.5x(t − D(t))
Flanger
Flanging mixes a short, changing delay with the original to create moving comb notches.
The LFO moves the delay
Delay timeSelected time
A frozen comb response
DryFlanger
y[n] = x[n] + x[n − D] + feedback × y[n − D]
Phaser
A phaser mixes phase-shifted copies with the original to create moving notches.
All-pass magnitude and mixed magnitude
All-pass aloneDry/wet blend
The all-pass chain changes phase
Dry phaseAll-pass phase
A(z) = (a + z⁻¹)/(1 + a z⁻¹); H(z) = (1 − mix) + mix × A(z)^stages
Time-Based Effects
Time-based effects use stored audio to create echoes and tails.
The impulse response of an echo
Input impulseOutput impulsesEcho peaks
echo[n] = x[n − D] + feedback × echo[n − D]; y[n] = x[n] + wet × echo[n]
Spatial Effects
Spatial processing changes the level and timing differences between the ears.
Left and right channel waveforms
Left channelRight channel
L(t) = cos(θ) × x(t); R(t) = sin(θ) × x(t − D); θ = (pan + 1)π/4
Mixing
Mixing adds weighted signals, whose phases can reinforce or cancel.
Two weighted signals and their sum
Signal A × gainSignal B × gainSum
y(t) = 0.75 × xA(t) + 0.75 × xB(t)
Signal Chain
A signal chain combines simple operations, with each output feeding the next input.
Input → gain → low-pass
InputAfter gainAfter low-pass
The response of the whole chain
Gain aloneGain + low-pass
u[n] = gain × x[n]; y[n] = (1 − a)u[n] + a·y[n − 1]; a = exp(−2π × cutoff / 48000)