TK.Filter

TK.Filter provides the math for calculating a gain from a given frequency for different types of biquad filters.

Properties:
Name Type Attributes Default Description
options.type Stgring | function <optional>
"parametric"

The type of the filter. Possible values are parametric, notch, low-shelf, high-shelf, lowpass[n] or highpass[n].

options.freq Number <optional>
1000

The initial frequency.

options.gain Number <optional>
0

The initial gain.

options.q Number <optional>
1

The initial Q of the filter.

options.sample_rate Number <optional>
44100

The sample rate.

Mixes In:
Source:

Extends

Methods

freq2gain(frequency) → {number}

Returns the gain for a given frequency

Parameters:
Name Type Description
frequency number

The frequency to calculate the gain for.

Source:
Returns:

gain - The gain at the given frequency.

Type
number

Events

reset

Is fired when a filters drawing function is reset.

Source: