filter2
General purpose custom filter.
Performs filtering using a transposed form-II digital filter lattice with no time-varying control. The filter coefficients implement the following difference equation:
the system function for which is represented by:
Syntax
ares filter2 asig, ibcoefs, iacoefs, ib0, ib1, ..., ibM, ia1, ia2, ..., iaN
kres filter2 ksig, ibcoefs, iacoefs, ib0, ib1, ..., ibM, ia1, ia2, ..., iaN
Initialization
ibcoefs -- number of feedforward coefficients including b0.
iacoefs -- number of feedback coefficients
ib0, ... ibM -- feedforward coefficients including b0.
ia1, ... iaN -- feedback coefficients
At initialization the number of zeros and poles of the filter are specified along with the corresponding zero and pole coefficients. The coefficients must be obtained by an external filter-design application such as Matlab and specified directly or loaded into a table via GEN01.
Performance
The filter2 opcodes perform filtering using a transposed form-II digital filter lattice with no time-varying control.
Since filter2 implements generalized recursive filters, it can be used to specify a large range of general DSP algorithms. For example, a digital waveguide can be implemented for musical instrument modeling using a pair of delayr and delayw opcodes in conjunction with the filter2 opcode.
Examples
A first-order linear-phase lowpass FIR filter operating on a k-rate signal:
Here is another example of the filter2 opcode. It uses the file filter2.csd.
See also
Specialized Filters: Other filters
Credits
Author: Michael A. Casey
M.I.T.
Cambridge, Mass.
1997
New in version 3.47