2017-03-18 3:51 AM
Hi all,
I am attempting to build a microphone array out of digital MEMS microphones and I am trying to determine if I can achieve a reasonable system on an STM32F7 microcontroller. Ideally I would like to capture the output of 8 or more MEMS microphones synchronously with a filtered and downsampled output of 100Hz - 10kHz and12 bit resolution. I would like to transmit the data to a PC for processing in an algorithm I have developed. I am aware of the DFSDM peripheral however it seems that it is only capable of working with 4 elements synchronously or with 8 elements multiplexed between the 4 filter inputs.
My other inclination is to attempt to read the microphone data signals via GPIO using the DMA controller and perform the downsampling and filtering operation on the PC. Is this a viable option or is it difficult to perform without enough storage space on the microcontroller (As the output of one microphone is now being stored as a 1Mbit/s stream). From the DMA controller I can see that the number of microphone elements could now potentially be 16 given that the storage space requirements / speed could be met.As an aside, is it possible to utilize the ethernet peripheral on the microcontroller without TCP/IP. I.e. if I use the DMA to write to the Ethernet peripheral will these bytes be sent out in 'raw' over the wire. Is this a terrible idea in terms of bit error rate? I am trying to work out what is the minimal overhead solution for transmitting the microphone signals to a PC if they are to be coming in at a 1Msps sampling rate.#dma #gpio #ethernet #dfsdm #mems-microphones2017-03-19 6:13 PM
Digital MEMS microphones have big phase distortions, and huge dynamic nonlinearity. They are intended for voice communication, and a part of algorithms on cleaning of a sound from noise - already are on a chip crystal.
You need dynamic microphones, electrostatic microphones have the worst result (a problem of a narrow directivity).The number of microphones - are enough of three for the foreground.The principal condition - the synchronous sound codec for all channels.2017-03-19 8:09 PM
My recommendation would be to look first at some of the digital MEMS microphone examples that are provided by ST (or other uc vendors).
Online filtering of all audio streams from 8 microphones might be challenging (DFSDM is not an option; I think even the STM32F413/F423 line only has up to 6 filters) but if you're happy to do the processing afterwards on a PC you can configure a I2S clock to drive SPI peripherials for each pair of microphones you want to use. This allows to stream up to 12 digitial microphones on a stm32f429 using DMA for the transfer.On cheap nucleo boards, neither ethernet nor usb port provides enough bandwidth to dump reasonably high quality audio data from 8 microphones. My solution was to record raw PDM data to a SD card (or you could upgrade to a high-speed usb phy).If what you're doing is a just-for-fun home project and you're interested in sharing code, leave a email address where I can contact you and I send you some code from my 10 microphone array on a stm32f429.2024-10-21 8:24 AM
Hey thuber9,
this post is 7 years old so I know the chance are slim, but: If you're reading this, would you be willing to share your code (if you still have it) with me? I'm currently trying to see how to implement/design a microphone array without the use of an FPGA.
Thank you
2025-10-21 8:11 PM
I am working on microphone array built of 16 analog MEMS microphones connected to 16 channels of STM32 microcontroller. Here are some recommendations:
1. Use analog MEMS microphones (not I2S/SPI ones). Connect each mic through a single stage opamp amplifier to STM32 ADC inputs.
2. Configure ADC in circular DMA mode. For example, STM32H7B0 has 16 channels, ADC1 and ADC2 can be configured in dual simultaneous mode. Each ADC will scan 8 channels non-simultaneous, but the phase offset can be easily compensated using simple averaging. One optimal approach is to do conversion using some timer like LPTIM1 configured at 8x sample rate (384kHz for 48kHz), so all 8 channels acquisition times are evenly separated in time, then take two or three adjacent samples of each channel and perform integer interpolation based on channel number. The same applies to ADC2.
3. For audio applications can power AVDD using LDO with high PSRR, ensure power-on sequence is correct (check reference manual: digital power first, and then analog).
4. There are many STMs with plenty of RAM (>1MB for STM32H7B0) for beamforming and other algorithms. Some CMSIS FFT-related functions are pretty slow, such as amplitude/phase finding. Replace those with integer-based algorithms (Integer ATAN2, etc.).
Below is my PCB layout if somebody needs an inspiration. Note that there are many components are not related to the array: audio codec, sd-card, rtc chip, accelerometer, usb connectors. Array itself has pretty simple routing: the same microphone cell repeated 16 times and connected to the STM32.