A low-cost sound level meter using on MEMS microphone for Reverberation Time and Background Noise measurements.
https://www.youtube.com/watch?v=_loZrHiwyes&ab_channel=OneiroAcoustika
Here is the list of the items you will need:
- I2S MEMS Microphone (in my case I’m using two microphones from a model called msm261s4030h0)
- Teensy 4.0 microcontroller
- Jumpers
- Mini-protoboard
- Micro USB cable
- 3D printed case (Optional)
You will also need the following software:
- Arduino
- Teensyduino
- Python
- PyTTa Toolbox
Connect the devices as shown in the figure below.
Install Teensyduino and plug Teensy into the USB port and load the Arduino code into it. It will set the microcontroller to work as a mono or stereo microphone.
To install the last version compiled to pip, which can be slightly behind of development branch, do:
>>> pip install pytta
The code 'SPL_record' records the sound signals. It was set up to make calibrations and to record two channels separately. It can be changed to record only one channel if the user decides to.
Use the function pytta.list_devices() to check the sound devices connected to the computer. With this information, change the 'device' variable to the correct number.
pytta.list_devices()
Choose the recording time length and run the code to start the measurement and save it to the disk.
Use the code 'SPL_Meter' to calculate and plot the sound pressure levels. Change the folder path to the one you want to analyze.
To calibrate the device one can use a commercial calibrator along with a coupler for the MEMS microphone, use the calibration signal available in the 'Bkgn Meas 01' folder (but only if one uses the same microphone model I did), or use the sensitivity value to adjust the SPL curves. In the third case, the offset value is equal to the Acoustical Overload Point (AOP) minus 94 dB. Declare the 'sens_offset' value and the code will do the rest.
In the end, it will return the SPL plot with three different weightings and will print the equivalent sound levels.
To do the reverberation time measurements use the code 'roomIR_measurement', and, to perform the calculations, use 'roomRT_calculation'.
In 'roomIR_measurement', run the code cell by cell. It will generate the sweep signals and measurement setup. Declare the 'device' variable with the input and output ports.
There are four kinds of measurements:
- Room Impulse Response, to measure reverberation time
- Noise floor
- Source calibration
- Microphone calibration
- Channel calibration
Once the measurement take is created run and save it by using:
takeMeasure.run()
D.save_take(takeMeasure)
In 'roomRT_calculation' simply select the folder where you previously saved the measurements and run the code to get the results.
Thanks to Viviane Melo, my friend and academic advisor, for all the support.
Thanks to Felipe Mello, William D'Andrea Fonseca and Paulo Mareze for their research on which this model was based. Check their work in:
F. R. Mello; W. D’A. Fonseca; P. H. Mareze. MEMS digital microphone and Arduino compatible microcontroller: an embedded system for noise monitoring. In 50th International Congress and Exposition on Noise Control Engineering — Internoise 2021, pages 1–12, Washington, DC, USA, Aug. 2021. doi: 10.3397/IN-2021-2557.
Feel free to use it and modify it in any way you want. If you want to give me credits, cite this repository.
𝔉𝔞𝔯𝔢𝔴𝔢𝔩𝔩