DSPRelated.com
Forums
Online · Live + on demand
February 9-11, 2027
Price goes up Jan 1: register now to lock in today's rate
Register Now →

using DSP to duplicate an analong systems response

Started by Mook Johnson ●June 10, 2005
"Mook Johnson" <love2tha9s@yahoo.com> wrote in message 
news:1118412011.858530.90110@o13g2000cwo.googlegroups.com...
> I'd like to copy the sonic signiture of some analog distortion circuits > (guitar effects) and have them all avaliable in a DSP so they can be > selected, mixed, modified (filtered) etc. > > I'd like for the DSP to take in the "clean" signal fron a guitar and > output a signal distorted the same way the modeled circuit would have. > > How would I go about modeling the analog response into something I can > used the DSP to duplicate? > > Tricky part is that the distortion products will be dependant on > amplitude. > > Let say you want a DSP to model the output of a saturating transformer. > at low amplitudes, its linear but near and in saturation, it adds > harmonics to the output. > > I do have experience with FIR, IIR, FFT and IFFT design work. > > I wonder if some kind of kermal could be created from the circuits > impulse response to covolve with the input signal, similar to an FIR > filter? To do the amplitude dependance, a family of coefficents would > be need and selected dependant on the signal amplitude. sounds brute > force to me. > > any ideas?
You might think of your objective as being met by the solution of a system of nonlinear difference equations. In the simulation world that would be the same as a solution of nonlinear differential equations using digital computers. This is the same as doing circuit dynamic time domain analysis. Thus, the signals are discrete in time in order to approximate the continuous signals. Typically the sample rate would be high in comparison to most DSP applications and even higher than might be typical for control system implementations - maybe 20 samples per period for the major periodic components. Often, simulations have time step adjustments so they can progress more rapidly. But, in a real-time simulation it's more likely to keep the time step and computational load per unit time fixed. Let's say that you have a filter with the following response: y(nT)=2*x(nT) + x[(n-1)T]^2 + ...... Depending on the amplitude of x, the resulting y varies in terms of spectral content. So, it's not so useful to think about the frequency domain up front - except for maybe selecting the sample rate / time step as others have mentioned already. Overkill is easier. Note the last term where it appears the "coefficient" for x[(n-1)T] appears to be x[(n-1)T] ... very data dependent! It's well known that "stiff" systems require small time steps and more computing per unit time. That's because their response to an impulse or step input is very sharp. In contrast, a softer system might be simulated with larger time steps because the states don't change very rapidly under any circumstances. Stay in the time domain and simulate the nonlinearities with good fidelity. Notice that instead of creating a family of system coefficients that depend on the input amplitude, it's perhaps better to simply compute the system coefficients at each step depending on the input *and* the system states. Fred
On 10 Jun 2005 12:43:33 -0700, "Mook Johnson" <love2tha9s@yahoo.com>
wrote:

>Thanks, > >I definately plan to sample at at least 44kHz with antialias filters to >minimize aliasing. > >According to the musician the way he sets it up his black box it sounds >"grundgy" at low and high volumes. > >I've been reading the sicentist and engineers guide to DSP and section >5 on decomposition and superposition seem closely related to what i'm >trying to do. > >Any idea for measuring the black box impulse response in the lab. >input a step and take the derivative (AC couple) the output?
I don't think impulse response will get you anything but possibly tone control/EQ response after the distortion. Any tone control/EQ before the distortion will mess with the impulse and cause inaccurate results Put a triangle wave into the unit, have any tone controls set flat or on bypass, and look at the output with an oscilloscope, DSO or audio recording software. You may need to do this with several amplitudes. ----- http://mindspring.com/~benbradley

Mook Johnson wrote:

> How would I go about modeling the analog response into something I can > used the DSP to duplicate?
I suggest that you google on "volterra series", a general theory for modeling mixed linear and non-linear boxes. Not easy stuff and pretty heavy computationally. Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein
Since your original system is analog, I doubt it has a "memory". If you can
do a frequency and amplitude sweep you should be able to get a Bode Plot
and from that extract the transfer function. You can then implement the
same H(s) in your DSP.


		
This message was sent using the Comp.DSP web interface on
www.DSPRelated.com
correlious wrote:
> Since your original system is analog, I doubt it has a "memory". If you can > do a frequency and amplitude sweep you should be able to get a Bode Plot > and from that extract the transfer function. You can then implement the > same H(s) in your DSP.
A Bode plot of a nonlinear system? Not really. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Oops. Missed that little tidbit. Thanks for the heads up Jerry!

Re distortion level vs amplitude, I did try an interesting distortion effect
based on the the nth root of the input signal.  Negative values were
inverted, rooted and reverted in the normal fashion.

The distortion was constant for all signal amplitudes.  As a note faded, it
maintained waveform shape.

The value of n was created from a DC pot reading (0...0.9999999), scaled up
by (a useful max of) 3, offset by +1 & then used in the signal processing.

At low values of n, a sine wave becomes "circularised" & has a nice soft
graunchy sound for guitar chords.  Because full clipping never occurs, you
can discern the notes comprising the chord, as the intermod is less savage
than a simple clipper.

It was neat watching a sine wave morph into a round-shouldered square wave
while gently sliding the "n" (distortion factor) pot up.

Values of n above 3...4 produced intolerable noise during instrument
silence, but amazing Gary Moore "Still got the blues" sustain.  Noise gating
helps a little, but the square root transfer function slope is near vertical
around 0.0 input, & even 1 bit of noise gets dragged up into audibility.

Values of n less than one gave the sine wave a sharp central peak.  This was
less useful musically as it inherently has "anti-sustain".

I am wondering if there is a math function that limits the slope around 0.0
to something reasonable, as this would inprove the noise situation.

Jim Adamthwaite


Jim Adamthwaite wrote:
> Re distortion level vs amplitude, I did try an interesting distortion effect > based on the the nth root of the input signal. Negative values were > inverted, rooted and reverted in the normal fashion.
For n an odd integer, the two inversions aren't necessary.
> > The distortion was constant for all signal amplitudes. As a note faded, it > maintained waveform shape.
How is that possible? Any non-linear transfer function can be approximated by a power series consisting of a linear term and higher powers. As the amplitude diminishes, the significance of higher-power terms diminishes, until for very small amplitudes, the transfer function is effectively linear.
> The value of n was created from a DC pot reading (0...0.9999999), scaled up > by (a useful max of) 3, offset by +1 & then used in the signal processing. > > At low values of n, a sine wave becomes "circularised" & has a nice soft > graunchy sound for guitar chords. Because full clipping never occurs, you > can discern the notes comprising the chord, as the intermod is less savage > than a simple clipper. > > It was neat watching a sine wave morph into a round-shouldered square wave > while gently sliding the "n" (distortion factor) pot up. > > Values of n above 3...4 produced intolerable noise during instrument > silence, but amazing Gary Moore "Still got the blues" sustain. Noise gating > helps a little, but the square root transfer function slope is near vertical > around 0.0 input, & even 1 bit of noise gets dragged up into audibility.
Sure. It's a parabola opening to the left.
> Values of n less than one gave the sine wave a sharp central peak. This was > less useful musically as it inherently has "anti-sustain". > > I am wondering if there is a math function that limits the slope around 0.0 > to something reasonable, as this would inprove the noise situation.
With your double inversion process, the parabola is similar in a general way to arcsinh(x) except your curve has infinite slope at the origin and a discontinuous derivative there. If arcsinh has too little slope for you, you could add a root to it. Odd roots, while vertical at the origin, have continuous derivatives there. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;