The Acoustic Guitar Forum

Go Back   The Acoustic Guitar Forum > General Acoustic Guitar and Amplification Discussion > Acoustic Amplification

Reply
 
Thread Tools
  #1  
Old 01-08-2020, 06:01 AM
jonfields45 jonfields45 is offline
Registered User
 
Join Date: Jun 2011
Location: Allentown, PA
Posts: 4,603
Default Acoustic Guitar Pickup to Mic IR Impulse Response Generator for Matlab,Octave,PC,Mac

EDIT: You will find up to date documentation and the ability to download the IR generation script directly on this website:

http://acousticir.free.fr/spip.php?a...ar_mode=calcul


-----------------------------------------------------------------------------------------------------------

I've generated my first IR yesterday (RainSong CH-PA/HFN) and it actually sounds good testing it with Reaper's Reaverb and the guitar sample I used to generate it (at roughly 40% IR, 60% pickup, no filtering, living room volume through my QSC CP8).

It is the same sample I sent Cuki79 to generate the IR that is loaded into my HX Stomp.

At this point the code takes a single 3 second segment from the input and calculates the IR.

To use Matlab at home a one year license is expensive for a hobbyist and the add-on's are tempting $50 bites that make writing the code a lot easier ($150 for Matlab, $50 for the Signal Processing add-on, $50 for the DSP add-on).

When the code is more full featured I will be soliciting recordings for testing and I'll return to you the IRs I generate. I want some UST samples as all my guitars are HFNs these days.

If you are curious about my progress, here are some files you can download.
__________________
jf45ir Free DIY Acoustic Guitar IR Generator
.wav file, 30 seconds, pickup left, mic right, open position strumming best...send to direct email below
I'll send you 100/0, 75/25, 50/50 & 0/100 IR/Bypass IRs
IR Demo, read the description too: https://youtu.be/SELEE4yugjE
My duo's website and my email... [email protected]

Jon Fields

Last edited by jonfields45; 03-18-2020 at 06:08 AM.
Reply With Quote
  #2  
Old 01-08-2020, 10:50 AM
Gordon Currie Gordon Currie is offline
Registered User
 
Join Date: Sep 2017
Location: Kirkland, WA USA
Posts: 2,447
Default

This is fascinating. I'd love to participate when the time comes. My guitars are all SBT though (Dazzo, Schatten, K+K).
__________________
-Gordon

1978 Larrivee L-26 cutaway
1988 Larrivee L-28 cutaway
2006 Larrivee L03-R
2009 Larrivee LV03-R
2016 Irvin SJ cutaway
2020 Irvin SJ cutaway (build thread)
K+K, Dazzo, Schatten/ToneDexter


Notable Journey website
Facebook page

Where the spirit does not work with the hand, there is no art. - Leonardo Da Vinci
Reply With Quote
  #3  
Old 01-26-2020, 03:56 PM
jonfields45 jonfields45 is offline
Registered User
 
Join Date: Jun 2011
Location: Allentown, PA
Posts: 4,603
Default

I've got my software working. Not much improvement on an HFN but it does add a little subtle value.

Here is a short recording of a friend's all plywood BC Rich acoustic with a Fishman Sonitone. I am turning my IR on/off and hopefully you can hear the difference... The IR is 50/50 mixed with the pickup. It is flat EQ with and without the IR (no low/high cut enabled in the HX Stomp IR block). The gain is down a few dB when the IR is engaged to balance the volume.

https://drive.google.com/open?id=1bf...QNghXCilYH-vRu

I'd love to spill my guts on what my code does but I'll wait to hear if anyone thinks it works first :~).
__________________
jf45ir Free DIY Acoustic Guitar IR Generator
.wav file, 30 seconds, pickup left, mic right, open position strumming best...send to direct email below
I'll send you 100/0, 75/25, 50/50 & 0/100 IR/Bypass IRs
IR Demo, read the description too: https://youtu.be/SELEE4yugjE
My duo's website and my email... [email protected]

Jon Fields

Last edited by jonfields45; 02-19-2020 at 08:10 AM.
Reply With Quote
  #4  
Old 01-27-2020, 12:19 AM
Doug Young's Avatar
Doug Young Doug Young is offline
Charter Member
 
Join Date: Apr 2005
Location: Mountain View, CA
Posts: 9,912
Default

