FIR


FIR does a finite impulse response filter on a soundfile according to the filter coefficients passed to the instrument. The filter is non-recursive, so only input samples are passed through the coefficients, in the form:

yn = anxn ± an-1xn-1... ± an-xxn-x

Syntax:


FIR(outskip, inskip, duration, amp, #_of_coefficients, coefficient1, coefficient2...) /* up to 99 coefficients can be specified */

in comment form:

/* FIR: simple fir filter instrument
*
*  p0 = outsk
*  p1 = insk
*  p2 = dur
*  p3 = amp
*  p4 = total number of coefficients
*  p5...  the coefficients (up to 99 fir coefficients)
*
*  (no amplitude control, does channel 0 of both input and output only)
*
*/

An example score:

rtsetparams(44100, 2)
load("FIR")

rtinput("bob.dole.snd")
rtoutput("bob.dole.filtered.snd")
FIR(0, 0, 7.0, 0.7, 7, 0.9, 0.1, 0.69, -0.49, 0.314, 0.2, 0.09)