1. Capturing the microphone
When you press Start, the page requests the microphone with the browser's getUserMedia API and asks for echoCancellation: false, noiseSuppression: false and autoGainControl: false. These features are meant for voice calls and distort level measurements.
Browsers treat this as a request and may ignore it. After the microphone opens, we read back the settings the browser reports for the audio track. If any of the three is still on, the meter shows a notice that processing could not be disabled, and readings should be treated with extra caution.
The signal is handled as a single (mono) channel and processed in an AudioWorklet, which runs on the browser's audio thread and not on the main page thread. No audio is recorded, stored or sent anywhere. See the privacy policy.
2. Frequency weighting (A, C, Z)
The A and C filters are derived from the analog definitions in the sound level meter standard IEC 61672-1. The standard defines both curves by four pole frequencies:
- 20.6 Hz and 12,194 Hz, used by both A and C weighting
- 107.7 Hz and 737.9 Hz, used additionally by A weighting
We convert these analog filters into digital ones with the bilinear transform, computed for the device's actual sample rate (44.1 kHz or 48 kHz, as reported by the browser). Each filter is then normalized to a gain of exactly 0 dB at 1 kHz, as the standard requires.
Z ("zero") applies no weighting. The samples pass through unchanged.
3. Time weighting (Fast and Slow)
The weighted signal is squared and smoothed with exponential averaging. The time constant τ is 125 ms for Fast and 1 s for Slow, the standard sound level meter values. For each sample, the running mean square y is updated from the squared sample x² as:
y ← y + (1 − e^(−1/(τ·fs))) · (x² − y)
where fs is the sample rate.
4. From signal to decibels
Every level is calculated the same way:
L = 10 · log10(mean square) + calibration offset
The first term is in dBFS, decibels relative to digital full scale, where a sample value of ±1.0 is the maximum. It is always zero or negative for a real signal. The calibration offset shifts it to an estimated sound pressure level in dB. Background on the units is in what is a decibel.
5. What each number means
| Reading | How it is calculated |
|---|---|
| Current level | The time-weighted (Fast or Slow), frequency-weighted level right now. |
| Leq | The energy average: the mean of the squared weighted signal over the whole time since you pressed Start, converted to dB. It is not an average of the dB values. |
| Min / Max | The lowest and highest values of the time-weighted level. The first second after Start (five seconds for Slow) is ignored so that the filters and averaging can settle. |
| Peak | The highest absolute sample value since Start, with no frequency or time weighting, converted to dB with the same offset. |
6. Display and graph
The audio thread reports new values to the page about 10 times per second. The graph keeps the last 5 minutes of the time-weighted level. Leq, Min, Max and Peak always cover the full period since Start, not only the part visible on the graph.
7. Clipping
If sound is loud enough to drive the microphone or its converter to digital full scale, the waveform is cut off and the true level can no longer be measured. When samples hit full scale, a clipping badge appears. Read the displayed value as a lower bound: the real level is at least that high.
Limitations
- Microphone frequency response. Phone and laptop microphones are not flat. They typically roll off below about 100 Hz and above about 10 kHz, and we do not correct for individual models. Bass-heavy sound is under-read, mostly in C and Z weighting.
- Weighting accuracy near the top of the range. The bilinear transform compresses the frequency axis close to the Nyquist frequency (half the sample rate). Our digital A and C curves therefore deviate from the analog standard in the highest audible octave, by a larger amount at 44.1 kHz than at 48 kHz.
- Processing we cannot switch off. Some browsers and operating systems, iPhone and iPad in particular, may filter or adjust the signal regardless of our request.
- Noise floor and overload. A device cannot read below its own electronic noise or above its clipping point.
- Not a certified instrument. The meter follows the calculation methods of a sound level meter, but it has not been tested against IEC 61672 and does not meet any class of that standard.
What this means in practice is covered on the accuracy page.
Sources
- Wikipedia: A-weighting (transfer functions and pole frequencies from IEC 61672-1:2013)
- IEC 61672-1:2013, Electroacoustics: Sound level meters, Part 1: Specifications
- MDN: MediaDevices.getUserMedia()
- MDN: MediaStreamTrack.getSettings()
- MDN: AudioWorklet
Updated