Quote:
Originally Posted by jonfields45 View Post
I've got my software working. Not much improvement on an HFN but it does add a little subtle value.

Here is a short recording of a friend's all plywood BC Rich acoustic with a Fishman Sonitone. I am turning my IR on/off and hopefully you can hear the difference... The IR is 50/50 mixed with the pickup. It is flat EQ with and without the IR (no low/high cut enabled in the HX Stomp IR block). The gain is down a few dB when the IR is engaged to balance the volume.

https://drive.google.com/open?id=1bf...QNghXCilYH-vRu

I'd love to spill my guts on what my code does but I'll wait to hear if anyone thinks it works first :~).

Just gave this a quick listen. I'd say it's a subtle difference, but on the plus side, you do get rid of that nebulous pickup character. On the minus side, the result seems pretty thin to me, but that could be what you want?
Reply With Quote
  #5  
Old 01-27-2020, 04:07 AM
Marty C Marty C is offline
Registered User
 
Join Date: May 2015
Location: North Carolina
Posts: 1,229
Default

Quote:
Originally Posted by jonfields45 View Post
I've got my software working. Not much improvement on an HFN but it does add a little subtle value.

Here is a short recording of a friend's all plywood BC Rich acoustic with a Fishman Sonitone. I am turning my IR on/off and hopefully you can hear the difference... The IR is 50/50 mixed with the pickup. It is flat EQ with and without the IR (no low/high cut enabled in the HX Stomp IR block). The gain is down a few dB when the IR is engaged to balance the volume.

https://drive.google.com/open?id=1bf...QNghXCilYH-vRu

I'd love to spill my guts on what my code does but I'll wait to hear if anyone thinks it works first :~).
To my ears it’s more than subtle. I like that sound. Can you improve on it... maybe. But to my ears you definitely made a difference.
Reply With Quote
  #6  
Old 01-27-2020, 08:11 AM
jonfields45 jonfields45 is offline
Registered User
 
Join Date: Jun 2011
Location: Allentown, PA
Posts: 4,603
Default

If anyone is interested, you can email me a WAV file, pickup left, mic right, at least 60 seconds long, no clipping, try to not fall below 15 dB of peak on your metering, and I'll send you back a 2048 sample IR at the same sample rate as your WAV file.

At this point I am just doing math. The algorithm as implemented makes no assumptions about instruments, pickups, mics, or optimal equalization for performance or recording. It has no sound target beyond making the left channel sound like the right channel.

One thing I'm liking about this approach is so far no EQ is needed to deal with low end resonances. I sanity tested this conclusion with the same sample I sent Cuki.

I also sanity tested my code with identical recordings for pickup and mic, and produced a flat line frequency plot IR.

The links above still work for people who can read Matlab code. Everything was written to be portable to free Matlab clones (no upcharge Matlab library calls). The code that calculates minimum phase was copied off a Stanford University website (course notes – THANKS Cuki!). I can post links to that code too if anyone wants it.

--------------------------------------
Technical Overview of My Code

I am using a 44.1 kHz sample rate for my WAV files. The extra frequency content supported by DVD 48 kHz is not needed and the frequency domain calculations get wasted on more frequency bands above the guitar’s range. Cheap IR loaders run at 44.1, in time a fixed 2048 samples is longer at 44.1, and better loaders (such as my HX Stomp) can resample 44.1 to 48 on download. My code generates the IR with the same sample rate as the input WAV file.

First, I extract segments of the recorded pickup and mic. I tried 1, 2, 4, 8, and 10 segments of lengths 2^15, 2^16, 2^17, 2^18, 2^19. Too short a sample sounded not as good as longer, and after a certain point longer was not better. The math of Discrete Fourier Transforms has a nasty quantization noise problem that favors longer segments. I also found if I averaged IRs from too many segments the result was so neutral it did nothing (maybe a noise gain-up problem).

I settled on 4 segments, 2^17 (~3 seconds) long. I skip 6 seconds into the source wav file and grab a segment. I check it for clipping and having a peak less than -15 dB down from clipping. The segment is rejected for clipping or low SNR. I then skip ahead ~6 seconds and grab the next segment and repeat the clip/SNR test. I do this 4 times. For 2^17 samples the low SNR test never triggered. For shorter segments it was common. I was careful not to record anything with clipping.

