tone

tone — A first-order recursive low-pass filter with variable frequency response.

Description

A first-order recursive low-pass filter with variable frequency response.

tone is a 1 term IIR filter. Its formula is:

yn = c1 * xn + c2 * yn-1

where

  • b = 2 - cos(2 π hp/sr);

  • c2 = b - sqrt(b2 - 1.0)

  • c1 = 1 - c2

Syntax

ares tone 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 audio signal.

asig -- the input audio signal.

khp -- the response curve's half-power point, in Hertz. Half power is defined as peak power / root 2.

tone implements a first-order recursive low-pass filter in which the variable khp (in Hz) determines the response curve's half-power point. Half power is defined as peak power / root 2.

See Also

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