cancel
Showing results for 
Search instead for 
Did you mean: 

The STM32 calculation filter calculates RightBitShift for Sinc4

lek
Visitor

Hi there. I followed this tutorial (https://calibronic.com/tinyml-stm32-audio-recording-for-speech-recognition-part-1/), but I'm currently facing a problem. I am using an STM32H750 with the following parameters:

DFSDM clock is 120 MHz

DFSDM CLKOUT is 120 / 39 = 3.072 MHz

FOSR (Filter Oversampling Ratio) = 70

IOSR (Integrator Oversampling Ratio) = 1

Filter type: FastSinc

DFSDM input clock: 3.072 MHz

RightBitShift is 0x03

Target: 16-bit PCM (int16_t)

Sample rate is 44 kHz

With these settings, the data I get can be played back correctly.

Now, I want to change the filter type to Sinc4 while keeping all other parameters the same. I now have two problems:

The data obtained with Sinc4 is unusable and cannot be played.

After switching to Sinc4, I still have the bit depth set to 16 bits, but setting RightBitShift to 0x03 is incorrect, and the data cannot be played.

How should I calculate the RightBitShift value for the Sinc4 filter?

I tried the calculation method described in the tutorial, but it didn't work for me.
I'd also like to understand: if I change the DMA length from Word to Half Word, can the HAL_DFSDM_FilterRegularStart_DMAmethod be replaced with the HAL_DFSDM_FilterRegularMsbStart_DMAmethod?

0 REPLIES 0