BiquadFilterNode

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

Number of inputs 1
Number of outputs 1
Channel count mode "max"
Channel count 2 (not used in the default count mode)
Channel interpretation "speakers"

Constructor

BiquadFilterNode() (en-US)
Creates a new instance of an BiquadFilterNode object.

Properties

Inherits properties from its parent, AudioNode.

BiquadFilterNode.frequency (en-US)
Is an a-rate AudioParam, a double representing a frequency in the current filtering algorithm measured in hertz (Hz).
BiquadFilterNode.detune (en-US)
Is an a-rate AudioParam representing detuning of the frequency in cents.
BiquadFilterNode.Q (en-US)
Is an a-rate AudioParam, a double representing a Q factor, or quality factor.
BiquadFilterNode.gain (en-US) Read only
Is an a-rate AudioParam, a double representing the gain used in the current filtering algorithm.
BiquadFilterNode.type (en-US)
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)
type Description frequency Q gain
lowpass 12dB/octave์˜ ๋กค์˜คํ”„๋ฅผ ๊ฐ€์ง„ ํ‘œ์ค€ 2์ฐจ ๊ณต์ง„ ๋กœ์šฐํŒจ์Šค ํ•„ํ„ฐ์ž…๋‹ˆ๋‹ค. ์ปท์˜คํ”„ ์ดํ•˜์˜ ์ฃผํŒŒ์ˆ˜๋Š” ํ†ต๊ณผํ•˜๋ฉฐ ๊ทธ ์ด์ƒ์˜ ์ฃผํŒŒ์ˆ˜๋Š” ๊ฐ์‡ ํ•ฉ๋‹ˆ๋‹ค. ์ปท์˜คํ”„ ์ฃผํŒŒ์ˆ˜ ์ปท์˜คํ”„ ๋ถ€๊ทผ์—์„œ ์ฃผํŒŒ์ˆ˜์˜ ํ”ผํฌ๊ฐ€ ์–ผ๋งˆ๋‚˜ ํฐ์ง€ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค. ๊ฐ’์ด ํด์ˆ˜๋ก ํ”ผํฌ๊ฐ€ ์ปค์ง‘๋‹ˆ๋‹ค. Not used
highpass 12dB/octave์˜ ๋กค์˜คํ”„๋ฅผ ๊ฐ€์ง„ ํ‘œ์ค€ 2์ฐจ ๊ณต์ง„ ํ•˜์ดํŒจ์Šค ํ•„ํ„ฐ์ž…๋‹ˆ๋‹ค. ์ปท์˜คํ”„ ์ดํ•˜์˜ ์ฃผํŒŒ์ˆ˜๋Š” ๊ฐ์‡ ํ•˜๋ฉฐ ๊ทธ ์ด์ƒ์˜ ์ฃผํŒŒ์ˆ˜๋Š” ํ†ต๊ณผํ•ฉ๋‹ˆ๋‹ค. ์ปท์˜คํ”„ ์ฃผํŒŒ์ˆ˜ ์ปท์˜คํ”„ ๋ถ€๊ทผ์—์„œ ์ฃผํŒŒ์ˆ˜์˜ ํ”ผํฌ๊ฐ€ ์–ผ๋งˆ๋‚˜ ํฐ์ง€ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค. ๊ฐ’์ด ํด์ˆ˜๋ก ํ”ผํฌ๊ฐ€ ์ปค์ง‘๋‹ˆ๋‹ค. Not used
bandpass ํ‘œ์ค€ 2์ฐจ ๋ฐด๋“œํŒจ์Šค ํ•„ํ„ฐ์ž…๋‹ˆ๋‹ค. ์ฃผ์–ด์ง„ ์ฃผํŒŒ์ˆ˜ ๋Œ€์—ญ ๋ฐ”๊นฅ์˜ ์ฃผํŒŒ์ˆ˜๋Š” ๊ฐ์‡ ๋˜๋ฉฐ, ์ด๋‚ด์˜ ์ฃผํŒŒ์ˆ˜๋Š” ํ†ต๊ณผํ•ฉ๋‹ˆ๋‹ค. ์ฃผํŒŒ์ˆ˜ ๋Œ€์—ญ์˜ ์ค‘์•™ ์ฃผํŒŒ์ˆ˜ ๋Œ€์—ญ์˜ ํญ์„ ์กฐ์ •ํ•ฉ๋‹ˆ๋‹ค. Q๊ฐ’์ด ํด์ˆ˜๋ก ์ฃผํŒŒ์ˆ˜ ๋Œ€์—ญ์€ ์ž‘์•„์ง‘๋‹ˆ๋‹ค. Not used
lowshelf ํ‘œ์ค€ 2์ฐจ ๋กœ์šฐ์‰˜ํ”„ ํ•„ํ„ฐ์ž…๋‹ˆ๋‹ค. ๊ธฐ์ค€ ์ฃผํŒŒ์ˆ˜๋ณด๋‹ค ๋‚ฎ์€ ์ฃผํŒŒ์ˆ˜๋Š” ์ฆํญ๋˜๊ฑฐ๋‚˜ ๊ฐ์‡ ๋ฉ๋‹ˆ๋‹ค. ๊ทธ ์ด์ƒ์˜ ์ฃผํŒŒ์ˆ˜๋Š” ๋ณ€ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ฆํญ์ด๋‚˜ ๊ฐ์‡ ๋ฅผ ์–ป๋Š” ์ฃผํŒŒ์ˆ˜์˜ ์ƒํ•œ๊ฐ’ Not used ์ ์šฉํ•  ์ฆํญ(๋‹จ์œ„ : dB), ์Œ์ˆ˜์ด๋ฉด ๊ฐ์‡ ๋ฉ๋‹ˆ๋‹ค.
highshelf ํ‘œ์ค€ 2์ฐจ ํ•˜์ด์‰˜ํ”„ ํ•„ํ„ฐ์ž…๋‹ˆ๋‹ค. ๊ธฐ์ค€ ์ฃผํŒŒ์ˆ˜๋ณด๋‹ค ํฐ ์ฃผํŒŒ์ˆ˜๋Š” ์ฆํญ๋˜๊ฑฐ๋‚˜ ๊ฐ์‡ ๋ฉ๋‹ˆ๋‹ค. ๊ทธ ์ดํ•˜์˜ ์ฃผํŒŒ์ˆ˜๋Š” ๋ณ€ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ฆํญ์ด๋‚˜ ๊ฐ์‡ ๋ฅผ ์–ป๋Š” ์ฃผํŒŒ์ˆ˜์˜ ํ•˜ํ•œ๊ฐ’ Not used ์ ์šฉํ•  ์ฆํญ(๋‹จ์œ„ : dB), ์Œ์ˆ˜์ด๋ฉด ๊ฐ์‡ ๋ฉ๋‹ˆ๋‹ค.
peaking ๋Œ€์—ญ ๋‚ด์˜ ์ฃผํŒŒ์ˆ˜๋Š” ์ฆํญ๋˜๊ฑฐ๋‚˜ ๊ฐ์‡ ๋ฉ๋‹ˆ๋‹ค. ๋ฐ”๊นฅ์˜ ์ฃผํŒŒ์ˆ˜๋Š” ๋ณ€ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ฆํญ์ด๋‚˜ ๊ฐ์‡ ๋ฅผ ์–ป๋Š” ์ฃผํŒŒ์ˆ˜ ๋Œ€์—ญ์˜ ์ค‘์•™ ์ฃผํŒŒ์ˆ˜ ๋Œ€์—ญ์˜ ํญ์„ ์กฐ์ •ํ•ฉ๋‹ˆ๋‹ค. Q๊ฐ’์ด ํด์ˆ˜๋ก ์ฃผํŒŒ์ˆ˜ ๋Œ€์—ญ์€ ์ž‘์•„์ง‘๋‹ˆ๋‹ค. ์ ์šฉํ•  ์ฆํญ(๋‹จ์œ„ : dB), ์Œ์ˆ˜์ด๋ฉด ๊ฐ์‡ ๋ฉ๋‹ˆ๋‹ค.
notch ๋ฐด๋“œ ์Šคํ†ฑ, ํ˜น์€ ๋ฐด๋“œ ๋ฆฌ์ ์…˜์œผ๋กœ ๋ถˆ๋ฆฌ๋Š” ํ‘œ์ค€ notch ํ•„ํ„ฐ์ž…๋‹ˆ๋‹ค. ์ด๋Š” ๋ฐด๋“œํŒจ์Šค ํ•„ํ„ฐ์™€ ๋ฐ˜๋Œ€์ž…๋‹ˆ๋‹ค. ์ฃผ์–ด์ง„ ๋Œ€์—ญํญ ๋ฐ”๊นฅ์˜ ์ฃผํŒŒ์ˆ˜๋Š” ํ†ต๊ณผํ•˜๋ฉฐ, ์•ˆ์ชฝ์˜ ์ฃผํŒŒ์ˆ˜๋Š” ๊ฐ์‡ ํ•ฉ๋‹ˆ๋‹ค. ์ฃผํŒŒ์ˆ˜ ๋Œ€์—ญ์˜ ์ค‘์•™ ์ฃผํŒŒ์ˆ˜ ๋Œ€์—ญ์˜ ํญ์„ ์กฐ์ •ํ•ฉ๋‹ˆ๋‹ค. Q๊ฐ’์ด ํด์ˆ˜๋ก ์ฃผํŒŒ์ˆ˜ ๋Œ€์—ญ์€ ์ž‘์•„์ง‘๋‹ˆ๋‹ค. Not used
allpass ํ‘œ์ค€ 2์ฐจ allpass ํ•„ํ„ฐ์ž…๋‹ˆ๋‹ค. ์ด๋Š” ๋ชจ๋“  ์ฃผํŒŒ์ˆ˜๋ฅผ ํ†ต๊ณผ์‹œํ‚ค์ง€๋งŒ, ๊ฐ€๋ณ€ ์ฃผํŒŒ์ˆ˜ ์‚ฌ์ด์˜ ์œ„์ƒ ๊ด€๊ณ„๋ฅผ ๋ณ€ํ™”์‹œํ‚ต๋‹ˆ๋‹ค. ์ตœ๋Œ€ group delay๋ฅผ ๊ฐ–๋Š” ์ฃผํŒŒ์ˆ˜, ์ฆ‰ ์œ„์ƒ ์ „์ด ๋ฐœ์ƒ์˜ ์ค‘์‹ฌ์— ์žˆ๋Š” ์ฃผํŒŒ์ˆ˜์ž…๋‹ˆ๋‹ค. ์ค‘๊ฐ„ ์ฃผํŒŒ์ˆ˜์—์„œ ์ „ํ™˜์ด ์–ผ๋งˆ๋‚˜ ์„ ๋ช…ํ•œ๊ฐ€๋ฅผ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค. ์ด ๋งค๊ฐœ ๋ณ€์ˆ˜๊ฐ€ ํด์ˆ˜๋ก ๋” ์„ ๋ช…ํ•˜๊ณ  ํฌ๊ฒŒ ์ „ํ™˜๋ฉ๋‹ˆ๋‹ค. Not used

