from the Forum department...
Calculating Sound Pressure Level from FFT
 Posted by Robert Scott on 19 October, 2012 - 9:38 am
In a test cell for diesel engines I am sampling audio from a high-quality industrial microphone and performing an FFT, from which I hope to extract an "A-weighted" sound pressure level in dB comparable to a commercial dosimeter to measure how loud the engine is. I am unsure about the algorithm. This is what I have done so far:
1. FFT of the microphone data is in frequency bins of complex numbers up to the Nyquist frequency.
2. I multiply each complex number by the A-weighting scaling factor. This is supposed to represent the characteristics of the human ear:
`(12200^2 * f^4) / ((f^2+20.6^2) * (f^2+12200^2) * (f^2+107.7^2)^0.5 * (f^2+737.9^2)^0.5))`
where f is the bin frequency in Hz.

3. I add up the magnitude squared of the resulting complex numbers (real^2 + imag^2).

4. I divide the sum in (3) by the number of bins up to the Nyquist frequency (so that I get the average of the magnitude squared of all the complex numbers in (2).

5. I take the logarithm base 10 of the average from (4) and multiply by 20 and call this a dB level.

6. I add a fixed dB offset determined by my gold standard calibration against a good dosimeter so the result agrees with the dosimeter.

My question is do I have the algorithm right? I am not sure about using the magnitude squared instead of taking the square root. Am I applying the A-weighting formula in the right place? Once I establish the offset will my algorithm continue to agree with the dosimeter as the amplitude and frequency distribution changes? I am assuming that both units have comparable microphone and signal conditioning response.

Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2013 Nerds in Control, LLC. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.

Fortune
"Drawing on my fine command of language, I said nothing."
Help keep our servers running...