public class FilterTwoPolesTwoZeros extends UnitFilter
y(n) = 2.0 * (A0 * x(n) + A1 * x(n - 1) + A2 * x(n - 2) - B1 * y(n - 1) - B2 * y(n - 2))where y(n) is Output, x(n) is Input, x(n-1) is a delayed copy of the input, and y(n-1) is a delayed copy of the output. This filter is a recursive IIR or Infinite Impulse Response filter. It can be unstable depending on the values of the coefficients. This filter is basically the same as the FilterBiquad with different ports. A thorough description of the digital filter theory needed to fully describe this filter is beyond the scope of this document. Calculating coefficients is non-intuitive; the interested user is referred to one of the standard texts on filter theory (e.g., Moore, "Elements of Computer Music", section 2.4). Special thanks to Robert Bristow-Johnson for contributing his filter equations to the music-dsp list. They were used for calculating the coefficients for the lowPass, highPass, and other parametric filter calculations.
Modifier and Type | Field and Description |
---|---|
UnitVariablePort |
a0 |
UnitVariablePort |
a1 |
UnitVariablePort |
a2 |
UnitVariablePort |
b1 |
UnitVariablePort |
b2 |
input, output
FALSE, PORT_NAME_AMPLITUDE, PORT_NAME_CUTOFF, PORT_NAME_FREQUENCY, PORT_NAME_FREQUENCY_SCALER, PORT_NAME_INPUT, PORT_NAME_OUTPUT, PORT_NAME_PAN, PORT_NAME_PHASE, PORT_NAME_PRESSURE, PORT_NAME_TIMBRE, PORT_NAME_TIME, synthesisEngine, TRUE, VERY_SMALL_FLOAT
Constructor and Description |
---|
FilterTwoPolesTwoZeros() |
Modifier and Type | Method and Description |
---|---|
void |
generate(int start,
int limit)
Perform essential synthesis function.
|
getInput, getOutput
addPort, addPort, autoStop, convertHalfLifeToMultiplier, convertTimeToRate, flattenOutputs, generate, getCircuit, getFramePeriod, getFrameRate, getId, getPortByName, getPorts, getSynthesisEngine, getSynthesizer, getTopUnit, getUnitGenerator, incrementWrapPhase, isEnabled, isStartRequired, printConnections, printConnections, printConnections, pullData, setCircuit, setEnabled, setFrameRate, setPort, setSynthesisEngine, start, start, start, stop, stop, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getUnitGenerator, start, start, stop, stop
getUnitGenerator
public UnitVariablePort a0
public UnitVariablePort a1
public UnitVariablePort a2
public UnitVariablePort b1
public UnitVariablePort b2
public void generate(int start, int limit)
UnitGenerator
generate
in class UnitGenerator
start
- offset into port bufferslimit
- limit offset into port buffers for loop