[linux-audio-dev] Re: Cheby amp code

Steve Harris S.W.Harris at ecs.soton.ac.uk
Mon Nov 4 11:05:01 UTC 2002


On Mon, Nov 04, 2002 at 02:42:49 +0000, Steve Harris wrote:
> I think its probably worth a try with saws, at least it will make
> extracting the transfer function simpler. I will try playing with
> extracting a transfer function from a known nonlinear process and see how
> much the phase shift messes it up.

This is actualy looking quite promising, you have to discard the transient
zero crossing of the saw wave and a few dB either side (the filtering
messes it up too much), but that is not a problem, you just overshoot the
desired input amplitude by a few dB.

I've attached some example code that generates a saw wave (p), applies a
nonlinear function (x, p^2 * 0.3 + p^3 * 0.73 - p^5 * 0.1), a highpass
filter and a delay (about 16.1 samples), then puts the transfer function
into a table (ignoring the delay). It can guess the correct input/output
alignment by looking at the shape of the out-of-sync transfer function.

There is an example here: http://plugin.org.uk/tmp/foo.png

The red line is the derived transfer function and the green line is the
actual function. They only really differ by amplitude (due to the filter)
and a bit of noise (cos of small input set, ~100ms at 44.1).

The code is in http://plugin.org.uk/tmp/foo.c but its not pretty.

- Steve



More information about the Linux-audio-dev mailing list