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