cancel
Showing results for 
Search instead for 
Did you mean: 

two independent MEMS pdm acquisition

Posted on March 29, 2017 at 12:47

Hello STM!

I am facing a new goal: I want to build my own diferencial beamforming 2 MEMS PDM microphone array to achieve kardioid directivity pattern.

So i need to get data out of two MEMS mics simultaneously ... i mean literally get samples at the same time (because the beamforming depend havily on time that sound travel through space, so i will try not to add any delay between the two mics samples). 

So i am thinking what approach for data aquisition here is the best.

I got two variants at the top of my head. I will mention i am going to use probably some of STM32F4 168 MHz or higher (reason is that i developed so far a lot of my app using single microphone at this mcu and it had suitable performance for all the signal processing needed) 

   1. Variant:

Aquire both PDM via one I2S data line using the 'trick' with double PDM clk frequency from I2S routed to a timer (to divide the clk by 2) so i can aquire both of mems mics with only slight delay of tdelay =  1/2  *  1/Fs [s]. Thats fine, it result in sound travel distance difference of 66 um.

Another thing to consider is that i need to demux the signal via firmware routine that takes cpu time ... and i need to figure out how properly setup the PDM filter (i guess 2 input channels, 2 output channels?). 

Questions

Here i am not sure: If i demux bit interleaved pdm to Byte interleaved, this Byte format is suitable for PDM library right? 

My thoughts:

I dont like that this varian employ an additional timer. Even more i dislike that i will need to make an outside cpu rout with pdm clk that will be something like 2,5 MHz! 

   2. Variant:

Use a separate I2S peripherrals for each MEMS microphone.

Questions

Is it possible to synchronize both peribherrals so they start at exact same time? 

Does this option means more cpu load then the variant 1? here will be no need for demuxing the signals, but will be necesarry to call PDM toPCM function separately ... 

My thoughts:

I would like that variant because its easier to implement, and doesnt require to employ another Timer and rout high frequency (twice higher) outside mcu chip to timer input ... 

What do you think dear community? 

Thanks for your kind answers

reagards  Jan 

#pdm-stereo-mems-mic-libpdmfilter #mems-microphones #i2s #beamforming
11 REPLIES 11
Posted on July 18, 2017 at 13:37

Hey Jan,

   In full-duplex mode can the I2S and I2Sext both be receivers? If yes, do the HAL dirvers allow this configuration?

Regards,

MJ

Posted on July 18, 2017 at 15:12

In full-duplex mode can the I2S and I2Sext both be receivers?

There is no full-duplex mode of the I2S/I2Sext modules. They are half-duplex-only I2S modules, with the I2Sext having connected its WS/CK clocks onto the respective I2S unit at the GPIO level, that's how they can act together as full-duplex. As their internal setup is independent, yes, they both can be receivers (or both can be transmitters). The only limitation is that I2Sext can be only slave, i.e. cannot generate the clocks.

See

https://community.st.com/0D50X00009XkdjmSAB

.

If yes, do the HAL dirvers allow this configuration?

I don't use Cube.

JW