2013-05-27 07:50 AM
I test the microphone[MP45DT02] of stm32f4 discorvery board.
I use 1.024Mhz Clock input microphone with i2s signal. Pmd fiter of library is applied and get pcm data from pdm data. Is it corret pcm data that no sound is about 0 or 65535, loud sound is about 65535/2 ??? if I know to get sound db, how can i know db(decibel)?????2013-05-27 09:13 AM
It looks like you get signed 16-bit samples (65535 = -1)
In such case you should use 16bit signed type to handle this, int16_t2013-05-27 11:18 PM
2013-05-28 12:53 AM
You need to calculate signal level and divide it by some reference value(0dB).
If you need to update the dB meter 5 times per second you take samplerate/5 number of samples and calculate peak value of those samples. Thus you will have 5 values per second.Then you can calculate decibel:dB = 20*log10(l1/l0);l1 is the current signal levell0 is the reference level2013-05-30 06:25 PM
2013-05-30 11:12 PM
if l1 is -2000 and +2000, does peak value be +2000 or 4000??
does db calculation is 10*log10(l1/l0) not 20*log10(l1/l0)????
It's +2000, get the absolute value, -2000 would count as +2000.10*log10(P1/P0) is the power formula, here you have amplitude so you use 20*log10On a second thought you don't really need to divide by l0,20*log10(l1/l0) equals to 20*log10(l1)-20*log10(l0) and 20*log10(l0) is constant.You can simplify it to 20*log10(l1) + const.
2013-05-31 01:57 AM