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.
64 lines
2.6 KiB
64 lines
2.6 KiB
<script type="text/x-red" data-help-name="AudioFilterFIR">
|
|
<h3>Summary</h3>
|
|
<div class=tooltipinfo>
|
|
<p>Finite impulse response filter, useful for all sorts of filtering.
|
|
</p>
|
|
<p align=center><img src="img/fir_filter.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>begin</span>(array, length);</p>
|
|
<p class=desc>Initialize the filter. The array must be 16 bit integers (the
|
|
filter's impulse response), and
|
|
length indicates the number of points in the array. Array may also be
|
|
FIR_PASSTHRU (length = 0), to directly pass the input to output without
|
|
filtering.
|
|
</p>
|
|
<p class=func><span class=keyword>end</span>();</p>
|
|
<p class=desc>Turn the filter off.
|
|
</p>
|
|
<h3>Examples</h3>
|
|
<p class=exam>File > Examples > Audio > Effects > Filter_FIR
|
|
</p>
|
|
<h3>Known Issues</h3>
|
|
<p>Your filter's impulse response array must have an even length. If you have
|
|
add odd number of taps, you must add an extra zero to increase the length
|
|
to an even number.
|
|
</p>
|
|
<p>The minimum number of taps is 4. If you use less, add extra zeros to increase
|
|
the length to 4.
|
|
</p>
|
|
<p>The impulse response must be given in reverse order. Many filters have
|
|
symetrical impluse response, making this a non-issue. If your filter has
|
|
a non-symetrical response, make sure the data is in reverse time order.
|
|
</p>
|
|
<h3>Notes</h3>
|
|
<p>FIR filters requires more CPU time than Biquad (IIR), but they can
|
|
implement filters with better phase response.
|
|
</p>
|
|
<p>A 100 point filter requires 9% CPU time on Teensy 3.1. The maximum
|
|
supported filter length is 200 points.
|
|
</p>
|
|
<p>The free
|
|
<a href="http://t-filter.engineerjs.com/" target="_blank"> TFilter Design Tool</a>
|
|
can be used to create the impulse response array. Be sure to set the sampling
|
|
frequency to 44117 HZ (it defaults to only 2000 Hz) and the output type to "int" (16 bit).
|
|
</p>
|
|
<p>
|
|
If you use TFilter Design's "C/C++ array" option, it's output has "int" definition, which
|
|
is 32 bits on Teensy 3.1. Edit "int" to "short" for an array of 16 bit numbers,
|
|
and add "const" to avoid consuming extra RAM.
|
|
</p>
|
|
</script>
|
|
<script type="text/x-red" data-template-name="AudioFilterFIR">
|
|
<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>
|
|
|
|
|