Minimum-viable FIR cabsim in a box?

Started by nickcordle, December 04, 2022, 02:07:13 PM

Previous topic - Next topic

nickcordle

Hi all,

What sort of circa 2022 hardware are we looking at to do a dead-simple FIR cabsim, but with the juice to sound really good, say, 200 ms at 48kHz/24bit?  Dead-simple means one analog in, one analog out, and a MIDI in to load the IRs via SysEx.

So it would take:
- ADC
- Computation
- Some persistent flash to store the IR
- DAC
- Microcontroller directing traffic and parsing MIDI

I've done a little reading but a lot of the discussions assume it's going to do multi-FX, multi channel, etc.  Commercial stuff like the Two Notes, TC Impulse, Mooer, etc ... all have fancy displays, tons of gadgets I don't want.  What if it really is just going to convolve, nothing else, do the requirements become workable?

So where does this start?  Is it a bunch of ICs doing these jobs or is there a particular SoC to look at?

Nick

Ripthorn

If you are wanting to do it yourself, you are going to have to look at a combination of components. As a point of reference, the microchip that I have worked on (design, DSP, implementation, etc.) for the better part of 9 year years is a smart CODEC that has analog in, analog out, onboard 8051 microcontroller, and 3 512-tap FIR's. The chip is meant for active noise cancellation, but it does all the same stuff as what you are talking about here. What makes your ask so hard is the FIR length combined with the sample rate. For a 48 kHz sample rate and 200 ms IR length, you are looking at 9600 FIR taps. If you want these done at the audio rate, then you need to be running at a super high rate, which is going to cost all kinds of MIPS. You are not likely to find an SOC that will handle that many FIR taps without some real trickery on the coding part. Also, most SOC's will need some significant firmware work to make MIDI work, which will require that you have the SDK for the part, which is not typically provided to the average Joe.

I have actually thought about this exact kind of thing many times before, though more for the use of binaural headphone amplification. You will need to find high performance audio converters, a fast processor, and an MCU with sufficient peripherals. I have looked at maybe something like a Teensy 4, but a dedicated DSP would work much better than pressing a fast MCU into service.

There are many ways to skin a cat, and I'm sure you can find one that works for you, but it's going to require a long trip down a very windy rabbit hole. Good luck!
Exact science is not an exact science - Nikola Tesla in The Prestige
https://scientificguitarist.wixsite.com/home

niektb

#2
Mind you, 200ms FIR at 48kHz is not trivial, you need a pretty potent processor for that :)

Maybe you can drop the IR loading over midi in favour of a SD-card that contains WAVs? That simplifies it a lot. Also check if you actually need 200ms, many people claim that 20ms is enough (such as Pete Thorn): https://youtu.be/VaWGfy4acLU
Would also greatly simplify matters :)

Personally I would start at looking at a Teensy 4.x paired with it's audio board. You can expand these boards with additional flash and SRAM (though I didn't check whether that's enough to deal with 200ms). Edit: ooh Ripthorn apparently also suggested this. Whoops!

nickcordle

If we define "arbitrarily good" to mean ... the IR is long enough that we're down into the noise floor of the preamp or the room when we captured the sine sweep, or floating point noise when we did the deconvolve ... Then I might define "good enough" to mean that I can't tell the difference between the truncated version and "arbitrarily good."

So, respect to Pete Thorn, but I disagree.  200 ms is the number I see on some of the stuff like Two Notes and TC Electronics.  I've truncated some of mine to 200 ms and felt fine about it, but that's kind of the floor for me to consider it worth doing.  I've done the same experiment with the lengths in a DAW as him.  Some IRs can tolerate more chopping than others.  It seemed like a lot of products appeared around the same time with 200 ms on their specs, enough to make me wonder if a new SoC had hit the market and everyone jumped it all at once.  Kind of like all those PT2399 delays.

Thanks for the tip about the T4.  I've programmed MCUs but always really small stuff, MSP430s mostly.  Wouldn't have known where to look for this ...

https://forum.pjrc.com/threads/68939-Low-latency-two-level-partitioned-convolution-for-the-T4

^ So here we have someone claiming that with a non-uniform partitioned FFT trick, a Teensy 4 will do an IR over 66k samples, and they've benchmarked this.  Some details differ, but ... plausible?  Some variation on this algorithm?

Quote from: Ripthorn on December 04, 2022, 04:22:53 PM
it's going to require a long trip down a very windy rabbit hole

I like those

niektb

Okay okay! If you've done research and experiments to land at 200ms then I'm totally fine with it. I just wanted to make sure it didn't originate from a big brand marketing story :) (especially cause it's a difficult requirement :))

Honestly, i'm not well-versed enough to know how partitioned convolution works, let alone write an implementation for it. Though it seems they already have:
https://github.com/bmillier/FFT-Convolution-Filter-Uniformly-partitioned/blob/master/README.md

in any case, the Audio System Design Tool is your friend :) https://www.pjrc.com/teensy/gui/