Skip to main content
PF.1
Associate
July 2, 2020
Question

which (small but powerfull) board for dsp ?

  • July 2, 2020
  • 12 replies
  • 7073 views

Hello,

I want to DSP an audio signal to create guitar effect(s), and someone pointed me the Nucleo boards,

- are they the right choice for DSP ?

- if yes, which have a narrow/small footprint board (similar to teensy 3.6 or RPI zero)

the product selector is not really helping for that matter

thanks for the time you'll spend on this question

(https://www.st.com/en/evaluation-tools/stm32-nucleo-boards.html#products)

Phil

This topic has been closed for replies.

12 replies

S.Ma
Principal
July 2, 2020

Small form factor won't bode well with a development/prototyping board.

Most of the time, discovery boards include audio companion chips and audio codecs with Jacks and mems microphones.

Audio is tricky especially for the synhroneous and clocks.

I would start with Disco for STM32F76x and check newer ones based on H7 (more powerful with what it implies): It has double type 64 bit HW support.

PF.1
PF.1Author
Associate
July 2, 2020

"start with Disco for STM32F76x" how do you mean ? can't find anything in google

PF.1
PF.1Author
Associate
July 2, 2020

I can do decent (+-190khz sampling rate) audio on a raspberry pi zero (using an MCP3002 ADC), but linux gets in the way

TDK
July 2, 2020

Pretty much any STM32 is capable enough for DSP.

I believe the nucleo32 boards have a smallest form factor out of the official boards. I expect one or more of them can do the job. This one has ADC and DAC which should be all you need:

https://www.st.com/en/evaluation-tools/nucleo-l432kc.html

"If you feel a post has answered your question, please click ""Accept as Solution""."
PF.1
PF.1Author
Associate
July 2, 2020

24 MHz crystal oscillator.... compared to 240Mhz(Teensy) ang 1Ghz (RPI zero) ... is it the fastest board ?

TDK
July 2, 2020
The fastest? No, but you wanted the smallest.
Don’t confuse oscillator speed with clock speed. Max clock speed is much higher.
Stm32 cant compete with rpi in terms of total compute speed. But the rpi cant compete with stm32 in terms of realtime response.
"If you feel a post has answered your question, please click ""Accept as Solution""."
andrewg
Associate III
July 2, 2020

get any one of the STM32F4* mcu based boards e.g. F405, F407, F429 etc runs at 168 mhz and those has the ART accelerator (on chip cache), the psuedo whetstone single precision Mflops runs into numbers in the range of hundreds (may be like 200 Mflops) that used to be the speeds of the old Intel P4

https://www.stm32duino.com/viewtopic.php?t=27

pseudo because no one has proven if those large Mflops numbers are clever compiler optimizations which simply skip all the benchmark calculations.

but they are pretty fast

https://www.youtube.com/watch?v=0ETyFmAMFjY&t=20s

if that is still deemed not 'fast' enough for your applications, you can always get the F7* etc

if you want tiny, not just small, micropython, adafruit and olimex has the answers

micropython

https://store.micropython.org/product/PYBv1.1H

https://store.micropython.org/product/PYBD-SF2-W4F2

adafruit

https://www.adafruit.com/product/4382

olimex

https://www.olimex.com/Products/ARM/ST/STM32-H405/

then there are still the nucleos

do be wary that for the *tiny* boards, some pins may not be accessible as conventional 0.1" (2.54mm) pins or simply not accessible. check the specs

PF.1
PF.1Author
Associate
July 2, 2020

is micropython programmed in python ? cos I wanna stuff a lot of things to run fast , I'd rather use C/C++

andrewg
Associate III
July 2, 2020

just bear in mind that stm32f4* are after all micro controllers, they probably can't do those multicore simds similar to the A72 (e.g. RPi4) quad core prowess. but if micro controllers is what you need stm32f4* is a good one. micropython is just one of those things you can run on stm32f40x, c/c++ is the defacto standards on these boards. you can try out stm32duino if you'd prefer arduino style apis and environment

https://www.stm32duino.com/

https://github.com/stm32duino/Arduino_Core_STM32 - official STM core based on HAL

https://github.com/rogerclarkmelbourne/Arduino_STM32 - a community based implementation limited mcus

a thing is DSP is not the specific domain of the duino*s, hence, you'd probably need to look elsewhere for the dsp stuff.

but that arduino's may be a rather popular generic platform to base something on.

Tesla DeLorean
Guru
July 2, 2020
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
PF.1
PF.1Author
Associate
July 2, 2020

interesting but really obscure chinese board, cant even find the specs :)

gregstm
Senior II
July 3, 2020

For my guitar effects processor I'm using the STM32L4(+) - mainly because I want to run off a battery (and sometimes even just a coin cell). It has lots of RAM for reverb effects. The DSP instructions of the M4 processor are more efficient for effects routines/filters - especially if you get into assembly language. The floating point unit is a god-send for frequency FFT/FHT analysis/effects (especially the SQRT instruction!). The nucleo boards are good for quick prototyping/testing.

RMcCa
Senior II
July 3, 2020