Those of you who are familiar with how clipping distortion creates sharp edges and generates harmonics would probably not be surprised that taking a segment out of a longer sample does something similar at the beginning and end of the sample. A window function takes your segment and slowly raises the volume from zero and back to zero. Cuki uses a Blackman window which is not far off the original Hamming window and I also chose Blackman. The math again prefers a longer segment for less windowing harmonic generation.

Next all the segments get Discrete Fourier Transformed (FFT). The mic FFT is divided by the pickup FFT. The division results are averaged together and then an Inverse Discrete Fourier Transform (IFFT) generates the IR. I then truncate the IR to 2048 samples.

Minimum phase is an option mentioned in the ToneDexter patent and I also calculate minimum phase versions. I confirmed with frequency plots that the code works correctly. I could not hear any difference and gave up on that approach. I am thinking without the bass boost of other IRs the minimum phase version is not that important.

My one piece of unique intellectual property (as far as I know) was a “no near zero” criteria in the pickup FFT (dividing by zero is bad and the IR can’t create something from nothing). I search the pickup FFT for coefficients (frequency bands) where the magnitude is more than 65 dB down (I tried 60, 65, 75, 80 and 85) from the peak. Those coefficients get replaced with “1” in both the pickup and mic FFTs. This produces a better sounding result with a better behaved frequency plot. The ToneDexter patent refers to many trade secrets on how to choose which segments to average into the final IR and when to stop. This is my approach to that problem...pure math.

At this point I am producing IRs from four 2^17 sample segments, no near zeros with a 65 db down criteria, and no minimum phase transformation.
__________________
jf45ir Free DIY Acoustic Guitar IR Generator
.wav file, 30 seconds, pickup left, mic right, open position strumming best...send to direct email below
I'll send you 100/0, 75/25, 50/50 & 0/100 IR/Bypass IRs
IR Demo, read the description too: https://youtu.be/SELEE4yugjE
My duo's website and my email... [email protected]

Jon Fields

Last edited by jonfields45; 02-29-2020 at 01:02 PM.
Reply With Quote
  #7  
Old 01-27-2020, 08:51 AM
jonfields45 jonfields45 is offline
Registered User
 
Join Date: Jun 2011
Location: Allentown, PA
Posts: 4,603
Default

Quote:
Originally Posted by Doug Young View Post
Just gave this a quick listen. I'd say it's a subtle difference, but on the plus side, you do get rid of that nebulous pickup character. On the minus side, the result seems pretty thin to me, but that could be what you want?
One other comment, that guitar is a thin sounding all plywood instrument. I think the ideal test case would be a Sonitone in a low end solid top Martin. The mic recording from that guitar was pretty brittle sounding too.
__________________
jf45ir Free DIY Acoustic Guitar IR Generator
.wav file, 30 seconds, pickup left, mic right, open position strumming best...send to direct email below
I'll send you 100/0, 75/25, 50/50 & 0/100 IR/Bypass IRs
IR Demo, read the description too: https://youtu.be/SELEE4yugjE
My duo's website and my email... [email protected]

Jon Fields
Reply With Quote
  #8  
Old 01-27-2020, 09:20 AM
Doug Young's Avatar
Doug Young Doug Young is offline
Charter Member
 
Join Date: Apr 2005
Location: Mountain View, CA
Posts: 9,912
Default

Quote:
Originally Posted by jonfields45 View Post
One other comment, that guitar is a thin sounding all plywood instrument. I think the ideal test case would be a Sonitone in a low end solid top Martin. The mic recording from that guitar was pretty brittle sounding too.
I'm happy to send you a few pickup/guitar recordings to try your process on, I'll try to package up something later today.
Reply With Quote
  #9  
Old 01-27-2020, 11:44 AM
Cuki79 Cuki79 is offline
Registered User
 
Join Date: Feb 2012
Location: France
Posts: 3,008
Default

What's surprising in JonFields45 algorithm is the modest bass boost he gets. Especially compared to my recipe and I guess against TD.

We know that IR making usually induces a bass boost (see TD patent). I think it is due to the lack of sensing of the pickup for the soundhole resonance which is more an "air thing" and due to the IR trying to compensate.

On the other side, IRs you find on the internet are usually lighter in bass than the one made with my recipe.

It would be cool, if Jon add a variable that counts how many time the "near-zero correction" is used for each frequency bin.

