Skip to content

otafilter

Resonant 4pole non-linear lowpass filter.

Otafilter is a version of vclpf with non-linearities inserted in the signal path. It attempts to model the saturation behaviour of an operational transconductance amplifier (OTA), which is commonly used in the implementation of analogue filters. The filter has two outputs: the usual 4-pole output plus a tap midway through the filter structure after the second stage (a 2-pole output).

Syntax

sig4:a, sig2:a  = otafilter(in:a, cf:{a,k}, res:{a,k}, drive:k[, stor:i])
asig4,asig2 otafilter ain, xcf, xres, kdrive[, istor]

Initialization

stor --initial disposition of internal data space. Since filtering incorporates a feedback loop of previous output, the initial status of the storage space used is significant. A zero value will clear the space; a non-zero value will allow previous information to remain. The default value is 0.

Performance

sig4 -- 4-pole output

sig2 -- 2-pole output

in -- input signal.

cf -- filter cutoff frequency (a- or k-rate)

res -- resonance, between 0 and 1. Higher values will make the filter self-oscillate (a- or k-rate).

drive -- filter drive gain (0 - no drive, > 0 - increased drive)

Examples

Here is an example of the otafilter opcode. It uses the file otafilter.csd.

Example of the otafilter opcode.
<CsoundSynthesizer>
<CsOptions>
-odac -d
</CsOptions>
<CsInstruments>

0dbfs = 1
nchnls = 2

instr 1

a1 rand p4
af expon 20, p3, 20000
a2,a3 otafilter a1, af, 1.2, 1.5
   out a2, a3

endin

</CsInstruments>
<CsScore>
i1 0 15 0.5
</CsScore>
</CsoundSynthesizer>

See also

Standard Filters: Resonant Low-pass filters

Credits

Author: Victor Lazzarini
April 2024