Summary of A simple Sound Pressure Level Meter (SPL) dB audio meter using AVR ATmega
This article describes a sound level meter project using an AVR ATmega microcontroller. It explains the theory of Sound Pressure Level (SPL) measurement in decibels, utilizing A-weighting curves to match human hearing. The implementation involves collecting audio samples at approximately 22050Hz, performing a Radix-4 Fast Fourier Transform (FFT), applying frequency-domain weighting via a lookup table, calculating RMS values, and finally computing the SPL output.
Parts used in the AVR ATmega Sound Level Meter:
- AVR ATmega microcontroller
- Timer interrupt system
- Radix-4 FFT library
- A-weighting weight table
- Audio input board
A sound level meter or sound meter is an instrument which measures sound pressure level. Sound pressure level (SPL) or sound level is a logarithmic measure of the effective sound pressure of a sound relative to a reference value. It is measured in decibels (dB) above a standard reference level. The commonly used reference sound pressure in air is = 20 µPa (rms) which is usually considered the threshold of human hearing. Keep in mind that 1 pascal will equal an SPL of 94 dB. Because the frequency response of human hearing changes with amplitude, a weighting have been established for measuring sound pressure. Usually the A-weighting curve is used. A weighting curve is a graph of gain across the frequency range (10Hz to 20kHz).
SPL level is defined as
given p_rms as the sound pressure measured, and p_ref as the reference sound pressure.
Once we have got the RMS value of the signal (actualRMS), we can transform it to SPLdb using this formula:
given refRMS as the reference RMS value for the input board at a know refSPLdb SPLdb level.
To compute SPL measurements, the meters loop is:
- collects N samples
- do FFT for the N samples collected, the signal is now transformed in the frequency domain
- apply A-weighting (in freq domain)
- get magnitude of the signal
- get RMS value of the signal
- apply a time-weight filter to RMS value
- compute the SPL using the RMS value
- output data
Every sample is collected at a fixed time, a timer interrupt impose this timing, this is because we need to know the sampler frequency, to built filters and output signal magnitude.
Runnig @16Mhz i’m able to collect samples at almost 22050Hz.
For FFT i’ve used Radix-4 FFT library you can find it here http://davidegironi.blogspot.it/2013/06/avr-atmega-audio-input-rma-using-fft.html.
The method to weighting the signal proposed here just use a weight table that contains the weight of the signal in the frequency domain, this table shoud be FFT size/2, because we can retain frequencies below Nyquist rate.
For more detail: A simple Sound Pressure Level Meter (SPL) dB audio meter using AVR ATmega
-
What is the standard reference sound pressure in air?
The commonly used reference sound pressure in air is 20 µPa rms. -
How is the sampling frequency determined for this project?
The sampling frequency is imposed by a timer interrupt to ensure fixed timing between samples. -
Which FFT algorithm was utilized in the design?
The project uses a Radix-4 FFT library for signal transformation. -
Can you explain the size requirement for the weighting table?
The weight table should contain FFT size divided by two because frequencies below the Nyquist rate are retained. -
At what speed can samples be collected on a 16MHz processor?
Running at 16MHz allows sample collection at almost 22050Hz. -
Does the process involve transforming the signal to the frequency domain?
Yes, the loop collects N samples and performs an FFT to transform the signal into the frequency domain. -
What specific weighting curve is usually applied for measuring sound pressure?
The A-weighting curve is usually used as it accounts for the changing frequency response of human hearing.