My idea is the following:
1) In my algorithm, there is no "near-zero correction" if the pickup signal is "near-zero" and the mic signal is present.

It means that at each stroke, when the soundhole "woofes" at 80Hz and the mic senses that, my program will add a huge bass boost to try to amplify a near-zero pickup signal around 80Hz.

2) In Jon's algorithm, there is a "near-zero correction". It means that at each stroke, when the soundhole "woofes", the program will sens the "woof" on the mic but also a "near-zero" signal from the pickup.

It will then avoid set the gain at 80Hz to 0dB (that the "near-zero correction")

Jon: I think I am going to steal that idea ...But will apply it just below 150 Hz.
__________________
Martin 00-18V Goldplus + internal mic (2003)
Martin OM-28V + HFN + internal mic (1999)
Eastman E6OM (2019) Trance Audio Amulet
Yamaha FGX-412 (1998)

Gibson Les Paul Standard 1958 Reissue (2013)
Fender Stratocaster American Vintage 1954 (2014)
http://acousticir.free.fr/
Reply With Quote
  #10  
Old 01-27-2020, 12:51 PM
Doug Young's Avatar
Doug Young Doug Young is offline
Charter Member
 
Join Date: Apr 2005
Location: Mountain View, CA
Posts: 9,912
Default

Emailed you a sample file.
Reply With Quote
  #11  
Old 01-27-2020, 02:02 PM
Cuki79 Cuki79 is offline
Registered User
 
Join Date: Feb 2012
Location: France
Posts: 3,008
Default

By the way, JonFields45 and I are building a website dedicated to acoustic Guitar IRs.

We will also build a Free IR database.
__________________
Martin 00-18V Goldplus + internal mic (2003)
Martin OM-28V + HFN + internal mic (1999)
Eastman E6OM (2019) Trance Audio Amulet
Yamaha FGX-412 (1998)

Gibson Les Paul Standard 1958 Reissue (2013)
Fender Stratocaster American Vintage 1954 (2014)
http://acousticir.free.fr/
Reply With Quote
  #12  
Old 01-28-2020, 04:01 PM
Doug Young's Avatar
Doug Young Doug Young is offline
Charter Member
 
Join Date: Apr 2005
Location: Mountain View, CA
Posts: 9,912
Default

It's cool to see people experimenting with this stuff, and both Jon and Cuki are doing some great work. I sent Jon a pickup/mic example to use to see what his process would do with a different guitar. The results are quite interesting. I loaded his IR into my TwoNotes IR pedal and recorded directly from my pedal board:

Here's an initial comparison of 1) the raw pickup, 2) Jon's process, and 3) ToneDexter (Character 2), just for comparison:



To my ear, Jon's is much more mic-like than the pickup, but does have those "resonances" that we often hear with IRs, and that may cause issues at volume, and sound a bit distant as well.

Looking at the waveforms is also interesting. Here's the waveforms for the above three samples:

Picup_IR_TD.jpg

