Electronics > Microcontrollers

Getting Started with Audio DSP

(1/2) > >>

AaronD:
After two threads that seemed to stall out at the same point, I guess I need to get going.  :)

So, what's a good way for an 8-bit PIC/AVR guy to jump into audio DSP?  Looking for:

* USB, at the very least to make a stereo sound card, plus control, which is probably HID
* Stereo line-level ins and outs (don't need mic)
* Ease of understanding, starting with practically exclusive experience in the 8-bit world, and making it do things in tight real-time
* Low(ish?) cost of entry
* Room to expand within the same ecosystemMy current waiting list of projects includes:

* Single-sideband frequency shifter, as an experiment to reduce acoustic feedback in a live PA.  At least one analog line in and at least one analog line out, preferably 24-bit for both at 48kHz, plus a potentiometer to set the shift amount.
Potentially non-trivial requirements are:

* 1 ADC channel to read the pot
* Internal quadrature oscillator with sub-10Hz frequency controlled by that pot
* Enough allpass filters (or Hilbert transform?) to keep the entire audio band in quadrature
* Stereo USB sound card with a signal path of: highpass -> gain -> dynamic-range limiter -> crossover -> individual gain -> corrective EQ -> anti-clipping limiters -> TDM -> class-D chip amps to a custom 2.1 set of speakers.
Requires:

* Buttons, encoders, pots, and LED's for a user interface before the crossover
* USB control for the entire signal path, both graphically and from a Raspberry Pi shell script(*), and possible reprogramming as well, in addition to standards-compliant USB audio
(*A custom Pi app is okay for this, and might be required anyway for a graphical UI.  I've done that before and still have the code, to control an off-the-shelf digital sound board and some remote PTZ cameras in a live broadcast rig.)
* 8-in/8-out USB sound card plus 6 analog channels each direction (3 stereo in, 3 stereo out), with mic and speaker correction, mixing, and hearing/clipping protection.  This one is going to be especially interesting in that the mics and speakers are going to be physically close to each other with foam, resin, or some other kind of barrier in between, and their primary purpose is to fill in what the unavoidable acoustic lowpass cuts out.  So there may or may not be some feedback prevention in there as well.
Requires:

* Vanishingly low latency from ADC to DAC to avoid a comb filter, which might be the only excuse I can come up with to use a sample rate higher than 48kHz, and probably means that I need to write my own DSP code to process 1 sample at a time instead of using a 64-sample library
* Multichannel USB audio, with much looser time constraints just for monitoring and/or recording various points along the critical chain
* Like the stereo-to-2.1 sound card, the same USB is also used for control and possibly reprogrammingSome of those projects might be done in isolation with pre-fab libraries or perhaps even off-the-shelf products that already do that, but I really doubt that everything can.  So for the sake of learning this world and doing all of these projects at least somewhat consistently, I'd like to DIY all 3.

So far, I've seen:

* Analog Devices' chips and IDE (SigmaDSP and SigmaStudio), which would be wonderful if it weren't for the normally-imperceptible latency (killer for #3) and the glaring lack of on-chip USB audio.  (Just a "dumb conversion" between USB and TDM seems to take enough silicon that I might as well do the DSP in there too!)
* NXP's "Crossover MCU's", which are more general-purpose, not solely for audio DSP, but they easily have enough resources to do it: multichannel USB audio (in theory, haven't actually seen that yet), plus audio comms like I2S and TDM, and lots of GPIO on top of that.
* XMOS XU series, which is the "semi to move a feather" that I've seen just to add USB to a SigmaDSP chip.  It has a weird architecture, which limits the examples of how to use it.I have not, however, seen a good dev board that has the kind of analog audio I/O that I'm looking for.  I can roll my own PCB, and I'm pretty sure I will for project #3 at least, but it's probably a better idea to get started with something that hasn't missed a critical support piece out of ignorance!

So, given the 8-bit world that I'm coming from, and where I'm trying to go, what would you recommend as a first DSP kit that can at least do project #1 all by itself?  And possibly #2 as well, minus the amps.  (not at the same time)  At that point, I might be ready to put the same chip on a custom PCB to finish #2 and then look at #3.

rpiloverbd:
Did you try the TSA1701 Audio DSP Board? You could also try TDA7294, an excellent power amplifier ... You can read its basics here: https://www.theengineeringprojects.com/2021/01/tda7294-power-amplifier-datasheet-pinout-features-applications.html

fourtytwo42:
You could try the ADAU1702 & friends, simple programming with SigmaStudio (free download) simple to use knit together blocks (no DSP coding knowledge required). I built a sub complete with LPF, equalisation & adaptive overload compression in a matter of weeks and have been very pleased with the results for all the years I have been using it. May not tick every box on your list but definitely worth a look IMOP.

AaronD:

--- Quote from: rpiloverbd on December 14, 2021, 12:26:39 pm ---Did you try the TSA1701 Audio DSP Board?

--- End quote ---

That's better than what I've seen so far.  Looks like actual line level ins and outs, and not insanely expensive!  But no USB audio, just USB power.  Yes, I could add a USB DAC to feed it, but that seems a bit Rube-Goldberg-y.  (still not bad if it works though...)


--- Quote from: fourtytwo42 on December 14, 2021, 03:28:31 pm ---You could try the ADAU1702 & friends, simple programming with SigmaStudio (free download) simple to use knit together blocks (no DSP coding knowledge required). I built a sub complete with LPF, equalisation & adaptive overload compression in a matter of weeks and have been very pleased with the results for all the years I have been using it. May not tick every box on your list but definitely worth a look IMOP.

--- End quote ---

Ultimately, I want to be able to write my own DSP code on my own PCB.  The first couple of projects could easily be done with an ADAU and SigmaStudio, but that doesn't get me anywhere towards the later one(s) that have some unique needs that are going to be difficult to find a library for.  So while I could just knock those "easy" ones out with an off-the-shelf solution, I want to use them instead to build up my skills to where I can roll my own oddball.

I'm a casual Front-of-House and Broadcast Engineer already, so I know what the common processing blocks do and how they sound.  Don't need to learn that; just how to make them in software while satisfying my other requirements, and how to manage the chip that does it, in both PCB design and supervisory code.

And I'll probably have some CPU time left over, so it's going to be awfully tempting to combine some other functions into that chip as well.  Much easier to do that with a general-purpose chip that happens to have some DSP-friendly stuff in it (compared to the 8-bit world, at least), than with a purpose-designed DSP chip.


Maybe I'm overthinking this.  Does every 32-bit MCU have what an 8-bit hobbyist might call "DSP functions" as part of the instruction set (more than just a hardware multiplier, which is already a luxury in the 8-bit world), and "audio friendly" peripherals?  (specifically I2S and/or TDM)  If so, then the question probably changes to, "What is the easiest 32-bit MCU for an 8-bit guy to pick up and run with, and then not be limited by its ecosystem?"

That's more along the lines of what I was thinking as, "a good dev board that has the kind of analog audio I/O that I'm looking for."  Something to learn a 32-bit MCU on, with USB and line-level audio I/O as the primary focus, then use the same chip in my own designs.

oPossum:
An easy to use platform for getting started with audio DSP...

https://bela.io/about

https://www.youtube.com/c/BelaPlatform/videos

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod