2025-01-08 10:17 AM
Dear ST Community Member,
I hope you are all doing well.
We are currently acquiring audio using the STM32G4 and 2 PDM microphones in stereo mode. I would like to know how to split the left and right channel data. Could you please provide me with the appropriate SAI settings? Thank you!
Best regards,
Neeraj
2025-02-27 2:51 AM
Hi,
One channel data is acquired on the rising edge of the clock, the other channel is acquired on the falling edge.
There is an input signal on microphones, usually set to ground or vdd, to tell if the microphone sends data on the rising edge of the clock or the falling edge.
There are more information about this topic in the series of video there: https://www.youtube.com/watch?v=_YQSJJQUp-g
best regards,
Emmanuel
2025-03-01 3:04 PM
In stereo mode you would get an interleaved buffer: left PDM word followed by a right PDM word.
Even after converting PDM into PCM - still an interleaved buffer (like for I2S).
If you want to split the "stereo buffer" into two separate single channel buffers - you have to split by SW, e.g. via C-code running over the buffer or using a Mem-to-Mem DMA (as a "vector DMA": skipping the other channel values).