fnuggelo
Posts: 4
Joined: Wed Feb 25, 2015 5:02 pm

Calculate equivalent sound level in Python

Mon May 25, 2015 12:10 pm

Hi guys!

I'm currently using a Python script on Raspberry Pi which first imports raw audio data from a microphone and then calculates the SPL (sound pressure level) and prints it in dB. For this I'm using PyAudio and Audioop libraries.
What I also need to do is to calculate the equivalent continuous sound level (Leq) which basically is an average value of the SPL. In normal cases you could just use the normal formula for calculating the average value (divide the sum of every value with number of how many values there are). With SPL it's not that easy. Since dB is a logarithmic scale I first need to convert the dB values into sound pressure levels (measured in Pa), THEN get an average number of the values and finally converting that average value back into dB.
What I'm wondering is if there are any available libraries or an already known formula or function for Python that can do this. I can't seem to find any valuable information in googling this problem.

Thanks in advance!

Return to “Beginners”