Teensy 3.1 audio board - calibration

Status
Not open for further replies.

Brendon Shaw

Active member
I have everything running with the amazing teensy & audio board and have the fft code running. I am clearly see values and changes within the right freq bands.

The question is the values and the definition, so how do you calibrate the audio board for a certain audio tone & level. I appreciate this is not an easy question as sound level will be different depending on source, distance, background sounds etc. But, using the FFT package how what does the sound levels relate to and is calibration possible?
 
It would help to know what the object of your calibration is. Do you need to relate the FFT amplitudes to the input voltage or to a sound pressure level (SPL)? What level of accuracy is required?
Do you need the amplitudes to be accurate at a single frequency or a wide range of frequencies?

If your accuracy requirements aren't particularly stringent (maybe +/- 3-4dB), you might be able to get away without any "calibration" at all by using the typical gains in the signal path:

Looking at the documentation for the FFT object, you'll notice that the Read() function mentions that the output is scaled such that a returned value of 1.0 indicates a full scale sine wave at that frequency. Looking at the SGTL5000 datasheet (table 4), a full scale sine wave is approximately 2.83Vp-p (~1Vrms) at either the line-in input or the microphone input with no extra gain in the ADC path. I have a sparkfun electret microphone breakout board driving the line-in on the audio board, which has a microphone with a -46dB sensitivity at 1kHz (0dB = 1V/Pa), and a voltage gain of 100 V/V (40dB) in audio frequencies. Using this setup, a pressure input to the microphone of 1Pa (RMS) will result in a 0.5Vrms signal input to the audio board, which will result in an FFT reading of roughly 0.5.

If you need better accuracy than can be estimated using the system gains as above, you will need to calibrate it. In this case, the accuracy of your calibration will depend on the accuracy of the known input signal that is used to calibrate the system, how stable the system is (ie over time/temp, etc), and how stringent your calibration methods are.
 
Many thanks for such as detailed response and I should have add some more detail on the potential project. I have always been interested in sound and understand sound patterns & wanted to build an FFT box so understand & play with FFT analysis. It's something that I have read, but don't truly understand it all without building, testing and understand full how the whole system works. So it's really a research project and to help me understand more about FFT sound analysis.

The initial idea is just to make up the Teensy 3.1 audio board and log room data & generate sounds in the room which I can pick up and then ideally work out if it's possible to identify sounds such as doors, windows been open & closed, people walking around etc.

I have been using different microphones on an arudino project, such as the adafruit electret and a mems microphone and seeing the different types of response.

https://www.adafruit.com/product/1063
http://skpang.co.uk/catalog/breakout-board-for-admp401-mems-microphone-p-773.html

Thanks for the explanation and I suppose to be honest I not sure what is the end results i.e. just a number relating to a sound level or number in dB's? Does it really matter, higher number is louder and smaller number is quieter. As for accuracy, I think the mems microphone will be much better than the electret i.e. larger freq response and higher sensitivity.

What I am trying to do is work on a setup, something like this
- Sound generator at X distance from microphone, generating Y tone
- Measure the signal amplitude at the microphone amp i.e. feeding into the Teensy 3.1 audio board
- Adjust the microphone amp to a single of 2.83Vp-p which would provide 1.0 in the FFT software
- Repeat for different frequencies to understand the complete freq range response & add temperature/time factor

Question: what should be the distance and freq? Just researching sound meter calibration, I am sure I have read it's a 1khz sound at 1 meter from the microphone.

There are so many factors to understand, so it's breaking it down into little bits and then build up complete knowledge of the whole systems.
 
Quick disclaimer: I'm not an expert at audio measurements (my job involves doing RF/uWave measurements and calibrations), but I have done some research into this stuff previously for my own projects (speaker cabinets, speaker frequency response, etc)

The kind of calibration you describe will only help if you want/need to relate the output of the FFT to actual sound pressure levels at the microphone. If you're only worried about relative signal amplitudes (ie this sound measured at 0.7, and another at 0.3 or whatever), then you shouldn't need to bother with that.

If you do want to calibrate the system so that you can say a level of 1.0 from the FFT corresponds to a given sound pressure level, then your basic procedure is pretty sound. Here are a couple of quick thoughts:

-> The accuracy of your calibration is entirely dependent on how accurate the tone generator is. Accurate microphones or SPL meters are much easier/cheaper to find than really accurate speakers, so you may get better results if you grab a cheap reference mic, put it the same distance away from the tone generator as your mic, and use it to measure the actual output of the tone generator at the same time as you are making measurements using the mic/teensy system. This way the accuracy of the system is dependent on the reference mic, not the speaker.

-> Most speakers that I've run across are specified for SPL per watt of input power at 1 meter, but some are specified at 0.5m. If you're going off of the speaker's datasheet, use whatever distance and frequency they specify to start, and you can move around from there.

-> If you do adjust the microphone amp for a full scale ADC input of 2.83Vp-p with a given tone volume, then you need to be careful because any volume higher than that will cause the ADC to clip. It may be easier to leave the microphone amp gain static, and just record what FFT output is recorded for a given volume, which will still give you the conversion factor between fft output and pressure level.

The simplest way to start out is just to calculate the nominal gains like in my last post. Those numbers will give you a pretty good ballpark, and if they're not good enough, then you can start playing around with different calibration techniques and see what you come up with.

Have fun!
 
Status
Not open for further replies.
Back
Top