atone
Prev | Orchestra Opcodes and Operators | Next

## atone

atone — A hi-pass filter whose transfer functions are the complements of the tone opcode.

## Description

A hi-pass filter whose transfer functions are the complements of the tone opcode.

## Syntax

    ares atone 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 / root 2.

atone is a filter whose transfer functions is the complement of tone. atone is thus a form of high-pass filter whose transfer functions represent the “filtered out” aspects of their complements. However, power scaling is not normalized in atone but remains the true complement of the corresponding unit. Thus an audio signal, filtered by parallel matching tone and atone units, would under addition simply reconstruct the original spectrum.

This property is particularly useful for controlled mixing of different sources (see lpreson). Complex response curves such as those with multiple peaks can be obtained by using a bank of suitable filters in series. (The resultant response is the product of the component responses.) In such cases, the combined attenuation may result in a serious loss of signal power, but this can be regained by the use of balance.

## Examples

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

Example 43. Example of the atone opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

    <CsoundSynthesizer>
    <CsOptions>
    ; Select audio/midi flags here according to platform
    ; Audio out   Audio in    No messages
    -odac           -iadc     -d     ;;;RT audio I/O
    ; For Non-realtime ouput leave only the line below:
    ; -o atone.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

    ; Initialize the global variables.
    sr = 22050
    kr = 2205
    ksmps = 10
    nchnls = 1

    ; Instrument #1 - an unfiltered noise waveform.
    instr 1
      ; Generate a white noise signal.
      asig rand 20000

      out asig
    endin

    ; Instrument #2 - a filtered noise waveform.
    instr 2
      ; Generate a white noise signal.
      asig rand 20000

      ; Filter it using the atone opcode.
      khp init 2000
      afilt atone asig, khp

      ; Clip the filtered signal's amplitude to 85 dB.
      a1 clip afilt, 2, ampdb(85)
      out a1
    endin

    </CsInstruments>
    <CsScore>

    ; Play Instrument #1 for two seconds.
    i 1 0 2
    ; Play Instrument #2 for two seconds.
    i 2 2 2
    e

    </CsScore>
    </CsoundSynthesizer>

## See Also

areson, aresonk, atonek, port, portk, reson, resonk, tone, tonek

Prev | Up | Next
aresonk | Home | atonek