OnepoleUG Class Reference

OnepoleUG is a simple one-pole (recursive) filter, useful for low and high-pass filter. More...

#import <OnepoleUG.h>

List of all members.

Public Member Functions

(id) - setInput:
 Sets the input patchpoint to aPatchPoint.
(id) - setOutput:
 Sets the output patchpoint to aPatchPoint.
(id) - setB0:
 Sets the filter's gain.
(id) - setA1:
 Sets the filter's coefficient.
(id) - clear
 Clears the filter by setting the delayed sample (the previous output sample) to 0.0.
(id) - setState:
 Sets internal filter running term.
(id) - setBrightness:forFreq:
 This is a convenient method that adjusts the filter's gain and coefficient such that a constant brightness value produces the same number and relative amplitudes of a tone's harmonics regardless of the value of frequency as described in Jaffe/Smith, Computer Music Journal Vol. 7, No. 2, Summer 1983.

Static Public Member Functions

(BOOL) + shouldOptimize:
 Specifies that all arguments are to be optimized if possible except the filter state.


Detailed Description

OnepoleUG is a simple one-pole (recursive) filter, useful for low and high-pass filter.

OnepoleUG is a one-pole filter that's implemented by subtracting the previous output sample (initialized as 0.0) from the current input sample:

output = (b0 * input) - (a1 * previousOutput)

previousOutput = output

Note that the two samples have their own scalers:

Similar to the OnepoleUG is the OnezeroUG; it, too, is either a low-pass or a high-pass filter, but the frequency roll-off is gentler than with a OnepoleUG. You should also note that the high-pass/low-pass determination with regard to the sign of the coefficent is switched in the OnezeroUG.

Memory Spaces

OnepoleUGab a output b input


Member Function Documentation

- (id) setInput: (id)  aPatchPoint  

Sets the input patchpoint to aPatchPoint.

Parameters:
aPatchPoint is an id.
Returns:
Returns an id. Returns nil if the argument isn't a patchpoint; otherwise returns self.

- (id) setOutput: (id)  aPatchPoint  

Sets the output patchpoint to aPatchPoint.

Parameters:
aPatchPoint is an id.
Returns:
Returns an id. Returns nil if the argument isn't a patchpoint; otherwise returns self.

- (id) setB0: (double)  value  

Sets the filter's gain.

Parameters:
value is a double.
Returns:
Returns self. Effective gain values are between 0.0 and 1.0 (a negative gain is the same as its absolute value, but with a 180 degree phase shift).

- (id) setA1: (double)  value  

Sets the filter's coefficient.

Parameters:
value is a double.
Returns:
Returns self. If value is less than 0.0, the OnepoleUG is a low-pass filter; if it's greater than 0.0, the object is a high-pass filter. For stability, the value should be between -1.0 and 1.0.

+ (BOOL) shouldOptimize: (unsigned)  arg  

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

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

- (id) clear  

Clears the filter by setting the delayed sample (the previous output sample) to 0.0.

Returns:
Returns self.

- (id) setState: (double)  val  

Sets internal filter running term.

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

- (id) setBrightness: (double)  brightness
forFreq: (double)  frequency 

This is a convenient method that adjusts the filter's gain and coefficient such that a constant brightness value produces the same number and relative amplitudes of a tone's harmonics regardless of the value of frequency as described in Jaffe/Smith, Computer Music Journal Vol. 7, No. 2, Summer 1983.

For example, in a musical phrase during which the brightness of the synthesized notes shouldn't be perceived to change, you would invoke this method once per note passing a constant brightness value (the successive frequency values would, of course, be determined by the pitches of the notes).

Parameters:
brightness is a double specifying the gain.
frequency is a double.
Returns:
Returns self.


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

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