utils/biquad

This module contains functions for deadling with biquad filters and also implementation of common filters. The formulae for 'standard' biquad filter coefficients are taken from "Cookbook formulae for audio EQ biquad filter coefficients" by Robert Bristow-Johnson.

Source:

Members

(static, constant) StandardBiquadFilters

Source:
Properties:
Name Type Description
null Filter~filter_factory

The trivial filter, which does not change the gain.

parametric Filter~filter_factory

Peaking.

notch Filter~filter_factory

Notch.

low-shelf Filter~filter_factory

LowShelf.

high-shelf Filter~filter_factory

HighShelf.

lowpass1 Filter~filter_factory

LowPass1.

lowpass2 Filter~filter_factory

LowPass2.

lowpass3 Filter~filter_factory

LowPass3.

lowpass4 Filter~filter_factory

LowPass4.

highpass1 Filter~filter_factory

HighPass1.

highpass2 Filter~filter_factory

HighPass2.

highpass3 Filter~filter_factory

HighPass3.

highpass4 Filter~filter_factory

HighPass4.

A set of standard filters.

Methods

(static) BiquadFilter(…transforms) → {EqFilter}

Source:

This function can be used to turn a series of biquad filter transformations into an object which implements the EqFilter interface. In other words, this method will calculate the frequency response of generic biquad filters based on their biquad coefficients.

Parameters:
Name Type Attributes Description
transforms function <repeatable>

The list of biquad transformations. Each of these functions is expected to implement the BiquadTransform interface.

Returns:
  • The filter object.
Type
EqFilter

(static) HighPass1()

Source:
Implements:
  • BiquadTransform

This is a standard highpass filter with transfer function H(s) = s/(1+s).

(static) HighPass2()

Source:
Implements:
  • BiquadTransform

(static) HighPass4()

Source:
Implements:
  • BiquadTransform

(static) HighShelf()

Source:
Implements:
  • BiquadTransform

High-Shelf filter.

(static) LowPass1()

Source:
Implements:
  • BiquadTransform

This is a standard lowpass filter with transfer function H(s) = 1/(1+s).

(static) LowPass2()

Source:
Implements:
  • BiquadTransform

(static) LowPass4()

Source:
Implements:
  • BiquadTransform

(static) LowShelf()

Source:
Implements:
  • BiquadTransform

Low-Shelf filter.

(static) Notch()

Source:
Implements:
  • BiquadTransform

Notch filter.

(static) Null()

Source:
Implements:
  • BiquadTransform

Trivial filter.

(static) Peaking()

Source:
Implements:
  • BiquadTransform

Peak filter.

Type Definitions

BiquadTransform(options) → {Object}

Source:
Parameters:
Name Type Description
options Object

The filter parameters.

Properties
Name Type Description
freq number

The current frequency, i.e. the x position in the equalizer graph.

gain number

The current gain, i.e. the y position in the equalizer graph.

q number

The Q of the filter, i.e. the z position in the equalizer graph.

sample_rate number

The sample rate.

Returns:
  • An object containing the biquad coefficients a0, a1, a2, b0, b1, b2 and the sample rate sample_rate.
Type
Object