Pcm to decibel conversion in esp-idf using pdm microphone

36 views Asked by At

I am using Pdm microphone with esp32-wroom-32. By using Esp-idf i2s_pdm_rx example i was able to get Pcm data steam in an array buffer from theses int16_t values how can i measure sound pressure.

I read on esp-idf api guides that this data in converted by esp32 from pdm to pcm. i am not sure about that either if remember correctly someone point out only esp32-s3 can convert pdm to pcm at peripheral stage

I am new to audio processing dont know much about dsp.

int16_t *r_buf = (int16_t *)calloc(1, EXAMPLE_BUFF_SIZE);

i2s_channel_read(rx_chan, r_buf, EXAMPLE_BUFF_SIZE, &r_bytes, 1000)

r_buff will get pcm data how can i convert it to decibels sound measurement.

I tried to measure root mean square of this pcm signal than take log but most of the values results in nan or -inf

0

There are 0 answers