Author Topic: Convolution and amp sims  (Read 12296 times)

amz-fx

Convolution and amp sims
« on: January 14, 2006, 11:19:45 AM »
If you are reading this, you probably know about convolution and impulse response...

I knew it could be used for quite convincing rverb sounds, but for some reason it did not occur to me that you could also use it for cabinet modeling...  you shoot an impulse through a guitar amp, record the impulse and use that in a convolution plug-in to alter the tone of a track to sound like the amp being modeled.

Anyone interested in this should take a ride over to:

http://www.noisevault.com/

Some free impulses: http://www.echochamber.ch/responses/index.html

And the best free convolution plug-in:  http://www.knufinke.de/sir/index_en.html

regards, Jack



R.G.

Re: Convolution and amp sims
« Reply #1 on: January 14, 2006, 11:40:30 AM »
Yeah - the convolution of an impulse response is literally the z domain time response to the instantaneous value of the signal at any given time. So if you convolve any signal against the impulse response of any network, it's the equivalent of running that signal through that network.
R.G.

Quick IQ Test: If anyone in a governmental position suspected that YOU had top-secret information on YOUR computer, how many minutes would you remain outside a jail cell?

Plectrum

  • Guest
Re: Convolution and amp sims
« Reply #2 on: January 14, 2006, 12:19:28 PM »
I use this quite a lot, I just "IR'd" my vintage G12h cab with a whole bunch of mics.
There are two main recovery methods; sending a Dirac spike* through the speakers, the resulting response sample can be loaded directly into a convoling reverb.
Using a swept sinewave, this needs to be "deconvolved" using an applet before use - but is still pretty straightforward. (voxengo do a free deconvolver)

A great spin-off is, you can "move" the room mic/s to get different phasing/space effects, just by delaying it in a multi channel convolver.

The results can be eerily realistic. (but do not replicate non-linearities, or the interaction between a poweramp and speaker)

A Dirac spike can be made by drawing a single sample from zero to full amplitude in a waveform editor.

Grant.

R.G.

Re: Convolution and amp sims
« Reply #3 on: January 14, 2006, 12:25:51 PM »
One of the fun applications of this is to put as close to an impulse as you can into a speaker and then record the resulting sound. This approximates the impulse response and this can then be converted to the frequency domain response of the speaker rather than measuring the speaker with a swept oscillator. It gets rid of room effects because there can be no standing wave interaction with the room - all the fun's over before the room can get reflections back to the speaker.
R.G.

Quick IQ Test: If anyone in a governmental position suspected that YOU had top-secret information on YOUR computer, how many minutes would you remain outside a jail cell?

Plectrum

  • Guest
Re: Convolution and amp sims
« Reply #4 on: January 14, 2006, 12:38:34 PM »
One of the fun applications of this is to put as close to an impulse as you can into a speaker and then record the resulting sound.

If I understand you right, this is the "spike" I mentioned and is the method I use.

Grant.

R.G.

Re: Convolution and amp sims
« Reply #5 on: January 14, 2006, 01:12:33 PM »
Yes, it is - but the purpose is analysis of the time response of the speaker mechanism, not the audio response. The data is then used to design enclosures.
R.G.

Quick IQ Test: If anyone in a governmental position suspected that YOU had top-secret information on YOUR computer, how many minutes would you remain outside a jail cell?

Plectrum

  • Guest
Re: Convolution and amp sims
« Reply #6 on: January 14, 2006, 01:48:00 PM »
Yes, it is - but the purpose is analysis of the time response of the speaker mechanism, not the audio response. The data is then used to design enclosures.
Ah!...Gotcha...

The other thing I'm doing, Just for curiosities sake, is to subtract an impulse from a Jazz bass pickup from a Precision, and see how close I can get to a P.bass sound using the Jazz and so have two basses :). The difficulty is getting a clean impulse into each pickup. I'm going to use a coil to "induce" the impulse (mechanical methods have been so far unimpressive).
IMHO Convolution has *huge* potential for processing ideas... Still love my stompers though.

Grant.

Transmogrifox

Re: Convolution and amp sims
« Reply #7 on: January 15, 2006, 12:02:39 AM »
Scilab is a good program to use as a platform for experimenting with convolution, granted, you need to know a little about DSP to implement it.  Scilab limits you to 16-bit .wav files, but 16 bits is probably good enough to fool most people in an A/B test with 16/21/32.  It would be hard for anybody to convince me that they can detect a difference between 21-bit and 32-bit audio, though.

