cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to use ST AcousticBF from X-CUBE-MEMSMIC1 lib in PDM mode, to use together with dfsdm peripheral? We can also use SAI peripheral, for 4-6 microphones. So what is better SAI or DFSDM?

KBéla.1
Associate III
 
1 ACCEPTED SOLUTION

Accepted Solutions
Eleon BORLINI
ST Employee

Hi @Király Béla​ ,

Please consider that, if you acquire with the DFSDM peripheral, your signal is already in PCM format, so you are bounded to place your microphones at a minimum between-microphone distance of 2.1cm, since for the PCM the minimum delay (of 1 sample) that can be implemented with the library is equal to 2.1cm. In this way, however, you save the cost of the PDM to PCM conversion.

If you use the SAI peripheral and the PDM signal, the delay resolution that the AcousticBF library can provide is higher, depending directly on the clock frequency, so that you can place the microphones at the distance you want. The drawback is that the library will perform PDM to PCM conversion and so it will consume more MCU resources.

You may find further information in this design tip DT0117.

Please let me know whether these suggestions are useful.

-Eleon

View solution in original post

6 REPLIES 6
Eleon BORLINI
ST Employee

Hi @Király Béla​ ,

Please consider that, if you acquire with the DFSDM peripheral, your signal is already in PCM format, so you are bounded to place your microphones at a minimum between-microphone distance of 2.1cm, since for the PCM the minimum delay (of 1 sample) that can be implemented with the library is equal to 2.1cm. In this way, however, you save the cost of the PDM to PCM conversion.

If you use the SAI peripheral and the PDM signal, the delay resolution that the AcousticBF library can provide is higher, depending directly on the clock frequency, so that you can place the microphones at the distance you want. The drawback is that the library will perform PDM to PCM conversion and so it will consume more MCU resources.

You may find further information in this design tip DT0117.

Please let me know whether these suggestions are useful.

-Eleon

KBéla.1
Associate III

Thanks. It was useful. Another question: In PCM mode you wrote we need "minimum between-microphone distance of 2.1cm". So can we use bigger distances, too? For example 2.5cm, or we can use only the multiplies of that distance (e.g. 4.2cm, 6.4cm...).

The minimum distance is defined by the maximum audio frequency to be acquired, i.e. 20kHz considering the audio bandwidth. So it is not necessary to place the devices at multiples of the minimum distance, but just at distances higher than the minimum.

-Eleon

Hello,

I played a little bit with beamforming lib setup. In PCM mode I can use only 21mm distance. And in PDM mode the max. usable distance is 40mm, else the init function returns an ACOUSTIC_BF_DISTANCE_ERROR. So now I think, the STs beamforming library is not usable for bigger distances than 40mm. Am I right?

Eleon BORLINI
ST Employee

Hi @Király Béla​ ,

the maximum allowed distance is 21.2mm (so the maximum value allowed in the mic_distance variable is 212).

Our experts confirm me that this is also the optimal measure for which ST library has been calibrated.

For a more reasoned choice between PDM and PCM, you can refer to the table below:

0693W000007E7EkQAK.png 

If you control PDM clock, you have to pass also that parameter to the library

Otherwise, it would be better to use ST PDM2PCM library and run the BF in PCM mode.

-Eleon

KBéla.1
Associate III

Thanks, now it is clear for me.