cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 realtime audio processing with DSP

psychegr
Associate II

Hi there,

this is my first post here and also the first time that I mess around with STM32 processors.
A few months ago I decided to start a new project for realtime audio processing with DSP
and the STM32H7 series seemed to me a good candidate for what I want to do.
So I bought a development board with STM32H743, a couple flash chips and a few CS4272 codecs.
I started the whole project, i wired everything and started writing the firmware.
I used as a guide a few youtube videos and soon I came up with the base code. 
The problem is that maybe I have some buffer synchronization issues because I get distorted sound.
Here are some details about the project. Clock set at 480 MHz, the CS4272 is set as standalone in slave mode and connected with I2S. The audio frequency is set at 48Khz and the dataframe is 24bits at 32 bit. I have verified that all clocks are correct. The levels of the audio signal are within specs. I use circular buffer with DMA in a array of words.
At first I tried to add some reverberation on the audio signal and that worked better than what I expected. The problem is when I try to do a IIR convolution on the signal. This is where I start to hear the distorted sound. I have tried lowering the buffer lengths and also the IIR buffer but nothing really changes.
Can someone guide me with troubleshooting this? I am using STM32CubeIDE with ST-LINK debugger.

Regards.

11 REPLIES 11

If you notice on the code above, lines 62 and 63 are different tests. The first one is a passthru. The second one is a reverb effect. Both of these work perfect! The problem is with the test in line 64. That one distorts the sound. I have a F411 nucleo here somewhere and I will test the code on it to see how it functions.

LCE
Principal II

Then compare the function Do_Reverb() to your FIR filter concerning execution time.

 

I'm pretty sure that the cause for the glitches is the setting of the I2S buffer pointers by the interrupts:

- the processing starts in main loop with the data ready flag

- while the "too long" processing takes place, the I2S (or SAI) interrupt sets the buffer pointers -> glitch

My guess is that the problem is gone with lower FIR filter taps.

 

And I would try to measure cycle counts for the complete signal processing, including the float conversions.