What brought that up is that we used MATLAB for most of our projects in the DSP class I took at MSU and it was a very easy platform to quickly realize different filters and synthesized audio.  If you were given the impulse response as a recorded file, then not much remains but to write a convolution algorithm--which isn't too bad to do provided you understand what convolution is...and I don't suppose you would be very interested in this post if you didn't understand convolution.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

didier

Re: Convolution and amp sims
« Reply #8 on: January 15, 2006, 04:32:12 AM »
for those interested in some math:

In mathematics and in particular, functional analysis, convolution is a mathematical operator which takes two functions f and g and produces a third function that in a sense represents the amount of overlap between f and a reversed and translated version of g. A convolution is a kind of very general moving average, as one can see by taking one of the functions to be an indicator function of an interval.

http://en.wikipedia.org/wiki/Convolution

Next month i'm starting some DSP lessons  8) should be interesting...
Complete: TS-808; LPB2; Orange Squeezer; Green Ringer; Foxx Tone Machine; LM3886 PowerAmp.
To Be Completed: DOD440; Professor Tweed; LHX; Real McTube 2; Rebote 2.5 Delay; ETI MN3011 Reverb;

Eb7+9

Re: Convolution and amp sims
« Reply #9 on: January 16, 2006, 04:30:31 AM »
Yeah - the convolution of an impulse response is literally the z domain time response to the instantaneous value of the signal at any given time. So if you convolve any signal against the impulse response of any network, it's the equivalent of running that signal through that network.

... sorry, this has nothing to do with Z-domain per se and the second "any network" statement is also not true at all.  This needs to be clarified to explain what's really going on with the great emulation conspiracy ... (past this point aspirin is recommended) ...

First of all, this so-called equivalence, either taking place in the S-domain or it's digital counterpart the Z-domain, only holds for linear networks - or the linearized zero-signal equivalent of a non-linear network ... the later is what modeling DSP typically uses as a basis for modeling the general class of filter circuits (to which amplifiers belong) then adding some dynamic massaging afterwards to mask the difference in an attempt to fool the ear ... first it's linearized into the S-domain and then transferred to the Z-domain so zeros and ones can do their VLSI duty ... in a real non-linear scenario the tonal and dynamic transfers are rolled into one and both constantly change in response to varying time signals, however grossly or subtly - in the DSP modeling case they are separated at birth and then re-assembled in some serial manner ... in the later case both aspects typically occur independently while in the former they are intrinsically bundled ...

The linearized equivalent of a non-linear network is a transfer function, whether in H(s) or H(z) form, that is produced by taking a zeroing limit of the signal transfer in the small-signal sense ... whereby, all non-linearities in passive and active devices are individually approximated by the linear approximation taken around their DC operating points (similar to how AC-analysis is done in Spice) - or in another equivalent way by using other modeling functions at the design team's discretion ... note that there's no major difference between the two S-domain or Z-domain forms at that point aside from digital system artifacts caused by clock jitter, quatization and sampling imperfections, etc ... bottom line is the encoded transfer function is memoryless at that point regarless of the domain it's analogized into ...

Amplifiers and cabs are non-linear and don't have a deterministic closed form transfer function unless they are stimulated by near-zero amplitude signals ... the reason why a single function representing signal transfer in non-linear networks can't exist is because they are generally anti-causal by nature - that is, the response changes (is dependent) on recent signal activity and also varies with signal amplitude levels to stimulus (eg., impulse) ... this is the basis for defining the concepts of anti-causal transfer and of memory in Systems theory ... non-linear systems exhibit amplitude dependent memory, linear networks don't at all ... so what you're saying doesn't apply to any network ... can't blame you, basic Systems text usually doesn't really explain this well - you find this out in the field and keep quiet about it if your salary depends on it ...

If these groundless modeling claims held true then hearing-aids could be designed based on the notion of applying a pre-distorted transfer function, namely an "inverse" transfer function based on modeling of an "ear-damage" transfer function  ... in a simpler world this would be done by extracting some form of the impulse response on a good ear assuming both aren't damaged and were fairly well matched to begin with - thus in combination acting to undo ear damage effects in the bad ear ... but the ear has a non-linear response to sound, and that's why hearing-aids have a fairly ineffective purpose in the majority of bad cases ... again this is because a deterministic transfer function doesn't exist to model the damage so similarly its single deterministic inverse function can't exist ... the best DSP can do in that case is try to filter frequencies out of the range where the non-linear damage function has a stronger effect in altering sounds - that's a tonal (linear) alteration ... even in adaptive versions, those kinds that conditionally switch between different transfer functions based on sets of varying impulse responses, the effectiveness is quite limited from what I understand ...

