[sdiy] tanh distortion in a filter
Richie Burnett
rburnett at richieburnett.co.uk
Thu Aug 11 14:14:26 CEST 2011
> Can I just ask if there's anything particularly special about tanh
> in this situation?
The hyperbolic-tangent function comes from the large-signal transfer function of
the long-tailed-pair differential amplifier at the heart of either an OTA or the
moog ladder filter. If I remember correctly it results from the combination of
the exponential functions from the two transistor's Ebbers Moll models?
Regarding, whether there is anything special about it... It is special because
it is mathematically correct, but might be overkill depending on what you're
actually trying to achieve. For instance a well designed analogue filter will
likely have signal levels entering the OTAs that are not hot enough to cause
gross distortion. Therefore there is little to be gained by modelling the
outlying regions of the tanh function where the gradient is almost flat, if it
is never going to be driven with a signal hot enough to get into this area! On
the other hand if an authentic "thrashed-filter" overdrive sound is what you're
after then you'ld probably better model the tanh over a much larger range with
good conformity.
> It seems to me that you could use pretty much any sigmoid function...
You can, with varying degrees of success, but it depends what you're using it to
achieve. Are you trying to stabilise the self-oscillation point of a filter,
limit the dynamic range of the filter input or output, or maybe introduce some
harmonics for a warmer sound? Maybe all three?
> The reason I ask is that tanh isn't exactly a convenient function to
> calculate in the digital domain. The two approaches I've seen are to
> approximate it using a fairly simple polynomial (use a different function,
> essentially) or to use a lookup+interp (which opens the way to arbitrary
> distortion flavours).
Yes, both are well-suited techniques. With the final choice most likely
depending on available memory for LUT vs speed of calculating polynomials in
Horner form.
-Richie,
More information about the Synth-diy
mailing list