I have been working on an endless digital synth project for the last few years and can say from experience that F730s are excellent and capable microcontrollers. I taught myself many things in the process including Kicad. I can lay out a pcb fairly quickly these days. All you need is a few opamps and an F7. My system uses a sample rate of about 26K which is about 8000 machine cycles @216Mhz. That is alot if you write good efficient code.​ SoCs like the F7s are built for these type of real-time applications, it's up to you to study the manuals and figure out how to put it all together to do what you want. I had a bit of a leg up to start as i am an experienced embedded C programmer but i found the transition to 32bit arm programming pretty easy and really enjoyable. It's C heaven in my opinion.

I've tried using more powerful multiprocessor boards like the Pi and most recently a Sony Spresense but decided i don't like operating systems.

PF.1
PF.1Author
Associate
July 4, 2020

lol, I am currently checking how to bare metal the sh#t out of an RPI zero in C/ASM

  • you're talking about the STM32F730I8 ? I usualy design my own boards, I can solder small packages, but this one is something a machine should put together (PcbWay or something)...do you have a tutorial I could learn from ? always wanted to make aboard with an arm processor

  • there are 4 chips, what's the main difference ? STM32F730I8, STM32F730R8, STM32F730V8, STM32F730Z8 ?

  • is there a way to add an external ram for reverbs/delays ?
gregstm
Senior II
July 5, 2020

".... to add an external ram for reverbs/delays" - I have implemented reverb that sounds quite nice within the ram of the micro (<64k) - if you use reverb based on all-pass filters you don't need as much ram as you may think. Search for the application note "How to Create Delay-based Audio Effects on the TMS...". With some STM32L4(+) micros having up to 320Kb of ram - that's plenty for all my effects.

andrewg
Associate III
July 3, 2020

i've actually thought about doing a midi wave table synth, and as it turns out among the challenges soundfont2 patch files can run into hundreds of megs.

https://github.com/FluidSynth/fluidsynth/wiki/SoundFont

that would mean needing an sd card at least. these days it is possible to use those with Fat FS with Arduino etc.

the other big challenge is memory, on chip sram it at best like 64k, 128k, and if you are lucky 192k etc. stm32f103c8 blue pill has only 20k sram.

to outdo all these challenges, you lay resort to fft etc, e.g. so that the wave tables is a fraction of the original size based on 'lossy' signal processing using fft.

there are Arm optimised dsp libraries from Arm CMSIS. confronting these challenges means significant development effort.

stm32f4* is deem pretty fast, there are reasonable basis for that.

but for the *very hard* challenges e.g. general midi 128 instruments 100-300 MB soundfont2 patches, you may be better off getting something as fast as is possible, e.g. the stm32f7*. in fact the ARM Cortex A often have implementations that already works e.g. http://www.fluidsynth.org/

the main thing about the Cortex A vs STM32 is STM32 has strong io (usb full speeds, spi, i2c, uart, hardware timers, gpios in the multitudes) and stm32 has decently fast ADCs that are pretty good. some of the bigger chips has DACs built in e.g. F405, F407, F429 etc has them. all these things makes things like even the Rpi4 fall short at the cliff, the cortex A simply don't have them. interfacing peripherals on those even for that matter RPi is messy and may be problematic. and on top stm32 f4 and f7 has cpus that run at the speeds of the old pentiums, pretty fast should say. this makes it a hybrid of sorts that fill niches. and one of the often missed things is that it has on-chip DMA at your disposal.

a lot of things that often needs additional interfacing chips on other platforms are simply software projects on stm32.

but nevertheless, mcu programming is bare metal programming, it is more often a culture shock for those familiar with the likes of RPi and desktop computing, it is simply different. e.g. on stm32f103c8 the popular 'blue pill' boards that is only 20k of sram available for everything, yet the applications keep evolving, perpetual.

PF.1
PF.1Author
Associate
July 4, 2020

I dont mind bare metal, indeed the isue is to have something that has memory, speed and decent IO's

another challenge is to find a board(narrow & small in my case) and if going bare metal, finding math libraries

going baremetal on a RPI means finding USB libraries too

RMcCa
Senior II
July 3, 2020

It's up to you whether to use somebody else's code or write your own. I have implemented many different sound generation/signal processing algorithms using bare-metal f730s. For example, a single f730 running at 216Mhz with a 26Khz sample rate can calculate 2 8 channel vocoders in real-time. That is 4x8 4 pole biquad filters and 2×8 envelope followers and multipliers. No problem. ​

PF.1
PF.1Author
Associate
July 4, 2020

so one can't do 44khz ?

gregstm
Senior II
July 4, 2020

the slower the sampling frequency you can get away with, the more processing time you have (and the more power you can save). I use 16KHz sampling rate. The highest note on the guitar is 1318Hz (E6 - 24th fret). Sounds ok to me - but then again, my hearing is probably not what it used to be....

RMcCa
Senior II
July 3, 2020

Also, wavetable synthesis is mearly another way of talking about DDS. It's not complicated at all and can be implemented with just a few lines code. Read about FM operators. Chowdry was able to make music with punch cards and a PDP-8​ altho not in real-time. Now you can do it real-time with a $5 chip.