tone — A first-order recursive low-pass filter with variable frequency response.
A first-order recursive low-pass filter with variable frequency response.
tone is a 1 term IIR filter. Its formula is:
y_{n} = c1 * x_{n} + c2 * y_{n-1}
where
b = 2 - cos(2 π hp/sr);
c2 = b - sqrt(b^{2} - 1.0)
c1 = 1 - c2
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.
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.