Author Topic: Information About IR Cab Simulators  (Read 1734 times)

boga

Information About IR Cab Simulators
« on: March 29, 2019, 01:04:30 PM »
Hi, Guys!

I want to learn about IR (impulse response) cab simulators and eventually build one. The software side is (of course) more important to understand.

Can you recommend materials and links over here?

It would be even better to get links for whole projects and / or source code.  8)

markseel

Re: Information About IR Cab Simulators
« Reply #1 on: April 01, 2019, 01:53:57 PM »
Are you looking to make a pedal or rather implement a plugin on the PC?

Some hardware options for pedals  ...

https://www.diystompboxes.com/smfforum/index.php?topic=117218.0
https://www.tindie.com/products/Blackaddr/arduino-teensy-guitar-audio-shield/?pt=ac_prod_search
https://www.kickstarter.com/projects/632112529/68367638/preview?ref=pbuild_dashboard#project-preview
https://github.com/flexfx/flexfx.github.io

The FlexFX kit and the KickStarter effects pedal aren't done yet but they're close (next month sometime?).  The Teesny stuff is already finished.  It's lower power DSP-wise but it's probably easier to use ... and it's done!

Applying an IR to a digital signal is just discrete convolution ... https://en.wikipedia.org/wiki/Convolution

Let X[t] be your input signal where t is some point in the past (x[0] is the current sample, x[1] the previous, x[2] the one before that, etc).

Let C[n] be your IR data and N be the number of coefficients in this array (0 <= n < N).  These are impulse response coefficients and represent the ... impulse response :-) ... of the system that your signal is flowing through.  It's the response of a system that's excited with a brief input signal (the impulse).

Let Y[t] be the result of impulse response processing, the result of digital convolution of X through C.

Y[0] = C[0] * X[0] + C[1] * X[1] + ... C[N-1] * X[N-1]

Notice that X changes after each input sample - new samples are pushed into that array and the oldest sample is discarded.  So X is basically a sample buffer/fifo.

This is time-domain convolution and it's very straightforward.  But it's also MIP's expensive.  At a sample-rate of 48 kHz you have to do 48K convolutions per second.  So that's 48K * N multiply-accumulate (MAC) operations per second.  Most speaker IR's have appreciable impulse response data (energy) out to 50 msec.  20 msec though still give good results for most IR's.  At 20 msec you have to store 0.002*48K = 960 samples.  For that example N = 960.  So we now have 48K*960=46,080,000 MAC's per second. 

Frequency domain convolution is generally more efficient at higher N.  If you want to model room/hall acoustics (100's of msec) or if you want to do IR-based reverb (seconds) then this pretty much the the only way to go.

But time-domain works just fine for speaker/cab sims.  The FlexFX hardware can do about 75 msec.  Not sure about Teensy (ARM Cortex M4 in general) ... maybe 20msec?  Good enough :-)
« Last Edit: April 01, 2019, 01:56:07 PM by markseel »

elseif

Re: Information About IR Cab Simulators
« Reply #2 on: May 04, 2019, 08:21:22 PM »
In 2014 I made an impulse loader using a Texas Instruments TMS320C5535 EZDSP kit, which came with a TLV320AIC3204 codec, had a built in Code Composer Studio v4 USB interface, and at the time cost 55 USD. I used redwirez impulses (bass cabinets).  As I recall, I stored both program and impulses on a FAT16 formatted SD card using the Petit FFS library.  The impulses were stored as wav files.  It  did work. Due to processing, the length of an impulse was limited to 100 msec or so at 32 ksps. The SVT samples for example were of length 75 msec. This is all from memory. I would have to go through the code to be confident. I recall converting the redwirez samples to a lower rate.

The C5535 EZDSP kit is no longer recommend for new designs. The recommended replacement is the TMS320C5517, which is maybe twice as fast and has some changes to the I/O. The dev board is much more expensive than $55.

I have the code, but whether it is of value is questionable.  The coding problems for something as simple as this are not the signal processing, but rather the mundane embedded processing details of interface, DMA, interrupts, preemptive multitasking, and the like, which are generally specific to the platform.

One problem with a DIY DSP project is that the DSPs are now ball-grid arrays.  I don't know how to do that DIY.  A community project would probably be the right way to provide a development platform that included the interfaces needed by most experimenters for audio projects.

SwedishWings

Re: Information About IR Cab Simulators
« Reply #3 on: December 19, 2019, 01:59:39 AM »
In 2014 I made an impulse loader using a Texas Instruments TMS320C5535 EZDSP kit, which came with a TLV320AIC3204 codec, had a built in Code Composer Studio v4 USB interface, and at the time cost 55 USD. I used redwirez impulses (bass cabinets).  As I recall, I stored both program and impulses on a FAT16 formatted SD card using the Petit FFS library.  The impulses were stored as wav files.  It  did work. Due to processing, the length of an impulse was limited to 100 msec or so at 32 ksps. The SVT samples for example were of length 75 msec. This is all from memory. I would have to go through the code to be confident. I recall converting the redwirez samples to a lower rate.

The C5535 EZDSP kit is no longer recommend for new designs. The recommended replacement is the TMS320C5517, which is maybe twice as fast and has some changes to the I/O. The dev board is much more expensive than $55.

I have the code, but whether it is of value is questionable.  The coding problems for something as simple as this are not the signal processing, but rather the mundane embedded processing details of interface, DMA, interrupts, preemptive multitasking, and the like, which are generally specific to the platform.

One problem with a DIY DSP project is that the DSPs are now ball-grid arrays.  I don't know how to do that DIY.  A community project would probably be the right way to provide a development platform that included the interfaces needed by most experimenters for audio projects.

Sorry for wakening a dead thread, but i've been sitting on two TMS320C5505 eZDSP Sticks for a while that i planned to use for something fun, and this is it!

If you could share your code it would probably save me a lot of time.

Thanks in advance!