MusicKit
0.0.0
|
OnezeroUG is a one-zero (FIR) fiter useful for mild low and high-pass filtering. More...
#import <OnezeroUG.h>
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. |
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:
b0 scales the input sample; this is the gain of the filter. 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).
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.
OnezeroUGab a output b input
- (id) clear |
Clears the filter by setting the delayed sample (the previous input sample) to 0.0.
- (id) setB0: | (double) | value |
Sets the filter's gain.
value | is a double. |
- (id) setB1: | (double) | value |
Sets the filter's coefficient.
value | is a double. |
- (id) setInput: | (id) | aPatchPoint |
Sets the input patchpoint to aPatchPoint.
aPatchPoint | is an id. |
- (id) setOutput: | (id) | aPatchPoint |
Sets the output patchpoint to aPatchPoint.
aPatchPoint | is an id. |
+ (BOOL) shouldOptimize: | (unsigned) | arg |
Specifies that all arguments are to be optimized if possible except the filter state.
arg | is an unsigned. |