You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
OpenAudio_ArduinoLibrary/docs/audio_html/AudioFilterBiquad.html

88 lines
4.3 KiB

<script type="text/x-red" data-help-name="AudioFilterBiquad">
<h3>Summary</h3>
<div class=tooltipinfo>
<p>Biquadratic cascaded filter, useful for all sorts of filtering.
Up to 4 stages may be cascaded.
</p>
<p align=center><img src="img/biquad.png"></p>
</div>
<h3>Audio Connections</h3>
<table class=doc align=center cellpadding=3>
<tr class=top><th>Port</th><th>Purpose</th></tr>
<tr class=odd><td align=center>In 0</td><td>Signal to be filtered</td></tr>
<tr class=odd><td align=center>Out 0</td><td>Filtered Signal Output</td></tr>
</table>
<h3>Functions</h3>
<p class=func><span class=keyword>setLowpass</span>(stage, frequency, Q);</p>
<p class=desc>Configure one stage of the filter (0 to 3) with low pass
response, with the specified corner frequency and Q shape. If Q is
higher that 0.7071, be careful of filter gain (see below).
</p>
<p class=func><span class=keyword>setHighpass</span>(stage, frequency, Q);</p>
<p class=desc>Configure one stage of the filter (0 to 3) with high pass
response, with the specified corner frequency and Q shape. If Q is
higher that 0.7071, be careful of filter gain (see below).
</p>
<p class=func><span class=keyword>setBandpass</span>(stage, frequency, Q);</p>
<p class=desc>Configure one stage of the filter (0 to 3) with band pass
response. The filter has unity gain at the specified frequency. Q
controls the width of frequencies allowed to pass.
</p>
<p class=func><span class=keyword>setNotch</span>(stage, frequency, Q);</p>
<p class=desc>Configure one stage of the filter (0 to 3) with band reject (notch)
response. Q controls the width of rejected frequencies.
</p>
<p class=func><span class=keyword>setLowShelf</span>(stage, frequency, gain, slope);</p>
<p class=desc>Configure one stage of the filter (0 to 3) with low shelf response.
A low shelf filter attenuates or amplifies signals below the specified frequency.
Frequency controls the slope midpoint, gain is in dB and can be both
positive or negative. The slope parameter controls steepness of gain transition.
A slope of 1 yields maximum steepness without overshoot,
lower values yield a less steep slope. See the picture below for a visualization
of the slope parameter's effect.
Be careful with positive gains and slopes higher than 1 as they introduce gain
(see warning below).
</p>
</p>
<p class=func><span class=keyword>setHighShelf</span>(stage, frequency, gain, slope);</p>
<p class=desc>Configure one stage of the filter (0 to 3) with high shelf response.
A high shelf filter attenuates or amplifies signals above the specified frequency.
Frequency controls the slope midpoint, gain is in dB and can be both
positive or negative. The slope parameter controls steepness of gain transition.
A slope of 1 yields maximum steepness without overshoot,
lower values yield a less steep slope. See the picture below for a visualization
of the slope parameter's effect.
Be careful with positive gains and slopes higher than 1 as they introduce gain
(see warning below).
</p>
<p align=center><img src="img/shelf_filter.png"></p>
<p class=func><span class=keyword>setCoefficients</span>(stage, array[5]);</p>
<p class=desc>Configure one stage of the filter (0 to 3) with an arbitrary
filter response. The array of coefficients is in order: B0, B1, B2, A1, A2.
Each coefficient must be less than 2.0 and greater than -2.0. The array
should be type double. Alternately, it may be type int, where 1.0 is
represented with 1073741824 (2<sup>30</sup>).
</p>
<h3>Examples</h3>
<p class=exam>File &gt; Examples &gt; Audio &gt; Effects &gt; Filter
</p>
<h3>Notes</h3>
<p>Filters can with gain must have their input signals attenuated, so the
signal does not exceed 1.0.
</p>
<p>This object implements up to 4 cascaded stages. Unconfigured stages will
not pass any signal.
</p>
<p>Biquad filters with low corner frequency (under about 400 Hz) can run into
trouble with limited numerical precision, causing the filter to perform
poorly. For very low corner frequency, the State Variable (Chamberlin)
filter should be used.
</p>
</script>
<script type="text/x-red" data-template-name="AudioFilterBiquad">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>