Audio Sensing Workbench

Synthesize a tone-plus-noise signal, read its RMS level in dB, and watch a computed FFT spectrum whose bin width and window duration change as you pick 1024, 2048, or 4096 at 48 kHz.

animation
audio
sensing
fft
web-audio
signal-processing
intermediate
A fully synthesized audio-sensing simulator (no microphone): signal-source controls, an RMS/dB level meter with formula, a JS-computed FFT bar spectrum, and an FFT-size selector showing live bin width and window duration at 48 kHz with a df x T = 1 invariant that matches the pwa-audio lab exactly.
Animation Audio FFT Synthesized

Audio Sensing Workbench

No microphone is used. A tone-plus-noise signal is synthesized in the browser, its RMS level is read out in dB, and a computed FFT spectrum shows where the tone sits. Change the FFT size at 48 kHz to watch bin width and window duration trade against each other.

-9.0 dBLevel (dBFS)
480 HzDominant tone
23.4375 HzFFT bin width
42.7 msAnalysis window

Goal

Separate how loud a signal is (level) from what is in it (spectrum), and see how FFT size sets resolution.

Try First

Load Speech-band tone, read the dB meter, then find the tone as an orange peak in the FFT bars.

Watch

Switch FFT size 1024 to 4096: bin width halves twice and the window doubles twice, but df x T stays 1.

Why It Matters

A phone lab must state its bin width and window before comparing two spectra, or the numbers are not comparable.

Preset

Speech-band tone: a mid-frequency tone with light noise, easy to find in the spectrum.

FFT Size (at 48 kHz)

2048-point FFT: 23.4375 Hz bins over a 42.7 ms window. This matches the pwa-audio lab's audit.

Signal Source

23.4375 HzBin width: df = fs / N
42.7 msWindow: T = N / fs
df x T = 1.000Time-frequency invariant
24 kHzNyquist: fs / 2

Computed FFT Spectrum

Each bar is a true DFT magnitude at an FFT bin of the synthesized buffer. The dominant tone shows as the orange peak.

Level Meter

Relative level only. Full scale is 1.0; there is no calibration to real sound pressure.

-9.0 dB RMS 0.354
-60 dB-30 dB0 dB
RMS = sqrt(mean(x^2)) dBFS = 20 * log10(RMS / 1.0)

Level Detail

Overall energy of the synthesized buffer, tone and noise together.

-9.0 dBFS

FFT Resolution

FFT size and 48 kHz decide bin width, window, and bin count.

2048-point

Spectrum Read

Where the FFT places the dominant tone and how far the estimate sits from the true tone.

480 Hz
Beginner Ramp

Level answers how loud. Spectrum answers what frequencies are present. The RMS meter gives one number for the whole buffer; the FFT breaks the same buffer into frequency bins so a single tone stands up as one tall bar.

How The Numbers Work
  • Bin width df = fs / N. At 48 kHz, N = 2048 gives 23.4375 Hz.
  • Window T = N / fs. At 48 kHz, N = 2048 gives 42.7 ms.
  • Their product df x T = 1 for every FFT size, because fs and N cancel.
  • Bins = N / 2, spanning 0 Hz up to the Nyquist frequency fs / 2 = 24 kHz.
Level Formulas
  • RMS = sqrt(mean(x^2)) over the buffer samples.
  • A full-scale sine (amplitude 1.0) has RMS = 1 / sqrt(2) = 0.707, so -3.0 dBFS.
  • Halving amplitude drops the level by about 6 dB.
  • dBFS = 20 * log10(RMS / full scale); full scale here is 1.0.
Finer Frequency Costs Time

Double the FFT size and you halve the bin width, so two close tones separate more cleanly. But the window doubles, so the spectrum reacts more slowly to a short event. That is the df x T = 1 trade: you cannot buy fine frequency and fast time at once.

Relative Level Caution

These dB values are relative to a synthetic full scale, not sound pressure. A real phone lab needs a reference meter and a documented offset before any dB(A) claim. Treat the meter as a comparison tool under fixed settings only.

What The Peak Estimate Shows

The FFT can only report the tone at the nearest bin. With a coarser FFT the reported frequency can sit a bin or two off the true tone. Raise the FFT size and the peak bin lands closer, which is exactly why bin width matters when you compare readings.

Practice 1

Load Speech-band tone. Read the dB meter, then set tone level to 1.0. How many dB did the level rise and where is the peak bar?

Practice 2

Keep the tone fixed and cycle FFT size 1024, 2048, 4096. Record bin width and window each time and check that df x T stays 1.

Practice 3

Raise noise level toward 0.5. Watch the RMS meter climb while the tone peak stays put. Explain why level rose but the dominant frequency did not.