1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
---
title: BiquadFilterNode
slug: Web/API/BiquadFilterNode
translation_of: Web/API/BiquadFilterNode
---
<p>{{APIRef("Web Audio API")}}</p>
<div>
<p><span class="seoSummary"><code>BiquadFilterNode接口表示一个简单低阶滤波器(双二阶滤波器)</code>, 通过 {{ domxref("AudioContext.createBiquadFilter()") }} 方法创建. 它是一个能表示不同类型的过滤器,声调控制设备,图形均衡器的{{domxref("AudioNode")}} .</span> 一个<code>BiquadFilterNode(</code>双二阶滤波器<code>)</code> 总是恰好有一个输入和一个输出.</p>
</div>
<table class="properties">
<tbody>
<tr>
<th scope="row">Number of inputs</th>
<td><code>1</code></td>
</tr>
<tr>
<th scope="row">Number of outputs</th>
<td><code>1</code></td>
</tr>
<tr>
<th scope="row">Channel count mode</th>
<td><code>"max"</code></td>
</tr>
<tr>
<th scope="row">Channel count</th>
<td><code>2</code> (not used in the default count mode)</td>
</tr>
<tr>
<th scope="row">Channel interpretation</th>
<td><code>"speakers"</code></td>
</tr>
</tbody>
</table>
<h2 id="属性">属性</h2>
<p><em>继承属性自父级的 </em><em>{{domxref("AudioNode")}}</em>.</p>
<dl>
<dt>{{domxref("BiquadFilterNode.frequency")}}</dt>
<dd>Is an <a href="/en-US/docs/Web/API/AudioParam#a-rate">a-rate</a> {{domxref("AudioParam")}}, a double representing a frequency in the current filtering algorithm measured in hertz (Hz).</dd>
<dt>{{domxref("BiquadFilterNode.detune")}}</dt>
<dd>Is an <a href="/en-US/docs/Web/API/AudioParam#a-rate">a-rate</a> {{domxref("AudioParam")}} representing detuning of the frequency in <a class="external external-icon" href="http://en.wikipedia.org/wiki/Cent_%28music%29">cents</a>.</dd>
<dt>{{domxref("BiquadFilterNode.Q")}}</dt>
<dd>Is an <a href="/en-US/docs/Web/API/AudioParam#a-rate">a-rate</a> {{domxref("AudioParam")}}, a double representing a <a href="http://en.wikipedia.org/wiki/Q_factor">Q factor</a>, or <em>quality factor</em>.</dd>
<dt>{{domxref("BiquadFilterNode.gain")}} {{readonlyInline}}</dt>
<dd>Is an <a href="/en-US/docs/Web/API/AudioParam#a-rate">a-rate</a> {{domxref("AudioParam")}}, a double representing the <a href="http://en.wikipedia.org/wiki/Gain">gain</a> used in the current filtering algorithm.</dd>
<dt>{{domxref("BiquadFilterNode.type")}}</dt>
<dd>节点实现定义不同过滤算法的一个字符串值.<br>
<table class="standard-table">
<caption>The meaning of the different parameters depending of the type of the filter (detune has the same meaning regardless, so isn't listed below)</caption>
<thead>
<tr>
<th scope="row"><code>type</code></th>
<th scope="col">Description</th>
<th scope="col"><code>frequency</code></th>
<th scope="col"><code>Q</code></th>
<th scope="col"><code>gain</code></th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><code>lowpass</code></th>
<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><em>Not used</em></td>
</tr>
<tr>
<th scope="row"><code>highpass</code></th>
<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><em>Not used</em></td>
</tr>
<tr>
<th scope="row"><code>bandpass</code></th>
<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><em>Not used</em></td>
</tr>
<tr>
<th scope="row"><code>lowshelf</code></th>
<td>Standard second-order lowshelf filer. 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><em>Not used</em></td>
<td>The boost, in dB, to be applied; if negative, it will be an attenuation.</td>
</tr>
<tr>
<th scope="row"><code>highshelf</code></th>
<td>Standard second-order highshelf filer. 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><em>Not used</em></td>
<td>The boost, in dB, to be applied; if negative, it will be an attenuation.</td>
</tr>
<tr>
<th scope="row"><code>peaking</code></th>
<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>
<th scope="row"><code>notch</code></th>
<td>Standard <a href="http://en.wikipedia.org/wiki/Band-stop_filter" title="/en-US/docs/">notch</a> filter, also called a <em>band-stop</em> or <em>band-rejection</em> 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><em>Not used</em></td>
</tr>
<tr>
<th scope="row"><code>allpass</code></th>
<td>Standard second-order <a href="http://en.wikipedia.org/wiki/All-pass_filter#Digital_Implementation" title="/en-US/docs/">allpass</a> filter. It lets all frequencies through, but changes the phase-relationship between the various frequencies.</td>
<td>The frequency with the maximal <a href="http://en.wikipedia.org/wiki/Group_delay_and_phase_delay" title="/en-US/docs/">group delay</a>, 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><em>Not used</em></td>
</tr>
</tbody>
</table>
</dd>
</dl>
<h2 id="方法">方法</h2>
<p><em>继承方法自父级的 {{domxref("AudioNode")}}</em>.</p>
<dl>
<dt>{{domxref("BiquadFilterNode.getFrequencyResponse()")}}</dt>
<dd>From the current filter parameter settings this method calculates the frequency response for frequencies specified in the provided array of frequencies.</dd>
</dl>
<h2 id="例子">例子</h2>
<p>{{page("/en-US/docs/Web/API/AudioContext.createBiquadFilter","Example")}}</p>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('Web Audio API', '#the-biquadfilternode-interface', 'BiquadFilterNode')}}</td>
<td>{{Spec2('Web Audio API')}}</td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
{{Compat("api.BiquadFilterNode")}}
<h2 id="相关内容">相关内容</h2>
<ul>
<li><a href="/en-US/docs/Web_Audio_API/Using_Web_Audio_API">Using the Web Audio API</a></li>
</ul>
|