STM 32 F4 Discovery and Audioweaver, anyone tried?

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
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
 
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
 

Attachments

  • SubbandandFIR.JPG
    SubbandandFIR.JPG
    172.1 KB · Views: 842
  • M4FIRtestmr2.zip
    181.1 KB · Views: 109
  • M4FIRtest1.zip
    143 KB · Views: 97
Last edited:
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. :whip:
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.
 
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....
 

Attachments

  • AWFIR3CHM4F.JPG
    AWFIR3CHM4F.JPG
    154.6 KB · Views: 767
  • M4FIRtest4c.zip
    202.7 KB · Views: 85
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...
 

Attachments

  • unfiltered.jpg
    unfiltered.jpg
    110.6 KB · Views: 674
  • roomsimulation.JPG
    roomsimulation.JPG
    144.4 KB · Views: 664
  • EQfromrew.jpg
    EQfromrew.jpg
    108 KB · Views: 657
  • EQbassboostphaseeqbrickwalllpfilter.jpg
    EQbassboostphaseeqbrickwalllpfilter.jpg
    111.8 KB · Views: 509
  • roomsimulationsidesandfront.JPG
    roomsimulationsidesandfront.JPG
    136.2 KB · Views: 140
  • rephasePhase.JPG
    rephasePhase.JPG
    153.2 KB · Views: 136
  • rephaseGain.JPG
    rephaseGain.JPG
    153.9 KB · Views: 146
  • rephaseport.JPG
    rephaseport.JPG
    53 KB · Views: 128
  • rephasefilter.JPG
    rephasefilter.JPG
    57.1 KB · Views: 111
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
 
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
 

Attachments

  • STM32CubeMX.JPG
    STM32CubeMX.JPG
    121.9 KB · Views: 165
  • teststm32f4hw2.zip
    3.4 KB · Views: 95
Last edited:
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. "
 

Attachments

  • PCMspec.JPG
    PCMspec.JPG
    145.3 KB · Views: 262
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:
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).
 

Attachments

  • PCMspec2.JPG
    PCMspec2.JPG
    98.9 KB · Views: 261
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.
 
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)
 
Last edited:
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.