cancel
Showing results for 
Search instead for 
Did you mean: 

Using FP-SNS-ALLMEMS1 function pack and trying to take audio recordings at a sampling frequency of 4kHz.

NCho.1
Associate

I am a novice in firmware development so please forgive my lack of knowledge and experience with this system.

I am trying to obtain audio data at a lower frequency. Right now I can create wav files with a sampling frequency of 8k, but I want to go lower to 4k. It does not seem as straight forward as changing the AudioFreq to 4000 in the function Init_MEMS_Mics(AudioFreq, AudioVolume).

In the SensorTile_audio.c file of this example, there is this:

#define DFSDM_OVER_SAMPLING(__FREQUENCY__) \

    ((__FREQUENCY__) == (AUDIO_FREQUENCY_8K)) ? (128U) \

   : ((__FREQUENCY__) == (AUDIO_FREQUENCY_11K)) ? (256U) \

   : ((__FREQUENCY__) == (AUDIO_FREQUENCY_16K)) ? (128U) \

   : ((__FREQUENCY__) == (AUDIO_FREQUENCY_22K)) ? (128U) \

   : ((__FREQUENCY__) == (AUDIO_FREQUENCY_32K)) ? (64U) \

   : ((__FREQUENCY__) == (AUDIO_FREQUENCY_44K)) ? (64U) \

   : ((__FREQUENCY__) == (AUDIO_FREQUENCY_48K)) ? (64U) \

 : ((__FREQUENCY__) == (AUDIO_FREQUENCY_96K)) ? (32U) : (32U) 

How could I go about trying to lower the sampling frequency?

1 REPLY 1
Eleon BORLINI
ST Employee

Hi @Community member​ , if a constant like "AUDIO_FREQUENCY_4K" is not defined, or if you cannot reduce by a factor of 2 the MIC CLK, I suggest you to directly ask for support on the STM32 MCUs community. Regards