The same applies to verb modeling depending on what you mean by convincing ... and btw, impulse response modeling of rooms is not new at all ... Plate reverbs respond very strongly to dynamics - probably the most in demand example of verb modeling ... for the same reason as stated above you cannot model the real response of a Plate reverb using impulse-response modelling ... the Plate is an extreme example - halls and rooms you might have a little more luck with since usually they're used with lower amplitude signals relatively speaking ...

This is why people with reasonably good ears still to this day bother putting their own plate systems together ... same thing applies to Leslie cabs, Magnetic Tape, Tube circuits, etc ... to those people the difference is like night and day ...

The only reason why DSP corps still try passing this stuff off is because there's enough unsuspecting people out there who will fall for the "too good to be true" marketing lingo and the added convenience of the digital control part ... at first it sounds like fun, but it doesn't take long before most get tired of it ... kinda like video games ... I say much of that has to do with the algorithmic repetitiveness of DSP systems, both at the micro and macro levels ...

All non-linear networks, through their non-memoryless nature, have the potential of adding an unpredictable "feel" which keeps the psycho-acoustic ear interested ... IMO one major reason why single-ended amplifiers hold a special interest with some players and producers ... something you don't really see occuring with DSP implementations of linearized networks - however massaged and fudged subsequently ...

... anyway, there's a mathematical wall of complexity that exists between non-linear media behavior and its impulse response form taken at rest ... the first is multi-dimensional while the later isn't ...

~jc
« Last Edit: January 16, 2006, 04:55:26 AM by Eb7+9 »

puretube

Re: Convolution and amp sims
« Reply #10 on: January 16, 2006, 05:11:11 AM »
Analog rules.

(1st Commandment of FX Design from J. Orman, May 14th, 2000)

 :icon_smile:

amz-fx

Re: Convolution and amp sims
« Reply #11 on: January 16, 2006, 08:41:35 AM »
Analog rules.

(1st Commandment of FX Design from J. Orman, May 14th, 2000)

And still true...

http://www.muzique.com/editor.htm#cmd

 :icon_mrgreen: -Jack

R.G.

Re: Convolution and amp sims
« Reply #12 on: January 16, 2006, 09:45:03 AM »
Quote
... sorry, this has nothing to do with Z-domain per se and the second "any network" statement is also not true at all.  This needs to be clarified to explain what's really going on with the great emulation conspiracy ... (past this point aspirin is recommended) ...
Good morning jc. That ulcer still bothering you?

First - no, convolution is not limited to z-domain. If you could do convolution in time domain, it would apply there, too. However, since there are no good ways to do time domain linear convolution except by building the networks and signals, and since the discussion was about sampled data streams in the first place, I figured that it would be OK to answer about sampled data.

And I think your paranoiometer may need adjustment. I don't think there's any emulation conspiracy, and I think if you'll think about it, you won't either. There isn't any grassy knoll shooter in the musical world. It's actually just economics.

We can blather about time varying nonlinear networks for a long long time, and it won't change the fact that in the real world, you actually have to build the network to get the particular time and signal varying nonlinearities. That won't change the economics that make those networks (i.e. tube amplifiers and their cabinets and speakers) any less expensive to build in today's economy. The state of the world economies in general and the electronics industry is such that while we can still build the hollow state wonders - and most old line manufacturers still do. But they're expensive.

They offer people with limited means an alternative - DSP emulation. Electronics being what it is, that's cheaper today. I don't think you'd like that alternative removed, would you?

And it's simply human nature that the people who offer DSP would talk about its advantages and how close it comes to the real thing, isn't it? If YOU had a new technology for emulating (and they do still say emulating) old-school amps, wouldn't YOU point out how close it was, not how close it wasn't?

And here's the real skinny - DSP keeps getting better. Perfect it's not - but as we get more processing power, it gets closer. And digital keeps getting cheaper. While the simple approaches to modelling time-varying nonlinear responses may not be perfect yet, it keeps getting closer. Are you going to tell us that it won't ever get to "good enough"? That would be short sighted, because it's good enough today that it has essentially wiped out the linear audio market and "digitally remastered" recordings are quite popular.

So lighten up - they're not really out to get you - they just want your money, and it's the best they can do - for now...    :icon_lol:
R.G.

Quick IQ Test: If anyone in a governmental position suspected that YOU had top-secret information on YOUR computer, how many minutes would you remain outside a jail cell?

davebungo

  • Guest
