Audio weaver supports the cheap STM32 F4 Discovery.
Audio Weaver® - the Only Cross-Platform Audio Design Platform | DSP Concepts
STM32F4DISCOVERY Discovery kit with STM32F407VG MCU - STMicroelectronics
Has anybody tried it out as crossover or FIR filter?
As mentioned in other post:
http://www.diyaudio.com/forums/digital-line-level/195791-open-source-dsp-xos-68.html#post4248409
You need extra ADC or SPDIF in as the card only has mems mic and I2S in.
But in principle one could make a very cheap FIR filter for bass correction or I2S digital 2 way crossover.
I guess with clever downsampling the 12-bit, 2.4 MSPS A/D converters also could be used for audiosignals with only a AFE added. (Especially for bass applications)
SR 2 400 000 Hz
n 10
SR/(2^n) 2343,75 Hz
So about 22 bits at 2k SR.
I know the audio weaver software is very powerful and has quite OK learning curve.
The STM32F407 is 32-bit ARM Cortex-M4F. The F meaning it has extended DSP instructions
http://www.dspconcepts.com/sites/default/files/white-papers/STM32Journal_DSPC.pdf
Regards Torgeir
Audio Weaver® - the Only Cross-Platform Audio Design Platform | DSP Concepts
STM32F4DISCOVERY Discovery kit with STM32F407VG MCU - STMicroelectronics
Has anybody tried it out as crossover or FIR filter?
As mentioned in other post:
http://www.diyaudio.com/forums/digital-line-level/195791-open-source-dsp-xos-68.html#post4248409
You need extra ADC or SPDIF in as the card only has mems mic and I2S in.
But in principle one could make a very cheap FIR filter for bass correction or I2S digital 2 way crossover.
I guess with clever downsampling the 12-bit, 2.4 MSPS A/D converters also could be used for audiosignals with only a AFE added. (Especially for bass applications)
SR 2 400 000 Hz
n 10
SR/(2^n) 2343,75 Hz
So about 22 bits at 2k SR.
I know the audio weaver software is very powerful and has quite OK learning curve.
The STM32F407 is 32-bit ARM Cortex-M4F. The F meaning it has extended DSP instructions
http://www.dspconcepts.com/sites/default/files/white-papers/STM32Journal_DSPC.pdf
Regards Torgeir
Nobody?
Had a little test myself.
The basic setup is fixed 48k SF USB out from PC. So a cheap USB soundcard.
The sound is OK. No annoying artifacts.
I was looking for cheap FIR for bass room correction. So high frequency resolution was required. And preferably low latency.
I have problem with getting the buffer up and down to work.
The workaround was subband coding, extracting lowest band and padding the rest.
Then I got the lowest subband (1500k SF) channel only FIR size up to 2048. So 0.75 Hz frequency resolution. Not bad for a 15$ card.
The problem is how to get to use the I2S inn and the free version of Audio weaver....
For experimeting it is excelent.
Enclose a the files + a basic FIR (short latency) also
Had a little test myself.
The basic setup is fixed 48k SF USB out from PC. So a cheap USB soundcard.
The sound is OK. No annoying artifacts.
I was looking for cheap FIR for bass room correction. So high frequency resolution was required. And preferably low latency.
I have problem with getting the buffer up and down to work.
The workaround was subband coding, extracting lowest band and padding the rest.
Then I got the lowest subband (1500k SF) channel only FIR size up to 2048. So 0.75 Hz frequency resolution. Not bad for a 15$ card.
The problem is how to get to use the I2S inn and the free version of Audio weaver....
For experimeting it is excelent.
Enclose a the files + a basic FIR (short latency) also
Attachments
Last edited:
The workaround was subband coding, extracting lowest band and padding the rest.
Oops, no subband coding! Just the splitting of the signal in 32 bands with oversampling.
Ref 8. FilterBank Processing in
http://www.dspconcepts.com/sites/default/files/documentation/Audio Weaver Module User's Guide.pdf
Made a mixer for MP2 encoded streams in 93 and got the terms mixed up 22 years later...
Last edited:
SR 2 400 000 Hz
n 10
SR/(2^n) 2343,75 Hz
So about 22 bits at 2k SR.
Regards Torgeir
Ouch, a lot of error here. Thanks for PM.

