The BiquadFilterNode interface represents a simple low-order filter, and is created using the AudioContext.createBiquadFilter() method. It is an AudioNode that can represent different kinds of filters, tone control devices, and graphic equalizers.

Documentation BiquadFilterNode by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See also:

Constructor

new(context:BaseAudioContext, ?options:Null<BiquadFilterOptions>)

Throws:

null

DOMError

Variables

read onlyQ:AudioParam

Is an a-rate AudioParam, a double representing a Q factor, or quality factor.

read onlydetune:AudioParam

Is an a-rate AudioParam representing detuning of the frequency in cents.

read onlyfrequency:AudioParam

Is an a-rate AudioParam, a double representing a frequency in the current filtering algorithm measured in hertz (Hz).

read onlygain:AudioParam

Is an a-rate AudioParam, a double representing the gain used in the current filtering algorithm.

type:BiquadFilterType

Is a string value defining the kind of filtering algorithm the node is implementing.
 

The meaning of the different parameters depending of the type of the filter (detune has the same meaning regardless, so isn't listed below)

	<tr>
		<code>type</code>
		Description
		<code>frequency</code>
		<code>Q</code>
		<code>gain</code>
	</tr>


	<tr>
		<code>lowpass</code>
		<td>Standard second-order resonant lowpass filter with 12dB/octave rolloff. Frequencies below the cutoff pass through; frequencies above it are attenuated.</td>
		<td>The cutoff frequency.</td>
		<td>Indicates how peaked the frequency is around the cutoff. The greater the value is, the greater is the peak.</td>
		<td>Not used</td>
	</tr>
	<tr>
		<code>highpass</code>
		<td>Standard second-order resonant highpass filter with 12dB/octave rolloff. Frequencies below the cutoff are attenuated; frequencies above it pass through.</td>
		<td>The cutoff frequency.</td>
		<td>Indicates how peaked the frequency is around the cutoff. The greater the value, the greater the peak.</td>
		<td>Not used</td>
	</tr>
	<tr>
		<code>bandpass</code>
		<td>Standard second-order bandpass filter. Frequencies outside the given range of frequencies are attenuated; the frequencies inside it pass through.</td>
		<td>The center of the range of frequencies.</td>
		<td>Controls the width of the frequency band. The greater the <code>Q</code> value, the smaller the frequency band.</td>
		<td>Not used</td>
	</tr>
	<tr>
		<code>lowshelf</code>
		<td>Standard second-order lowshelf filter. Frequencies lower than the frequency get a boost, or an attenuation; frequencies over it are unchanged.</td>
		<td>The upper limit of the frequencies getting a boost or an attenuation.</td>
		<td>Not used</td>
		<td>The boost, in dB, to be applied; if negative, it will be an attenuation.</td>
	</tr>
	<tr>
		<code>highshelf</code>
		<td>Standard second-order highshelf filter. Frequencies higher than the frequency get a boost or an attenuation; frequencies lower than it are unchanged.</td>
		<td>The lower limit of the frequencies getting a boost or an attenuation.</td>
		<td>Not used</td>
		<td>The boost, in dB, to be applied; if negative, it will be an attenuation.</td>
	</tr>
	<tr>
		<code>peaking</code>
		<td>Frequencies inside the range get a boost or an attenuation; frequencies outside it are unchanged.</td>
		<td>The middle of the frequency range getting a boost or an attenuation.</td>
		<td>Controls the width of the frequency band. The greater the <code>Q</code> value, the smaller the frequency band.</td>
		<td>The boost, in dB, to be applied; if negative, it will be an attenuation.</td>
	</tr>
	<tr>
		<code>notch</code>
		<td>Standard notch filter, also called a band-stop or band-rejection filter. It is the opposite of a bandpass filter: frequencies outside the give range of frequencies pass through; frequencies inside it are attenuated.</td>
		<td>The center of the range of frequencies.</td>
		<td>Controls the width of the frequency band. The greater the <code>Q</code> value, the smaller the frequency band.</td>
		<td>Not used</td>
	</tr>
	<tr>
		<code>allpass</code>
		<td>Standard second-order allpass filter. It lets all frequencies through, but changes the phase-relationship between the various frequencies.</td>
		<td>The frequency with the maximal group delay, that is, the frequency where the center of the phase transition occurs.</td>
		<td>Controls how sharp the transition is at the medium frequency. The larger this parameter is, the sharper and larger the transition will be.</td>
		<td>Not used</td>
	</tr>

Methods

getFrequencyResponse(frequencyHz:Float32Array, magResponse:Float32Array, phaseResponse:Float32Array):Void

From the current filter parameter settings this method calculates the frequency response for frequencies specified in the provided array of frequencies.

Inherited Variables

Defined by AudioNode

channelCount:Int

Represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to any inputs to the node. Its usage and precise definition depend on the value of AudioNode.channelCountMode.

channelCountMode:ChannelCountMode

Represents an enumerated value describing the way channels must be matched between the node's inputs and outputs.

channelInterpretation:ChannelInterpretation

Represents an enumerated value describing the meaning of the channels. This interpretation will define how audio up-mixing and down-mixing will happen.

The possible values are "speakers" or "discrete".

read onlycontext:BaseAudioContext

Returns the associated BaseAudioContext, that is the object representing the processing graph the node is participating in.

read onlynumberOfInputs:Int

Returns the number of inputs feeding the node. Source nodes are defined as nodes having a numberOfInputs property with a value of 0.

read onlynumberOfOutputs:Int

Returns the number of outputs coming out of the node. Destination nodes — like AudioDestinationNode — have a value of 0 for this attribute.

Inherited Methods

Defined by AudioNode

@:value({ output : 0 })connect(destination:AudioParam, output:Int = 0):Void

@:value({ input : 0, output : 0 })connect(destination:AudioNode, output:Int = 0, input:Int = 0):AudioNode

Allows us to connect the output of this node to be input into another node, either as audio data or as the value of an AudioParam.

Throws:

null

DOMError

disconnect(destination:AudioParam, output:Int):Void

disconnect():Void

disconnect(output:Int):Void

disconnect(destination:AudioNode):Void

disconnect(destination:AudioNode, output:Int):Void

disconnect(destination:AudioNode, output:Int, input:Int):Void

disconnect(destination:AudioParam):Void

Allows us to disconnect the current node from another one it is already connected to.

Throws:

null

DOMError

Defined by EventTarget

addEventListener(type:String, listener:Function, ?options:EitherType<AddEventListenerOptions, Bool>, ?wantsUntrusted:Bool):Void

addEventListener(type:String, listener:EventListener, ?options:EitherType<AddEventListenerOptions, Bool>, ?wantsUntrusted:Bool):Void

Register an event handler of a specific event type on the EventTarget.

Throws:

null

DOMError

dispatchEvent(event:Event):Bool

Dispatch an event to this EventTarget.

Throws:

null

DOMError

removeEventListener(type:String, listener:Function, ?options:EitherType<EventListenerOptions, Bool>):Void

removeEventListener(type:String, listener:EventListener, ?options:EitherType<EventListenerOptions, Bool>):Void

Removes an event listener from the EventTarget.

Throws:

null

DOMError