Re: Convolution and amp sims
« Reply #13 on: January 16, 2006, 02:56:50 PM »
A good debate being had here and good arguments made by jc and RG.  I think it is currently true that the likes of the Line 6 Pod etc don't quite cut it for some people but they are big sellers.  Not for me personally, I have tried a Line 6 Pod a couple of times live but couldn't get a nice sound - perhaps that's because there is so much flexibility and also perhaps I don't want to believe it will work in the first place.  In any case, it is true that these things will get better and better to the point where more and more people will be happy to use them.  I often wonder if fuzzy logic and neural processing will take a hold soon as it has in fields such as ABS (as in car braking systems) where a linear approach has been unable to do the job efficiently cost effectively.

Currently with the advent of super high performance and cheap FPGAs with onboard hardware multipliers, signal processing will and in fact is becoming more firmware based and fantastic parallel processing performance is now there for everyone to exploit (as I am doing myself).

Sir H C

Re: Convolution and amp sims
« Reply #14 on: January 16, 2006, 03:32:09 PM »
In college I had a summer job that involved sitting in a room with a speaker, a microphone, an amp, and an audio spectrum analyzer and sit there and record the frequency response of the speakers from their impulse responses.  It was boring, but in the end I could then go to a microphone and tweak the monitors by clicking into the mic.

Joe Kramer

Re: Convolution and amp sims
« Reply #15 on: January 16, 2006, 03:50:27 PM »
Analog rules.

(1st Commandment of FX Design from J. Orman, May 14th, 2000)

 :icon_smile:

On the other hand, dictatorial pronouncements do not.  :icon_wink:  Except maybe this one: If it sounds good, it is good.

Joe
« Last Edit: January 16, 2006, 03:57:07 PM by Joe Kramer »
Solder first, ask questions later.

www.droolbrothers.com

SeanCostello

Re: Convolution and amp sims
« Reply #16 on: February 07, 2006, 02:03:47 PM »
Amplifiers and cabs are non-linear and don't have a deterministic closed form transfer function unless they are stimulated by near-zero amplitude signals ...
Yeah, but how much of the nonlinear behavior in an amplifier is in the cabinet? And is it really necessary to emulate the specific cabinet behavior as part of the cabinet, or can you simply lump the nonlinear behavior as part of the amplifer model, and have a linear cabinet?

... can't blame you, basic Systems text usually doesn't really explain this well - you find this out in the field and keep quiet about it if your salary depends on it ...

Actually, your salary depends on your ability, not to create the "perfect" model, but one that is perceptually as accurate as possible, that also takes the minimum amount of computation, so that you can use a cheaper DSP, or less battery consumption, or run more instances of the plugin. It has to sound good, run in real time, and be affordable.

The same applies to verb modeling depending on what you mean by convincing ... and btw, impulse response modeling of rooms is not new at all ... Plate reverbs respond very strongly to dynamics - probably the most in demand example of verb modeling ... for the same reason as stated above you cannot model the real response of a Plate reverb using impulse-response modelling ... the Plate is an extreme example - halls and rooms you might have a little more luck with since usually they're used with lower amplitude signals relatively speaking ...

I don't think I buy this. A friend of mine implemented a plate reverb model that is very highly regarded, and I know for a fact that the reverb itself is entirely linear. The input to the reverb might get distorted, but you can say the same of any system. The plate is highly DISPERSIVE, but I doubt that it is nonlinear.

Halls and rooms are time variant, unless there is perfect temperature uniformity, and no air currents (no air conditioner, no one moving, no one breathing). The time variation makes it so that convolution may not be as useful as a recursive delay module that uses modulation. Of course, this again begs the question of what is more important perceptually for a good reverb - the specific echo and resonance pattern (that is captured well by convolution), or the slow variation of these echoes over time. Plus, the major proponents of the time variation of rooms tend to be industry people that used time variation back in the 1970's to make a small amount of delay memory sound good. Barry Blesser comes to mind - his 2002 AES article is cited when it comes to time-varying rooms, but he also developed the EMT 250 reverb in the mid-70's, which used time variation extensively.

... anyway, there's a mathematical wall of complexity that exists between non-linear media behavior and its impulse response form taken at rest ... the first is multi-dimensional while the later isn't ...

This I will agree with. However, I do think that nonlinear convolution solutions (basically crossfading between impulse responses) will work fairly well, as long as the system is feedforward only. Most guitar amps do not fit this description, hence the need for a model.

The important point, though, is what is most important perceptually? Does the cabinet mainly contribute speaker distortion, or is the frequency response the most important?

As far as the rest of this thread, spikes aren't as reliable for impulse responses. Golay codes are much better, as it is basically averaging a bunch of impulses. Plus, they sound really really neat.

Sean Costello