The correct is 3 dB better noise for each halving of samplerate.
http://www.atmel.com/images/doc8003.pdf
And I guess 2.4 Mhz SR is a little optimistic. Maybe 400k?
So 7 * 3 = 21 is more realistic. Ends up at about 90 dB SNR. Still an OK number for bass and this pricelevel. High harmonics under 150Hz is no problem in my opinion using ordinary (sub 200$) bass elements.
Another use of the tools is:
Testing filterslopes and making analog filters based on those slopes.
Making cheap fullband or "analog filtered" USB PC speakers with driverfrequency correction and some roomcorrection is another. (Manages about 1024 fir taps for 2 channel 48kHz, so 50Hz frequency resolution of FIR filter, IIR should be considered in bass when downsampling can't be done)
Cheap outboard DSP power is here.
If you need a filter program for passive speakers I have made one:
https://sites.google.com/site/passivefilter/
Last edited:
And yet another kind of setback.
How to get audio to play on an ST Cortex-M4 Discovery Board? | DSP Concepts
Only USB in works for Audio weaver. So no standalone operation.
Still possible to prototype and test. But the coding must be done yourself in KEIL or similar to have full control of inputs and outputs. (Think DSP Consepts was involved in KEIL DSP C algorithms).
Another board that is supported but nor so well documented with Audio weaver is the 49$ 32F746GDISCOVERY Discovery kit with STM32F746NG MCU - STMicroelectronics
SPDIF in.
Guess the coding has to be done manually at that board also.
How to get audio to play on an ST Cortex-M4 Discovery Board? | DSP Concepts
Only USB in works for Audio weaver. So no standalone operation.
Still possible to prototype and test. But the coding must be done yourself in KEIL or similar to have full control of inputs and outputs. (Think DSP Consepts was involved in KEIL DSP C algorithms).
Another board that is supported but nor so well documented with Audio weaver is the 49$ 32F746GDISCOVERY Discovery kit with STM32F746NG MCU - STMicroelectronics
SPDIF in.
Guess the coding has to be done manually at that board also.
The block size can be changed on input and output HW to 1024.
Then it is possible to decimate with fir 64 times to 750Hz SR.
The filterbank FIRs can then be 2 x 2048.
So 2 cannels with filter LP filter at 148Hz 60dB/oct. Then FIR filters with frequency resolution of 750Hz/2048 = about 0.370Hz.
Now it should be possible to hit the room resonances below 148Hz quite precise.
A full xover and roomcorrection system run on a cheap mini PC and prosessing on that PC (ASIO out to normal soundcard of decent quality) can achive wild filtering performance, but I think it must be a dedicated PC so the price is 10x and up....
Then it is possible to decimate with fir 64 times to 750Hz SR.
The filterbank FIRs can then be 2 x 2048.
So 2 cannels with filter LP filter at 148Hz 60dB/oct. Then FIR filters with frequency resolution of 750Hz/2048 = about 0.370Hz.
Now it should be possible to hit the room resonances below 148Hz quite precise.
A full xover and roomcorrection system run on a cheap mini PC and prosessing on that PC (ASIO out to normal soundcard of decent quality) can achive wild filtering performance, but I think it must be a dedicated PC so the price is 10x and up....
Attachments
This is like a blog...
The last audioweaver configuration supports 1024 tap FIR filter at 750Hz.
First try was only to sheck if the mcu could prosess the filter. So filter was 1,0,0,0,0,0,...,0
I used REW and RePhase to check if a real world bass eq for phase and EQ was possible. (Seeing is believing).
I got lot of time lag. And the microphone was always in same position.
Note that the divs are at 2 dB! I havent seen more linear bass.
But the simulations show that the ear does not have to move much to have different results...
The last audioweaver configuration supports 1024 tap FIR filter at 750Hz.
First try was only to sheck if the mcu could prosess the filter. So filter was 1,0,0,0,0,0,...,0
I used REW and RePhase to check if a real world bass eq for phase and EQ was possible. (Seeing is believing).
I got lot of time lag. And the microphone was always in same position.
Note that the divs are at 2 dB! I havent seen more linear bass.
But the simulations show that the ear does not have to move much to have different results...
Attachments
-
unfiltered.jpg110.6 KB · Views: 714
-
roomsimulation.JPG144.4 KB · Views: 703
-
EQfromrew.jpg108 KB · Views: 694
-
EQbassboostphaseeqbrickwalllpfilter.jpg111.8 KB · Views: 593
-
roomsimulationsidesandfront.JPG136.2 KB · Views: 181
-
rephasePhase.JPG153.2 KB · Views: 183
-
rephaseGain.JPG153.9 KB · Views: 186
-
rephaseport.JPG53 KB · Views: 172
-
rephasefilter.JPG57.1 KB · Views: 154
Hi torgeirs
Im very interesed in your reserches. Im in path of start learning trougth DSP stuff but for now im i totally newbye for that, but i think STM32F4 discovery eval board is a little gem for his price and power and only need some people make the work for a very cheap active xover system and maybe with some another addons like drc, etc...
I dont know if STM32F4 have enought power to manage a multichannel system because seems you only tested to one channel (for FIR, IIR, DRC filtering) and what would be his input source (a cheap spdif addon board ) and codec DAC to output to analog
I will be very satisfied if you keep posting your researches about that and
Audiowaver is a great (free) piece of software that for me is very interest to rsearch to make the design filtering to DSP and with a reasonable learning curve to anyone.
My congratulations for your work
I stay tuned to this , or in any other place would you write about.
PD: Excuse my poor english, im spanish speaking
Im very interesed in your reserches. Im in path of start learning trougth DSP stuff but for now im i totally newbye for that, but i think STM32F4 discovery eval board is a little gem for his price and power and only need some people make the work for a very cheap active xover system and maybe with some another addons like drc, etc...
I dont know if STM32F4 have enought power to manage a multichannel system because seems you only tested to one channel (for FIR, IIR, DRC filtering) and what would be his input source (a cheap spdif addon board ) and codec DAC to output to analog
I will be very satisfied if you keep posting your researches about that and
Audiowaver is a great (free) piece of software that for me is very interest to rsearch to make the design filtering to DSP and with a reasonable learning curve to anyone.
My congratulations for your work
I stay tuned to this , or in any other place would you write about.
PD: Excuse my poor english, im spanish speaking
Thank you jirm!
I think by using the STM32F4 and audioweaver you will learn a lot about digital signalprosessing. It is also great for prototyping to see what is possible.
I got it to run 2 x 1024 tap FIR filter or 1 x 2048 tap. Guess you can devide 2048 on number of channels to get FIR length for each channel. I only measured 1 of the channels, but the other cannel was running on the board.
Be aware that there are only 2x I2S + USB.
That is 2 audio channels out and 2 in using I2S or
4 audio channels out and 2 in using I2S and USB.
(That would be 4 x 512 tap FIR, with USB in)
The dac is using one of the I2S on the board. But, I think the DAC is decent.
The real time consuming part is going from audioweaver to code. Of course you could buy audioweaver Developer but I suspect it will not be DIY hobby friendly price.
The best would be if someone made software that:
Got I2S input data.
Implemented decimator algorithm
Implemented interpolator algorithm
Implemented FIR filter algorithm
Implemented IIR filter algorithm
Sent I2S output data.
CMSIS DSP Software Library
(I wil not be that someone unfortunately)
Then cheap FIR for bass or coarse drc (which is a FIR filter) could be implemented without need of a PC to run when programming is finished.
I did have a look at the STM32Cube and the STM32Cube MX software is great for visualizing the hardware posibilities.
A brief nonworking sketch for 96KHz I2S inn and 8kHz I2S to DAC out is enclosed as zipped .ioc file.
(Found no way to make high SF out based on input I2S clock, there might be one that i overlooked. Using internal clock is always possible)
Regards Torgeir
I think by using the STM32F4 and audioweaver you will learn a lot about digital signalprosessing. It is also great for prototyping to see what is possible.
I got it to run 2 x 1024 tap FIR filter or 1 x 2048 tap. Guess you can devide 2048 on number of channels to get FIR length for each channel. I only measured 1 of the channels, but the other cannel was running on the board.
Be aware that there are only 2x I2S + USB.
That is 2 audio channels out and 2 in using I2S or
4 audio channels out and 2 in using I2S and USB.
(That would be 4 x 512 tap FIR, with USB in)
The dac is using one of the I2S on the board. But, I think the DAC is decent.
The real time consuming part is going from audioweaver to code. Of course you could buy audioweaver Developer but I suspect it will not be DIY hobby friendly price.
The best would be if someone made software that:
Got I2S input data.
Implemented decimator algorithm
Implemented interpolator algorithm
Implemented FIR filter algorithm
Implemented IIR filter algorithm
Sent I2S output data.
CMSIS DSP Software Library
(I wil not be that someone unfortunately)
Then cheap FIR for bass or coarse drc (which is a FIR filter) could be implemented without need of a PC to run when programming is finished.
I did have a look at the STM32Cube and the STM32Cube MX software is great for visualizing the hardware posibilities.
A brief nonworking sketch for 96KHz I2S inn and 8kHz I2S to DAC out is enclosed as zipped .ioc file.
(Found no way to make high SF out based on input I2S clock, there might be one that i overlooked. Using internal clock is always possible)
Regards Torgeir
Attachments
Last edited:
See now that dspconsepts themselves has tried about 2x3500 fir length.
No resampling but great for DRC.
Audio Weaver Tutorials | DSP Concepts
No resampling but great for DRC.
Audio Weaver Tutorials | DSP Concepts
Had a look at multichannel interface.
I'm on thin ice here....
Looking at
http://www.cirrus.com/en/pubs/proDatasheet/CS4385A_F2.pdf
and STM32CubeMX.
I wonder if the TDM (cirrus) and PCM, short frame (STM32F4) is the same.
If that is the case, 8 in/out analog is possible.
Anyone?
From 2.2.25 Inter-integrated sound (I2S) in
http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/DM00037051.pdf
" When either or both of
the I2S interfaces is/are configured in master mode, the master clock can be output to the
external DAC/CODEC at 256 times the sampling frequency. "
I'm on thin ice here....
Looking at
http://www.cirrus.com/en/pubs/proDatasheet/CS4385A_F2.pdf
and STM32CubeMX.
I wonder if the TDM (cirrus) and PCM, short frame (STM32F4) is the same.
If that is the case, 8 in/out analog is possible.
Anyone?
From 2.2.25 Inter-integrated sound (I2S) in
http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/DM00037051.pdf
" When either or both of
the I2S interfaces is/are configured in master mode, the master clock can be output to the
external DAC/CODEC at 256 times the sampling frequency. "
Attachments
Last edited:
The STM32F40nnn SAI should support to I16S. See section 29.7 of the reference manual, specifically SAI_xSLOTR; what ST calls the FS signal is more often referred to as LRCK or WCK. IMO the most interesting multichannel configuration is I8S---what Cirrus refers to as OLM---at 32 bits/sample. Mind the packing and unpacking for multirate filter banks, though.
Last edited:
Thank you for the reference and opinions, twest820!
http://www.st.com/web/en/resource/technical/document/reference_manual/DM00031020.pdf
I'm used to working with MSP from TI so i'm not familiar with ST documentation.
This really gives more in depth information that I need some time to digest;-)
http://www.st.com/web/en/resource/technical/document/reference_manual/DM00031020.pdf
I'm used to working with MSP from TI so i'm not familiar with ST documentation.
This really gives more in depth information that I need some time to digest;-)
Arghhh!
"RM0090 Serial audio interface (SAI)
957
29 Serial audio interface (SAI)
This section applies to the STM32F42xxx and STM32F43xxx family."
Where can I find the STM32F40xxx SAI documentation?
"RM0090 Serial audio interface (SAI)
957
29 Serial audio interface (SAI)
This section applies to the STM32F42xxx and STM32F43xxx family."
Where can I find the STM32F40xxx SAI documentation?
Guess the answer is no SAI on STM32F40xxx
So the documentation on the audiointerface is found in:
"RM0090 Serial peripheral interface (SPI)
28 Serial peripheral interface (SPI)
This section applies to the whole STM32F4xx family, unless otherwise specified."
Found also a nice reference to improving ADC accuracy by averaging
http://www.st.com/st-web-ui/static/...ical/document/application_note/DM00050879.pdf
So the documentation on the audiointerface is found in:
"RM0090 Serial peripheral interface (SPI)
28 Serial peripheral interface (SPI)
This section applies to the whole STM32F4xx family, unless otherwise specified."
Found also a nice reference to improving ADC accuracy by averaging
http://www.st.com/st-web-ui/static/...ical/document/application_note/DM00050879.pdf
Maybe 32 bit PCM is possible? Else half the bits is wasted and 16-bit extended to 32-bit packet frame has to be used to interface with TDM (cirrus)
ST has not documented 32-bit extended to 32-bit packet frame with figure. But it is possible to set in CubeMX.
28.4.3 Supported audio protocols:
"However there is only one 16-bit register for the
transmission and the reception."
"Four data and packet frames are available. Data may be sent with a format of:
• 16-bit data packed in 16-bit frame
• 16-bit data packed in 32-bit frame
• 24-bit data packed in 32-bit frame
• 32-bit data packed in 32-bit frame"
When using 16-bit data extended on 32-bit packet, the first 16 bits (MSB) are the significant
bits, the 16-bit LSB is forced to 0 without any need for software action or DMA request (only
one read/write operation).
The 24-bit and 32-bit data frames need two CPU read or write operations to/from the
SPI_DR or two DMA operations if the DMA is preferred for the application. For 24-bit data
frame specifically, the 8 nonsignificant bits are extended to 32 bits with 0-bits (by hardware).
For all data formats and communication standards, the most significant bit is always sent
first (MSB first).
ST has not documented 32-bit extended to 32-bit packet frame with figure. But it is possible to set in CubeMX.
28.4.3 Supported audio protocols:
"However there is only one 16-bit register for the
transmission and the reception."
"Four data and packet frames are available. Data may be sent with a format of:
• 16-bit data packed in 16-bit frame
• 16-bit data packed in 32-bit frame
• 24-bit data packed in 32-bit frame
• 32-bit data packed in 32-bit frame"
When using 16-bit data extended on 32-bit packet, the first 16 bits (MSB) are the significant
bits, the 16-bit LSB is forced to 0 without any need for software action or DMA request (only
one read/write operation).
The 24-bit and 32-bit data frames need two CPU read or write operations to/from the
SPI_DR or two DMA operations if the DMA is preferred for the application. For 24-bit data
frame specifically, the 8 nonsignificant bits are extended to 32 bits with 0-bits (by hardware).
For all data formats and communication standards, the most significant bit is always sent
first (MSB first).
Attachments
OK just saw whats ST is making available.
(Guess no audioweaver support)
Nucleoboard with SPDIF in and 2 x SAI, F446RE About 10$
NUCLEO-F446RE STM32 Nucleo-64 development board with STM32F446RET6 MCU, supports Arduino and ST morpho connectivity - STMicroelectronics
STM32F446RE High-performance foundation line, ARM Cortex-M4 core with DSP and FPU, 512 Kbytes Flash, 180 MHz CPU, ART Accelerator, Dual QSPI - STMicroelectronics
Audioboard with 2 x 50W at 6 ohm 25V. Two boards can be stacked for 4 channel. About 37 $ for 2 channels. + 25V power
X-NUCLEO-CCA01M1 Sound terminal expansion board based on STA350BW for STM32 Nucleo - STMicroelectronics
25$ each channel 50W, FIR prosessing and SPDIF in....
Wonder if the nucleoboards can be interconnected with SAI interfaces or if they are used up by the amps.
(Guess no audioweaver support)
Nucleoboard with SPDIF in and 2 x SAI, F446RE About 10$
NUCLEO-F446RE STM32 Nucleo-64 development board with STM32F446RET6 MCU, supports Arduino and ST morpho connectivity - STMicroelectronics
STM32F446RE High-performance foundation line, ARM Cortex-M4 core with DSP and FPU, 512 Kbytes Flash, 180 MHz CPU, ART Accelerator, Dual QSPI - STMicroelectronics
Audioboard with 2 x 50W at 6 ohm 25V. Two boards can be stacked for 4 channel. About 37 $ for 2 channels. + 25V power
X-NUCLEO-CCA01M1 Sound terminal expansion board based on STA350BW for STM32 Nucleo - STMicroelectronics
25$ each channel 50W, FIR prosessing and SPDIF in....
Wonder if the nucleoboards can be interconnected with SAI interfaces or if they are used up by the amps.
The more flexible SGPIO peripherals on NXP LPC4300s may also be worth a look; the slice clock divider should be of some help in downsampled applications. Not sure about the LPC Link 2 but Audioweaver does support the chips.
Looking at the CCA01M1 documentation it does not state F446RE as compatible for click in.
Irritating that the other compatible nucleo boards only have 2 x I2S so no I2S is available for input when used with 2 CCA01M1 boards.
Guess the boards does not need to be stacked.
Maybe F446RE boards can be used for audio and the other clickins for I2C to CCA01M1 boards and between boards for volume and IIR filter etc on the CCA01M1 boards.
Then maybe F446RE can have:
SPDIF in
2 x I2S to CCA01M1
SAI SPDIF out to send relayed audio to other F446RE boards with 2 x CCA01M1.
I2S or SPI between nucleo boards.
Then the number filter/amp channels could be endless.
A real distributed DSP system🙂
Maybe a little heavy on the management....
I have to call my old 'line swithed telecom' colleagues. (joke)
Irritating that the other compatible nucleo boards only have 2 x I2S so no I2S is available for input when used with 2 CCA01M1 boards.
Guess the boards does not need to be stacked.
Maybe F446RE boards can be used for audio and the other clickins for I2C to CCA01M1 boards and between boards for volume and IIR filter etc on the CCA01M1 boards.
Then maybe F446RE can have:
SPDIF in
2 x I2S to CCA01M1
SAI SPDIF out to send relayed audio to other F446RE boards with 2 x CCA01M1.
I2S or SPI between nucleo boards.
Then the number filter/amp channels could be endless.
A real distributed DSP system🙂
Maybe a little heavy on the management....
I have to call my old 'line swithed telecom' colleagues. (joke)
Last edited:
- Home
- Source & Line
- Digital Line Level
- STM 32 F4 Discovery and Audioweaver, anyone tried?