(The waveforms look stereo but they're actually mono - dual mono with the same thing on both sides)

Notice how different Jon's IR looks compared to either the pickup or ToneDexter. In fact, it looks a lot like the pure mic looks:

Mic.jpg

BTW, I always find mono mic recordings to sound "washy" as well, so I think to some extent, Jon's approach is kind of capturing what's there. ToneDexter on the other hand must be doing some more interesting things to keep the pickup from sounding so distant. BTW, the above example for ToneDexter is the full Character 2 setting, no blend, so this is a setting that some people think is "too much", tho it usually sounds just fine to me.

I decided to see if I could do a blend with Jon's IR to reduce the resonances. Here's an IR that is basically a 50% blend (The Two Notes pedal lets me load 2 IRs and blend them):



Seems much better to me, and pretty usable as a live sound, I suspect (tho I've only listened to these at home). To the extent that the visual of the waveform tells us anything, here's how the 50/50 blend looks:

50_50_Blend.jpg

After sharing these with Jon, Cuki and he consulted, and Jon used Cuki's software to generate an IR for me, from the same inputs. Here's how that sounds:



I think this one sounds pretty good.

Finally, for a slightly more real-world test, here's how I'd actually use any of these. I always blend in a mic, so here's the direct output of my pedal board with the IRs (Jon's 50/50 blend, Cuki's IR, ToneDexter CH2) with the internal mic added and using my Sunnaudio preamp. There's some subtle interaction going on between these IRs and my mic, probably due to phase differences, and also that the basic IRs may not be precisely level-matched in the pedal board, so the mic/pickup balance varies a little bit.



These are all just "at home", direct recordings, of course, so they might behave a bit different thru a PA, tho in my experience using ToneDexter I've not heard a big difference. As long as the PA is decent, this (the TD snippet) is the sound I hear.
Reply With Quote
  #13  
Old 01-29-2020, 08:56 PM
jonfields45 jonfields45 is offline
Registered User
 
Join Date: Jun 2011
Location: Allentown, PA
Posts: 4,603
Default

Hi Doug, I wanted to thank you for taking the time to put together such a professional evaluation! Jon
__________________
jf45ir Free DIY Acoustic Guitar IR Generator
.wav file, 30 seconds, pickup left, mic right, open position strumming best...send to direct email below
I'll send you 100/0, 75/25, 50/50 & 0/100 IR/Bypass IRs
IR Demo, read the description too: https://youtu.be/SELEE4yugjE
My duo's website and my email... [email protected]

Jon Fields
Reply With Quote
  #14  
Old 01-29-2020, 11:13 PM
Doug Young's Avatar
Doug Young Doug Young is offline
Charter Member
 
Join Date: Apr 2005
Location: Mountain View, CA
Posts: 9,912
Default

Quote:
Originally Posted by jonfields45 View Post
Hi Doug, I wanted to thank you for taking the time to put together such a professional evaluation! Jon
Thanks for all your work doing this! I just enjoy experimenting and checking out the progress that everyone's making on this front. Hope you keep chasing it down!
Reply With Quote
  #15  
Old 01-30-2020, 07:38 AM
jonfields45 jonfields45 is offline
Registered User
 
Join Date: Jun 2011
Location: Allentown, PA
Posts: 4,603
Default

EDIT - The more user friendly code for the free Octave math software environment is complete and here is the thread with the instructions and links:

https://www.acousticguitarforum.com/...d.php?t=571361

IMO at this point in time, the IR loaders available are too focused on electric guitar cabinet emulation. The ones with 2048 sample capability and 3rd party IR support are also expensive and not that far off the price of a ToneDexter (which does a great job, is a full featured preamp, and is an excellent physical design which is not always the case at its price point).

If you are in the subset of performing guitarists who care about this detail of tone and are using a high end general purpose pedal (like my HX Stomp), then independent IR generation is really nice and what motivated me to give it a try. I think Audio Sprockets ought to provide direct support for wave file generation of IRs created on ToneDexter. I don't think it would cannibalize the market for their pedal. I see it like Microsoft Office on a MAC.

I think over the next year, pedals in the Zoom G1four and A1four price class will integrate IR loaders. A G1four with an IR loader would be a very powerful solution. At that price point what I think my IR does best, take a factory guitar UST to the next level, starts to make sense for a broad set of guitarists.

Cuki and I are still ahead of the market...

Since I'm still retired :~), I am going to port my code to Octave and get it into a user friendly state.
  • No input arguments besides wave file name.
  • A control loop to keep it going if it needs to check a little more input sample to work up the 4 segments that seems to work best.
  • A second 50/50 IR output for IR loaders with no mix control.
  • Instructions on how to install Octave (free), my IR generation scripts for Octave, and how to run them.
I titled this thread for the Google crawler hoping to find that greater but limited audience that might be interested. I am thinking a new thread with a more AGF inviting title might make sense when this new version is done.
__________________
jf45ir Free DIY Acoustic Guitar IR Generator
.wav file, 30 seconds, pickup left, mic right, open position strumming best...send to direct email below
I'll send you 100/0, 75/25, 50/50 & 0/100 IR/Bypass IRs
IR Demo, read the description too: https://youtu.be/SELEE4yugjE
My duo's website and my email... [email protected]

Jon Fields

Last edited by jonfields45; 02-07-2020 at 09:54 AM.
Reply With Quote
Reply

  The Acoustic Guitar Forum > General Acoustic Guitar and Amplification Discussion > Acoustic Amplification

Thread Tools





All times are GMT -6. The time now is 07:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright ©2000 - 2022, The Acoustic Guitar Forum
vB Ad Management by =RedTyger=