microphone-library-for-pico icon indicating copy to clipboard operation
microphone-library-for-pico copied to clipboard

Support mic array?

Open nanfang2000 opened this issue 2 years ago • 6 comments

Is it possible to support multiple PDM microphone and as USB microphone?

nanfang2000 avatar Jul 28 '21 17:07 nanfang2000

Hi @nanfang2000,

This should be possible to do for stereo PDM microphone input, however it is currently not supported by this library.

sandeepmistry avatar Aug 17 '21 13:08 sandeepmistry

Happy to review a pull request for this feature. At this time there are no plans for our team to develop this feature.

sandeepmistry avatar Oct 05 '21 14:10 sandeepmistry

Hey @nanfang2000 , did you make any progress here?

@sandeepmistry I am trying to do this and will PR if successful, any idea if we could go past two microphones, given that the microphone uses RP2040 PIO, which there are only two of?

CaydenPierce avatar Mar 10 '22 19:03 CaydenPierce

I have done this here: https://github.com/CaydenPierce/MSA

Modifying the system to support multiple microphones at once with a master PIO state machine for data and clock and slave PIO state machines for just data. Currently I have 4 microphones streaming data in.

@sandeepmistry my repo is a fork of a fork, but I would be up to PR this stuff if we can make it work, checkout the repo

CaydenPierce avatar Mar 15 '22 04:03 CaydenPierce

I have done this here: https://github.com/CaydenPierce/MSA

Modifying the system to support multiple microphones at once with a master PIO state machine for data and clock and slave PIO state machines for just data. Currently I have 4 microphones streaming data in.

@sandeepmistry my repo is a fork of a fork, but I would be up to PR this stuff if we can make it work, checkout the repo

Caydan that is really cool you also managed 48k x4 ? Anyone done this with I2S than PDM as notice the aliexpress modules seem to be much cheaper and also you could use ADC's.

This is really cool as respeaker do a collection of hats using TDM on the single pi port and there is no way to guarantee the channel order and in my mind totally useless even if sold by various vendors.

On the Pi I molested some code to do a delay-sum beamformer where really the only load is the GCC-PHAT to get TDOA. https://github.com/StuartIanNaylor/ProjectEars/tree/main/ds 2 channels on a zero2 runs about 60% on a single core but never progressed as the respeaker hats and clones because of the lack of TDM sync are sort of garbage. Also have fixed mics of a geometry ill suited for delay sum, due to aliasing makes them even more pointless.

Invensense did a great app note on simple beamforming https://invensense.tdk.com/download-pdf/an-1140-microphone-array-beamforming/

Where at 48Khz your 2 channel broadside should be approx 60-75mm which works in my above code molestation and if anyone is capable of providing a better neon optimised FFT then please do. It occured to me you could make a 4 channel directional array with only the overhead of GCC-Phat of 2 mics as likely the 2nd rear broadside can use the same TDOA as the front and the 21mm spacing between those 2 is static and likely could be calculated via the angle of the TDOA than running GCC_Phat gain. Never got round to implementing it due to the bad TDM/Fixed geometry implementation of the respeaker hats but the Pico/USB is sounding very interesting. Also wonder if you could get another port for an ADC that could be hardware loopback channels even though only one needed.

StuartIanNaylor avatar Oct 02 '22 15:10 StuartIanNaylor

I have done this here: https://github.com/CaydenPierce/MSA

Modifying the system to support multiple microphones at once with a master PIO state machine for data and clock and slave PIO state machines for just data. Currently I have 4 microphones streaming data in.

@sandeepmistry my repo is a fork of a fork, but I would be up to PR this stuff if we can make it work, checkout the repo

I have built according to your git. But when copying to Pico it doesn't work. Although when building for 1 mic pdm thep git in the main branch it still works. Can you help me find out what's wrong?

longhd2 avatar Jan 05 '24 23:01 longhd2