Author Topic: The IR project: acoustic guitar processing and cabinet simulation  (Read 9272 times)


Hi all!  :D

I recently started looking into DSP, with the long term goal to implement Impulse Responses ( in effect units. The possibilities offered by this approach are interesting for application where complex equalization is required. In particular, an IR approach is especially useful for:
- realistic cabinet simulation;
- processing of acoustic guitar sound.
There is also the case of reverbs, which I will not consider but could be a useful extension as well.

---- A bit of history ----

When playing with my electroacoustic guitar, sometimes the piezo pickup is rather annoying and I would like to have something similar to the sound of a miked guitar (aaah, the Holy Grail ...). There are 2 products on the market, which claim to convert the signal of an under saddle transducer into that of a miked instrument: the Dtar Mama Bear and the Fishman Aura. Both are probably based on convolution/deconvolution of impulse responses ... so, why not Do It Yourself? And why not do something similar for cabinet emulation?

---- Preliminary study ----

I have tested the feasibility of the project, at least for the acoustic guitar part. Here are the main steps:

1: Record the "impulse responses" of the piezo and of the mic.
In order to do this, i set up a simple rig like this:
guitar -> piezo -> pc
guitar -> stereo mics in XY configuration (Zoom H1)
Then I strummed the strings (muted by my hand) in order to create something similar to an impulse. The sound was recorded both on the PC and the Zoom simultaneously.

2: Cut the .wav files to the desired length, and try(!) to align them.
Piezo: conv2.wav - Right mic: convR.wav - Left mic: convL.wav

3: Compare the impulse responses, in order to get the filter coefficients for digital implementation
This was done through Matlab, with the stmcb function. I parametered it for calculation of a FIR filter with different taps (64 to 2048)

4: Filtering a sample piezo recording with the aforementioned filter.

---- Results of the preliminary study ----

Here is the original piezo sample file (piezo.wav), a very uninspired playing, and the filtered results with different tap sizes:

Another example:

The processed samples are pretty different than the corresponding mic recording. Furthermore, there seems to be some sort of "phasing" going on. This could be due to the imperfect alignment (done by hand) between mic and piezo IR recordings. This point should be further analyzed.

It is undeniable though, that with 512+ taps filtering, the sound acquires an interesting "acoustic quality", which can be definitely useful in live playing and can be further tailored with equalizing. Furthermore, a stereo implementation with left and right IR filtering would lead to even more realistic sounds.
Stereo example:

The next steps will involve the analysis of the origin of those pesky phasey sounds, consideration of cabinet IRs and of course attempts(!) at a hardware implementation.


Re: The IR project: acoustic guitar processing and cabinet simulation
« Reply #1 on: April 15, 2011, 06:28:18 AM »
BodiLizer does the acoustic guitar stuff too:


Re: The IR project: acoustic guitar processing and cabinet simulation
« Reply #2 on: April 15, 2011, 07:26:56 AM »
Wow, this is a really interesting project. Let us know your progress, looks promising.



Re: The IR project: acoustic guitar processing and cabinet simulation
« Reply #3 on: April 15, 2011, 07:54:07 AM »
The pesky phasey sounds may come from the physical motion of the player in relation to the (typically fixed) microphone.  You downstroke and your hand passes in front of the mic for a second.

This could probably be emulated by implementing an amplitude-dependent comb filter.


Re: The IR project: acoustic guitar processing and cabinet simulation
« Reply #4 on: April 15, 2011, 05:48:06 PM »
A Next Audio Simple DSP board would work for this project.

You can implement a large FIR (up to order of 1022) while achieving low input/output latency since the full 1022 MACs occur every sample period.  And at around 50 mA at 3.3V.

The Python code for the NextDSP board to read an input from ADC, perform an FIR and write output to DAC would look like this:

Code: [Select]
from nextdsp import *

# Coefficients for a 40th order low-pass FIR filter

fir_low_pass = [0.0] * 40

fir_low_pass [0] = -3.0725210775316527E-4
fir_low_pass [1] = -6.535045655922483E-4

... removed for brevity ...

fir_low_pass[38] = -6.535045655922483E-4
fir_low_pass[39] = -3.0725210775316527E-4

def FIR( sample_mem, filter_coef ):

    yield iPUT( sample_mem )
    yield iCM0( filter_coef[0], sample_mem )
    for i in range( 1,len(filter_coef) ):
        yield iCMA( filter_coef[i], sample_mem+i )

def Main():

    # Allocate memory for the FIR filter's sample history
    sample_memory = Alloc( len(fir_low_pass) )

    # Read sample from ADC-0 on the left channel
    yield iCM0( +1.0, 0x410 )

    # Perform FIR
    for i in FIR( sample_memory, fir_low_pass ): yield i

    # Write sample to DAC-0 on the left channel
    yield iPUT( 0x410 )
« Last Edit: April 15, 2011, 06:01:50 PM by markseel »