BiquadUG Class Reference

BiquadUG is a two-pole, two-zero filter useful for adding resonances. More...

#import <BiquadUG.h>

Inheritance diagram for BiquadUG:

MKUnitGenerator

List of all members.

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.


Detailed Description

BiquadUG is a two-pole, two-zero filter useful for adding resonances.

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.

Memory Spaces

BiquadUGab a output b input


Member Function Documentation

- (id) setInput: (id)  aPatchPoint  

Sets filter input.

Parameters:
aPatchPoint is an id.
Returns:
Returns an id.

- (id) setOutput: (id)  aPatchPoint  

Sets filter output.

Parameters:
aPatchPoint is an id.
Returns:
Returns an id.

- (id) clear  

Clear internal filter state.

Returns:
Returns an id.

- (id) setFirstDelayedSample: (double)  d1  

Sets the internal filter state of the first delayed sample.

Parameters:
d1 is a double.
Returns:
Returns an id.

- (id) setSecondDelayedSample: (double)  d2  

Sets the internal filter state of the second delayed sample.

Parameters:
d2 is a double.
Returns:
Returns an id.

- (id) setA1: (double)  a1  

Sets the A1 filter coefficient.

Parameters:
a1 is a double.
Returns:
Returns an id.

- (id) setA2: (double)  a2  

Sets the A2 filter coefficient..

Parameters:
a2 is a double.
Returns:
Returns an id.

- (id) setB1: (double)  b1  

Sets the B1 filter coefficient..

Parameters:
b1 is a double.
Returns:
Returns an id.

- (id) setB2: (double)  b2  

Sets the B2 filter coefficient..

Parameters:
b2 is a double.
Returns:
Returns an id.

- (id) setGain: (double)  g  

Sets gain of filter.

Parameters:
g is a double.
Returns:
Returns an id.

+ (BOOL) shouldOptimize: (unsigned)  arg  

Specifies that all arguments are to be optimized if possible except the state variable.

Parameters:
arg is an unsigned.
Returns:
Returns an BOOL.

Reimplemented from MKUnitGenerator.

- (id) setComplexPolesRadius: (double)  r
angle: (double)  t 

This method provides a convenient way to set the filter feedback coefficients.

Parameters:
r is a double.
t is a double.
Returns:
Returns an id. Sets the coefficients such as to provide the specified pole radius and angle. The angle is in radians.

- (id) setComplexZerosRadius: (double)  r
angle: (double)  t 

This method provides a convenient way to set the filter feedforward coefficients.

Parameters:
r is a double.
t is a double.
Returns:
Returns an id. Sets the coefficients such as to provide the specified zero radius and angle. The angle is in radians.

- (id) setComplexPolesFrequency: (double)  f
bandwidth: (double)  b 

This method provides a convenient way to set the filter feedback coefficients.

Parameters:
f is a double.
b is a double.
Returns:
Returns an id. Sets the coefficients such as to provide the specified center frequency and bandwidth. The angle is in radians.

- (id) setComplexZerosFrequency: (double)  f
bandwidth: (double)  b 

This method provides a convenient way to set the filter feedforward coefficients.

Parameters:
f is a double.
b is a double.
Returns:
Returns an id. Sets the coefficients such as to provide the specified center frequency and bandwidth. The angle is in radians.

- (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.

Parameters:
f is a double.
t60 is a double.
Returns:
Returns an id. t60 is the time, in seconds, to decay to -60 dB.


The documentation for this class was generated from the following file:

Generated on Sat Dec 5 17:01:14 2009 for MusicKit by  doxygen 1.5.6