cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F769 Discovery Board: I want to read stereo analogue audio in from a jack, convolve both channels with a 4096-point impulse response, then output analogue audio from the other jack. How can I do this, please ?

MLawr
Associate III

I want the impulse response to be read in from an #include file, and I would prefer the sample rate to be 24 bits/96KS/s. I te above will require two boards, communicating via SPDIF, that would be fine.

7 REPLIES 7
MikeDB
Lead

Do you mean with the internal ADCs and DAC (in which case you're on a hiding to nothing) or using an external CODEC in which case it's just a matter of using the I2S port.

MLawr
Associate III

Yes; using the internal ADCs and DAC. Why am I on a 'hiding to nothing' ? Can't the STM32F769 do this ?

Whilst they have 16 bit resolution and a high sampling rate, they aren't really up to the audio quality implied by a 4096 point convolver unless you just need that length for a reverb effect. There was a thread regarding the ADC/DAC noise performance the other day. You could add analogue dither to increase the ADC range, and digital dither for the DAC, but a low cost 24 bit codec such as the ALC272 or CS4272 on the I2S bus would be a whole lot easier. I think there are cheap breakout boards with these on if needed.

I also thought there used to be an F4 Discovery board with a complete CODEC on it but I can't find it now.

MLawr
Associate III

Thank you for your advice. According to the datasheet, the STM32F769 Discovery board can accept 24bit/96KS/s. Latency is not a problem for my project, provided it is the same in both channels. Noise might be an issue: I will check this out once I have built my project.

Ah ok - just looked at the spec and that is the board that has a full CODEC on it. Some just have audio out. Noise shouldn't be an issue with a proper CODEC as they are well away from the digital stuff. The F series only has 32 bit floats so your best bit is to force use of the SMLAL 32*32->64 bit accumilate function for the best results. This usually needs an inline assembler directive.

MLawr
Associate III

I have tried to generate my project in CubeMX using both SAI1 and SAI2 for left and right channels, but the DAC is not available. I think that I might be completely misunderstanding what SAI1 and SAI2 are. What should I be doing in CubeMX to be able to input left and right channels, and then send processed audio data out of the DAC ?

Assuming it's a single chip CODEC, you only need a single SAI. It has an A channel which you use to drive both DACs in the CODEC and a B channel to receive data from both ADCs. Normally you do this by setting the SAI to stereo I2S mode as that is what most CODECs take. Is there a part number on the CODEC as it wasn't in the documentation I looked at.

You can daisy chain SAIs to use a single master clock but that's just making it complicated.