Skip to content

atonela

A look-ahead first-order high-pass filter equivalent to atone.

atonela is the high-pass complement of tonela. For a constant cutoff it matches atone within floating-point rounding, without adding latency. Its output is the input signal minus the low-pass output of tonela:

ahp = xn - yn

where yn is the look-ahead low-pass result used by tonela. As with atone, power scaling is not normalized, so parallel matching tonela and atonela outputs add back to the original signal.

Syntax

ares = atonela(asig, khp [, iskip])
ares atonela asig, khp [, iskip]

Initialization

iskip (optional, default=0) -- 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

ares -- the output signal at audio rate.

asig -- the input signal at audio rate.

khp -- the response curve's half-power point, in Hertz. Half power is defined as peak power divided by two, corresponding to peak amplitude divided by the square root of two. The cutoff is k-rate.

atonela uses the same four-sample look-ahead form as tonela and subtracts its low-pass output from the input. It therefore tracks atone within floating-point rounding for a constant cutoff and adds no latency. When khp changes, the direct recurrence is used for four samples before the look-ahead form resumes.

The look-ahead form performs more arithmetic per sample than atone, since each output is formed from four input taps and one delayed output. It is intended for situations where the four independent samples can be processed efficiently in parallel.

Examples

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

Example of the atonela opcode.
<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac     ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o atonela.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

instr 1

asig rand 1
     outs asig, asig
endin

instr 2

asig rand 1
khp  init 4000
asig atonela asig, khp
     outs asig, asig
endin

</CsInstruments>
<CsScore>

i 1 0 2
i 2 2 2
e

</CsScore>
</CsoundSynthesizer>

See also

Standard filters: Hi-pass filters

Credits

Author: Victor Lazzarini
Ireland

New in Csound version 7.0