Skip to the speech enhancement demo

Audio lab · Speech enhancement

Spectral subtraction speech enhancement demo

Spectral subtraction reduces steady background noise by estimating the noise power spectrum and subtracting it from each short-time frame of the noisy signal. In this demo you choose the noise type, the input SNR, the over-subtraction factor and the spectral floor, then compare the spectrograms and listen to the clean, noisy and enhanced signals.

SYNTHETIC SIGNALS

These demos are illustrative. Every signal is synthetic, generated and processed in your browser, and every number shown is computed from those signals. They show the principles, not the measured performance of a product.

Press a listen button to play a short sample. Sound starts only when you press a button. No microphone or uploads needed.

06

Speech enhancement / noise reduction

Subtract the noise, frame by frame.

What this shows: spectral subtraction raises SNR on a speech-like signal, and pushing it harder trades noise for distortion and “musical noise”.

Clean the recording

How much of the noise estimate is removed from each frame.

The largest attenuation allowed. A higher floor leaves smoother residual noise.

Before and after

512-point STFT · 16 kHz

Top: noisy input; amber box: the noise-only lead-in used as the estimateBottom: after subtraction

Input SNR—
Output SNR—
Speech distortion—

Speech distortion is the power of the change to the clean component, relative to the clean signal; lower is better. This is noise reduction on a recorded signal, not ANC: ANC plays anti-noise into the air (see experiment 03).

Where it’s used

Speech front ends for calls, hearing devices and speech recognition. See speech enhancement and noise reduction.

What this experiment models

A 4.5-second, 16 kHz speech-like signal synthesized from harmonics with gliding pitch and vowel formants, plus short fricative bursts; it is not recorded speech. Noise is scaled to the chosen SNR over the speech section. The first 0.5 s contains noise only and is used to estimate the noise power spectrum. Each 512-sample Hann-windowed frame (50% overlap) gets the gain √max(1 − α·N̂/|X|², 0), clamped at the spectral floor, followed by overlap-add resynthesis. SNR and distortion are measured by applying the same gains to the clean and noise components separately. With fluctuating noise the fixed estimate goes stale, which is where adaptive estimators and trained models help.

The principle

How it works

The signal is cut into overlapping windowed frames and transformed with an FFT. The noise spectrum is estimated from a stretch that contains only noise, here the first half second. Each frequency bin then gets a gain that shrinks it according to how much of its power the noise estimate explains, and the frames are resynthesised by overlap-add.

Over-subtraction removes more than the estimate to suppress noise peaks, at the cost of eating into speech. Where the gain swings from frame to frame, isolated bins survive and are heard as warbling “musical noise”; the spectral floor limits the attenuation and keeps the residual smoother. The method assumes stationary noise, so a fixed estimate suits a steady fan and goes stale when the noise fluctuates. Adaptive noise trackers and trained enhancement models address that.

This is noise reduction on a captured signal, unlike active noise control, which plays anti-noise into the air. See speech enhancement and noise reduction.

MLAIA DATA SCIENCE

Tell us what
you’re working on.

Share the problem, the data you have and what success would look like. We’ll discuss a practical next step.

Please don’t include confidential datasets, credentials or patient information.

yochai@mlaia.com
+972 52 484 6282

Your inquiry is handled under our Privacy Policy.