👁️

Frequency Masking Simulator

Play with a masker and a probe tone and see the psychoacoustic masking math: the asymmetric spreading function, the Bark / critical-band boundaries, the absolute threshold of hearing, and the pre/post temporal masking curves. Then press Play and hear whether your ear agrees with the model.

Masker (green)


Probe (red when masked)

Verdict

Probe is
Margin vs threshold:

Listen

Temporal: masker + probe

Masker plays 0–100 ms. Negative = probe BEFORE masker (true pre-masking, ~−20 ms window). 0–100 = during masker (overlap). >100 = after masker (post-masking decay).

Output volume

Idle — adjust the masker/probe and press a Play button.
Simultaneous masking — frequency vs level
Temporal masking — time vs level (masker plays 0–100 ms)

Frequency Masking in Five Minutes

Masking is the perceptual phenomenon where a louder sound makes a softer one inaudible. It's not a quirk — it's the foundation of every lossy audio codec (MP3, AAC, Opus, every voice codec). The encoder analyses the audio for what the listener would not be able to hear behind louder content, and discards exactly that. Without masking there would be no streaming music as we know it.

Two flavours

Simultaneous masking (the top plot) is when a masker tone hides probe tones playing at the same time. The shape of what's hidden is described by the spreading function: a curve that radiates outward from the masker's frequency with characteristic asymmetric slopes.

Temporal masking (the bottom plot) is when a loud sound hides quieter sounds before and after it in time. Pre-masking is short (~20 ms) — your brain hasn't finished processing the sudden quiet thing before the loud one slams in and steals the attention. Post-masking is longer (100–200 ms) — the cochlea's response to the masker is still ringing down.

The upward spread of masking

Look at the yellow threshold curve on the top plot. The slope above the masker is much gentler than the slope below it (about 17 dB/Bark up vs 27 dB/Bark down). That asymmetry is real and biological: a high-amplitude tone "spreads" upward along the basilar membrane farther than it spreads downward, so it hides higher frequencies more effectively than it hides lower ones. This is why a loud bass note can mask a midrange vocal line, but a loud whistle doesn't hide the bass.

The Bark scale

The pink dotted lines mark critical band boundaries on the Bark scale — 24 perceptual frequency bands roughly proportional to where the cochlea's hair cells are spaced. Tones within the same critical band interact strongly; tones in different bands are processed semi-independently. Most masking calculations work in Bark space because that's what the ear cares about, not linear Hz.

Why does the probe look "above" the threshold but I still can't hear it?

The model is an approximation. The exact threshold depends on individual hearing, the test environment, masker bandwidth (tones vs noise vs music are different), and time integration. The plot shows the textbook tone-on-tone spreading function with a ~15 dB tone-masking-tone offset. Real audibility margins of ±5–8 dB are normal. Where the model is most reliable: when the probe is many dB above or below the threshold curve, you're confidently audible or confidently masked.

How is this used in codecs?

An MP3/AAC/Opus encoder runs an FFT on each frame, computes a per-band masking threshold from the louder content using essentially the same spreading function shown here, then quantises each band only as finely as needed to keep the noise below that threshold. The compression ratio comes from spending fewer bits on frequencies where the listener wouldn't hear the noise anyway.

Frequently Asked Questions

My ears disagree with the model. Is it broken?
The model is a textbook approximation of average human hearing — it'll be off by 5–10 dB for any one listener, especially around the high frequencies and at very low or very high masker levels. Use it for the shape of the curve and the relative ordering of audible vs masked, not for absolute calibration. Where the spreading function is most reliable is the upward-spread asymmetry: try setting the probe a few Bark above the masker vs a few Bark below, and you should hear masking clearly on the upper side.
What's "dB SPL"?
Sound Pressure Level, referenced to 20 µPa (the nominal threshold of hearing at 1 kHz). 0 dB SPL ≈ the quietest audible sound at 1 kHz; conversation is ~60 dB SPL; rock concert ~110 dB SPL; pain threshold ~130 dB SPL. The plot Y-axis is in dB SPL because that's the scale the ATH curve and the masking model are calibrated to. The slider's "level" is not the actual sound level coming out of your speakers — it's a relative pedagogical value; the volume slider controls real-world loudness.
Why is the threshold of hearing curve U-shaped?
Human hearing is most sensitive in the 2–5 kHz region — exactly the band that carries speech information. Below that the eardrum's mass and the middle ear's transfer function attenuate signals; above ~10 kHz the cochlea's high-frequency response rolls off and the hair cells responsible become more sparsely innervated. Old-age and noise-induced hearing loss shows up first as the upper end of the curve climbing — many adults over 40 can't hear above 14 kHz.
What are "critical bands" and the Bark scale?
The cochlea performs a frequency analysis where the bandwidth of each "band" gets wider with frequency: narrow at the low end (~50 Hz at 100 Hz centre), wide at the high end (~3.5 kHz at 10 kHz centre). The Bark scale maps these to integer "critical band rate" units 1–24 across the audible range. Two tones within the same Bark band interact strongly (masking, beats, fusion); two tones in different bands are treated semi-independently. Most psychoacoustic processing works in Bark, not Hz.
Why are masker and probe mutually exclusive in "play X only" mode?
For pedagogical clarity — when you press "Play masker only" we want you to hear the masker on its own, then switch to "Play probe only" to compare. If you want both together press "Play both". If they overlapped on the solo buttons you'd lose the cleanest A/B test.
Can I demonstrate pre-masking?
Set the probe offset slider to a small negative value (e.g., −15 ms) and press "Play sequential". The probe will fire just before the masker. Pre-masking is a fragile, short effect (~20 ms window) and depends heavily on probe level — too loud and you hear it; too quiet and the threshold of hearing itself dominates. The temporal plot shows the model's predicted threshold ramping up before t = 0.
Is anything recorded or uploaded?
No. The tool only generates sine tones with the Web Audio API and plays them through your speakers. No microphone, no file upload, no analytics on the audio.