Hi guys I have been a bit dumb in searching for an alsa delay as my sample count is likely not to be greater than three.
If you read https://invensense.tdk.com/wp-content/uploads/2015/02/Microphone-Array-Beamforming.pdf and you take 2x INMP441 you will notice they are 14mm in diameter.
This is handy as speed of sound corresponds to 2x samples @ 48000
I was wondering if either of you 2 could have a go with portaudio and the following or could get someone to give it a go.
So rather than L/R we have F/R (Front/Rear).
Rdelay1 = 0
Rdelay2 = 0
What we do is create a mono stream from the stereo input.
Current = -Rdelay2 + F
Rdelay2 = Rdelay1
Rdelay1 = R
You know me and my aversion to dev nowadays but I think its fairly easy to open up a stream for playback as if its easier to playback to a snd_loopback sink then do as not sure how to create a source.
The other side of the loopback will be available to the system as a source…
That is it that is our directional mono mic using a simple beamforming alg.
Its likely to sound not so great as it creates frequency dependent attenuation, but that is relatively easy.
If you read https://invensense.tdk.com/wp-content/uploads/2015/02/Microphone-Array-Beamforming.pdf and Figure 12. Frequency Response of an Endfire Beamformer at Different Incident Angles
From the null frequency we accumulate 6db of attenuation on each octave we go down.
So alsaeq to the rescue and some asound.conf to resample to 16Khz but by the end of it we should have a directional i2s mono 16khz mic .
As we can just use alsaeq to flatten the attentuation by adding the corresponding stepped gain. Probably drop the low freqs or just leave alone and same with 16khz if 14mm spacing is used.
Probably even I could hack some python portaudio to get the above working to test but thought would just shout out to someone more accomplished to give it a go and maybe also add the following.
If we are doing this work then guess we could add a noise gate where anything under a threshold is just set to zero.
Also a compressor is just a bit rotation >> 15 or more just to lose the LSBs or at least it would act like a psuedo one and only effect low order energy.
A little C utility would likely create much less load and be more performant but the routine is so few steps and simple I thought I would shout out that maybe give it a go in python.
Guess you could even use https://numba.pydata.org/ to accelerate the routine.
That is it and apart from testing & https://learn.adafruit.com/adafruit-i2s-mems-microphone-breakout/raspberry-pi-wiring-test we have directional I2S mems on a PI maybe with noisegate & compressor?
Also with other boards you might able to get a 11/12mm spacing so the null happens past 16Khz?