   Amplifier Modelling
  So I've got this idea to code a DSP amplifier modeller. I have some experience writing VST plugins and know some basic DSP and was thinking about how the task would actually be broken down. On an academic level, the problem seems simple enough.There are three basic components to any guitar-amplifier. One is the preamp which both performs your distortion and applies tonal coloration via EQing, and the natural frequency response of the preamp. Another is the poweramp, which depending on whether or not it is tube, may perform some sort of compression, as well as EQing the signal further, and contributing some distortion. The final component is  the actual speaker cabinet.This is probably not original thinking on my part, but it seems like it should be relatively straightforeward to "sample" an amplifier. First, one would need to create a control input waveform for each stage in the process of modelling the amplifier. For the preamp, I think the input should be sine-waves, stepped by a fixed amount; or perhaps using a chromatic scale of notes ranging the registers of the guitar.  Recording the input, and then running a comparison should be able to create a map of how the amplitudes differ at each frequency. For each input frequency then, a voltage-map can be created to emulate the distortion at a particular gain. These values can then be tabled, and interpolated between. So now, for a given amplifier model, we have a 2D table of voltage-maps, with entries for a specific frequency, and at a specific gain. The model can be more, or less dense, in terms of the data it stores; the final DSP (VST/DX) plugin will simply interpolate between them in as close to real-time as possible.For the power-amp, two things need to be determined: the compression characteristics, and the EQ characteristcs. For determining the EQ characteristics, simply running a spectrum analysis on the output of just the power-amp (obviously, this will have to be done indepedantly of the poweramp, so a bit of desoldering might have to occur if the amplifier you want to sample doesn't have a poweramp input-jack) when fed with a white-noise input signal should give a reasonably close idea as to the output. For determining compression characteristics, I think that multiband compression would have to be used to create a fairly accurate model of what is happening to incoming signals.To "sample" this, it seems simple enough to once again, feed noise to the poweramp. However, each input signal would have to be bandwidth limited. From there, simply compare the dB output of the poweramp (this will probably have to be manually measured with a dB detection device) with the expected dB output, given that the preamp could reproduce amplitude perfectly linearily.To sample the actual cabinet; whether the amplifier is a combo or a seperate cabinet/head configuration, convolution based reverb can be apply. I've also heard effective convolution based emulation of compressors; perhaps this is a better way to approach the issue of poweramp compression. For generating impulses, either the sine-wave or starter-pistol method could be used; with the signal being run from either a known "flat" poweramp, or a poweramp that can be EQed to be reasonably flat.For the final DSP plugin/application, the following process has to be applied to an incoming signal (unprocessed guitar).Determining the Dominant FrequencyObviously an FFT must be applied here, and a dominant frequency from the spectrums input must be selected.Applying the Voltage MapAt this point, the gain paramater (as set by the user) and the dominant frequency are correlated, and a voltage-map is selected from the table of voltage-maps created in the pre-amp sampling process. Pre-Amp EQThe characteristics of the pre-amp EQ were not sampled as it seems like emulating the effects of an individual amplifiers EQ circutry is something of a waste of time and computational energy. At this stage in emulation any simple three-band EQ may be employed, or a 3-band parametric EQ with the Q paramaters previously set up by an engineer with good ears listening to the amplifier being modelled.Power-Amp EQThis is simply a case of applying the pre-analyzed EQ curve from the power-amp sampling process.Power-Amp CompressionSince the characteristics of the power-amp have already been sampled, all this step entails is applying multiband compression. The attack and release of each band's compression should be reasonably quick.Convolution ReverbSimply use convolution reverb to simulate the effects of a particular cabinet. Depending on how the convolution impulses were recordered, different impulses could be use to integrate effects such as microphone and room modelling.The Problem(s):First of all, it's going to be very time consuming to create these amplifier models. I have a couple of rack-mount tube preamps that are easy enough to sample, and a H&K preamp that reproduces guitar signals effectively, but it's going to be a huge pain in the ass to sample the characteristics of all the gear; especially considering that the whole process must be repeated for every increment of the gain knob. (Although, sampling it at 10 or so different settings should be sufficient, with interpolation dealing with the rest)Second of all: Once I've got the sample-data, and written the plugin - it's going to be a bitch to make it happen in anything resembling real-time. I may have to settle for it simply being a post-process effect applied after the guitar tracks have already been recorded with some sort of reference amp.I'm fairly serious about this though, so if anybody has any input, feel free to share it! My goal is simply to create a reasonably accurate system for amplifier modelling that will allow people to sample their own equipment and share these models with other people. This could potentially allow for a wealth of different, digital "gear" to be available to people recording guitars, and eliminate dependency on expensive amp-modelling hardware.   
  Take a look at the course notes for this Computational Electroacoustics course (and perhaps some of the textbook references mentioned). It may not have *exactly* what you're looking for, but I think you'll find the topics of great interest.   ;  Just what do you mean by "a 2D table of voltage-maps"? At first I thought it was a simple float value for every frequency and gain setting, how much the input sine wave was amplified. But then you write"a voltage-map can be created to emulate the distortion at a particular gain"which seems to indicate more than just the gain (maybe the spectrum of harmonic and non-harmonic overtones arising from a particular input sinus?)In programmatic: what datatype is a voltage-map? ;)   ;Quote:Original post by KseroJust what do you mean by "a 2D table of voltage-maps"? At first I thought it was a simple float value for every frequency and gain setting, how much the input sine wave was amplified. But then you write"a voltage-map can be created to emulate the distortion at a particular gain"which seems to indicate more than just the gain (maybe the spectrum of harmonic and non-harmonic overtones arising from a particular input sinus?)In programmatic: what datatype is a voltage-map? ;)I decided I was actually bored enough to undertake this, so here's a screenshot of my work so far:not particularily elaborate yet. But a voltage map; at least as used by several plugins, including Cyan's voltDist for Buzz, is simple a map that takes a given input amplitude, and outputs a different amplitude. It's often expressed as a spline. In that screenshot i'm trying to 'sample' one of my amps; it works okay, but the resulting output files have some noise and aliasing problems I'm going to need to track down.   ;  So you want to model an amplifier - in a high level sense? You know you could just model it properly, using the electrical characteristics of the amp? Granted, that would be more differcult, but it would be far more accurate. You don't have to go into simulating atomic components (for instance you could simulate an "op-amp", rather than the actual OTA and second stage amps), so it shouldn't be that complicated.Anyway, if you want to do it via a pure DSP system, then you need to design your filters very carefully. Designing your filters to accurately match the performance of the physical amp is going to be pretty hard, and a lot of experimental data will have to be used to deduce the respective coefficients. You may find that to get a response close to that of the real system would require a prohibitive number of coefficients. Also, remember to use decent windowing functions when performing your FFT's, otherwise you can get silly amounts of spectral leakage.   ;  If you haven't already check out The Scientist and Engineer's Guide to Digital Signal Processing.  The early chapters discuss much that you probably already know, while tha later chapters cover more specific applications domains and may offer you some insight into the problems you've listed.   ;  Sounds like a pretty daunting, but interesting project.  Sounds very much like Guitar Rig 2, or a software representation of podxt.A question though:  are you only doing dry amp modelling, or are you going to tackle effects modulation as well?Also, I think you should try and incorporate some minimum latency realtime playback if possible.  Guitar Rig pulls it off reasonably well (IMHO, I've only tinkered with it for a short time at a friend's house).  You'll lose some quality that way, but I usually like to hear what I'm playing, especially after effects/reverb/modelling has been applied.  That's one of the reasons why I really like my podxt for recording.Anyway, good luck with it!   ;  These links might help.The Fender Amp Field Guide look for "Schematics & Chassis Layouts"Schematic Heavengoogle: amplifier+schematics