2020-07-02 07:05 AM
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
2020-07-02 01:47 PM
is micropython programmed in python ? cos I wanna stuff a lot of things to run fast , I'd rather use C/C++
2020-07-02 01:53 PM
the olimex seems like a good candidate :)
2020-07-02 01:54 PM
interesting but really obscure chinese board, cant even find the specs :)
2020-07-02 02:01 PM
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://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.
2020-07-02 02:25 PM
thanks for the tips, I am checking this out
2020-07-02 02:27 PM
the only thing a core would be specific for DSP domain is optimised add-mult cores, afaik
as long as it is c/c++ I can find DSP related libraries =)
I also need to check the nois level on the ADC's / DAC's and theyr capabilities
2020-07-02 02:55 PM
> how do I figure the frequency ?
Clock speed is up to 80MHz on that particular chip. Check out the datasheet.
https://www.st.com/en/microcontrollers-microprocessors/stm32l432kc.html
> are the ADC on these boards less noisy
Most chips have a 12-bit SAR ADC. It depends on your context of course, but you can get 8-10 bits of precision without much trouble. Some chips have a 16-bit sigma-delta ADC which has even better performance.
2020-07-02 05:19 PM
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.
2020-07-03 12:44 AM
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.
2020-07-03 02:51 PM
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.