A simple Sound Pressure Level Meter (SPL) dB audio meter using AVR ATmega

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).A simple Sound Pressure Level Meter (SPL) dB audio meter using AVR ATmega
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:

  1. collects N samples
  2. do FFT for the N samples collected, the signal is now transformed in the frequency domain
  3. apply A-weighting (in freq domain)
  4. get magnitude of the signal
  5. get RMS value of the signal
  6. apply a time-weight filter to RMS value
  7. compute the SPL using the RMS value
  8. 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.Frequancyresponse A simple Sound Pressure Level Meter (SPL) dB audio meter using AVR ATmega
For more detail: A simple Sound Pressure Level Meter (SPL) dB audio meter using AVR ATmega

Quick Solutions to Questions related to AVR ATmega Sound Level Meter:

  • 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.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top