Methods

AudioNode ๋กœ๋ถ€ํ„ฐ ๋ฉ”์„œ๋“œ๋ฅผ ์ƒ์†๋ฐ›์Šต๋‹ˆ๋‹ค.

BiquadFilterNode.getFrequencyResponse() (en-US)
์ด ๋ฉ”์„œ๋“œ๋Š” ํ˜„์žฌ ํ•„ํ„ฐ ํŒŒ๋ผ๋ฏธํ„ฐ ์„ค์ •์œผ๋กœ๋ถ€ํ„ฐ ์ œ๊ณต๋œ ์ฃผํŒŒ์ˆ˜ ๋ฐฐ์—ด์— ์ง€์ •๋œ ์ฃผํŒŒ์ˆ˜์— ๋Œ€ํ•œ ์ฃผํŒŒ์ˆ˜ ์‘๋‹ต์„ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค

Example

The following example shows basic usage of an AudioContext to create a Biquad filter node. For a complete working example, check out our voice-change-o-matic demo (look at the source code too).

var audioCtx = new (window.AudioContext || window.webkitAudioContext)();

//set up the different audio nodes we will use for the app
var analyser = audioCtx.createAnalyser();
var distortion = audioCtx.createWaveShaper();
var gainNode = audioCtx.createGain();
var biquadFilter = audioCtx.createBiquadFilter();
var convolver = audioCtx.createConvolver();

// connect the nodes together

source = audioCtx.createMediaStreamSource(stream);
source.connect(analyser);
analyser.connect(distortion);
distortion.connect(biquadFilter);
biquadFilter.connect(convolver);
convolver.connect(gainNode);
gainNode.connect(audioCtx.destination);

// Manipulate the Biquad filter

biquadFilter.type = "lowshelf";
biquadFilter.frequency.setValueAtTime(1000, audioCtx.currentTime);
biquadFilter.gain.setValueAtTime(25, audioCtx.currentTime);

Specifications

Specification Status Comment
Web Audio API
The definition of 'BiquadFilterNode' in that specification.
Recommendation  

Browser compatibility

BCD tables only load in the browser

See also