#import <BiquadUG.h>

Public Member Functions | |
| (id) | - setInput: |
| Sets filter input. | |
| (id) | - setOutput: |
| Sets filter output. | |
| (id) | - clear |
| Clear internal filter state. | |
| (id) | - setFirstDelayedSample: |
| Sets the internal filter state of the first delayed sample. | |
| (id) | - setSecondDelayedSample: |
| Sets the internal filter state of the second delayed sample. | |
| (id) | - setA1: |
| Sets the A1 filter coefficient. | |
| (id) | - setA2: |
| Sets the A2 filter coefficient.. | |
| (id) | - setB1: |
| Sets the B1 filter coefficient.. | |
| (id) | - setB2: |
| Sets the B2 filter coefficient.. | |
| (id) | - setGain: |
| Sets gain of filter. | |
| (id) | - setComplexPolesRadius:angle: |
| This method provides a convenient way to set the filter feedback coefficients. | |
| (id) | - setComplexZerosRadius:angle: |
| This method provides a convenient way to set the filter feedforward coefficients. | |
| (id) | - setComplexPolesFrequency:bandwidth: |
| This method provides a convenient way to set the filter feedback coefficients. | |
| (id) | - setComplexZerosFrequency:bandwidth: |
| This method provides a convenient way to set the filter feedforward coefficients. | |
| (id) | - setComplexPolesFrequency:t60: |
| Sets the coefficients such as to place the poles at the specified freq with the given t60 value. | |
Static Public Member Functions | |
| (BOOL) | + shouldOptimize: |
| Specifies that all arguments are to be optimized if possible except the state variable. | |
The BiquadUG unit-generator implements a two-pole, two-zero filter section in direct form. The output space can only be y DSP memory. Therefore, only two leaf classes exist, BiquadUGx and BiquadUGy, corresponding to the two possible input spaces.
The biquad transfer function is
-1 -2
1 + b1 * z + b2 * z
H(z) = g * -------------------------
-1 -2
1 + a1 * z + a2 * z
The biquad difference equation which implements H(z) is
v(n) = g * x(n) - a1 * v(n-1) - a2 * v(n-2); y(n) = v(n) + b1 * v(n-1) + b2 * v(n-2);
where n denotes the current sample time, x(n) is the input signal at time n, y(n) is the output signal, and v(n) is an intermediate signal. This is the so-called "transposed direct form II" digital filter structure, which avoids the possibility of internal overflow. See Digital Signal Processing by A.V. Oppenheim and R.W. Schafer (Prentice-Hall, 1975, p. 155) for further discussion.
BiquadUGab a output b input
| - (id) setInput: | (id) | aPatchPoint |
Sets filter input.
| aPatchPoint | is an id. |
| - (id) setOutput: | (id) | aPatchPoint |
Sets filter output.
| aPatchPoint | is an id. |
| - (id) clear |
Clear internal filter state.
| - (id) setFirstDelayedSample: | (double) | d1 |
Sets the internal filter state of the first delayed sample.
| d1 | is a double. |
| - (id) setSecondDelayedSample: | (double) | d2 |
Sets the internal filter state of the second delayed sample.
| d2 | is a double. |
| - (id) setA1: | (double) | a1 |
Sets the A1 filter coefficient.
| a1 | is a double. |
| - (id) setA2: | (double) | a2 |
Sets the A2 filter coefficient..
| a2 | is a double. |
| - (id) setB1: | (double) | b1 |
Sets the B1 filter coefficient..
| b1 | is a double. |
| - (id) setB2: | (double) | b2 |
Sets the B2 filter coefficient..
| b2 | is a double. |
| - (id) setGain: | (double) | g |
Sets gain of filter.
| g | is a double. |
| + (BOOL) shouldOptimize: | (unsigned) | arg |
Specifies that all arguments are to be optimized if possible except the state variable.
| arg | is an unsigned. |
Reimplemented from MKUnitGenerator.
| - (id) setComplexPolesRadius: | (double) | r | ||
| angle: | (double) | t | ||
This method provides a convenient way to set the filter feedback coefficients.
| r | is a double. | |
| t | is a double. |
| - (id) setComplexZerosRadius: | (double) | r | ||
| angle: | (double) | t | ||
This method provides a convenient way to set the filter feedforward coefficients.
| r | is a double. | |
| t | is a double. |
| - (id) setComplexPolesFrequency: | (double) | f | ||
| bandwidth: | (double) | b | ||
This method provides a convenient way to set the filter feedback coefficients.
| f | is a double. | |
| b | is a double. |
| - (id) setComplexZerosFrequency: | (double) | f | ||
| bandwidth: | (double) | b | ||
This method provides a convenient way to set the filter feedforward coefficients.
| f | is a double. | |
| b | is a double. |
| - (id) setComplexPolesFrequency: | (double) | f | ||
| t60: | (double) | t60 | ||
Sets the coefficients such as to place the poles at the specified freq with the given t60 value.
| f | is a double. | |
| t60 | is a double. |
1.5.6