MusicKit  0.0.0
Public Member Functions | Static Public Member Functions
OnezeroUG Class Reference

OnezeroUG is a one-zero (FIR) fiter useful for mild low and high-pass filtering. More...

#import <OnezeroUG.h>

Inheritance diagram for OnezeroUG:
MKUnitGenerator

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) - setB1:
 Sets the filter's coefficient.
(id) - clear
 Clears the filter by setting the delayed sample (the previous input sample) to 0.0.

Static Public Member Functions

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

Detailed Description

OnezeroUG is a one-zero (FIR) fiter useful for mild low and high-pass filtering.

OnezeroUG is a one-zero filter that's implemented by adding the previous input sample (initialized as 0.0) to the current input sample:

output = (b0 * input) + (b1 * previousInput)

previousInput = input

Note that the two samples have their own scalers:

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

Memory Spaces

OnezeroUGab a output b input


Member Function Documentation

- (id) clear

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

Returns:
Returns self.
- (id) setB0: (double)  value

Sets the filter's gain.

Parameters:
valueis 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) setB1: (double)  value

Sets the filter's coefficient.

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

Sets the input patchpoint to aPatchPoint.

Parameters:
aPatchPointis 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:
aPatchPointis an id.
Returns:
Returns an id. Returns nil if the argument isn't a patchpoint; otherwise returns self.
+ (BOOL) shouldOptimize: (unsigned)  arg

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

Parameters:
argis an unsigned.
Returns:
Returns an BOOL.

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