32 void setB0( StkFloat b0 ) { b_[0] = b0; };
35 void setB1( StkFloat b1 ) { b_[1] = b1; };
38 void setA1( StkFloat a1 ) { a_[1] = a1; };
41 void setCoefficients( StkFloat b0, StkFloat b1, StkFloat a1,
bool clearState =
false );
62 StkFloat
lastOut(
void )
const {
return lastFrame_[0]; };
65 StkFloat
tick( StkFloat input );
81 inputs_[0] = gain_ * input;
82 lastFrame_[0] = b_[0] * inputs_[0] + b_[1] * inputs_[1] - a_[1] * outputs_[1];
83 inputs_[1] = inputs_[0];
84 outputs_[1] = lastFrame_[0];
91 #if defined(_STK_DEBUG_)
92 if ( channel >= frames.
channels() ) {
93 oStream_ <<
"PoleZero::tick(): channel and StkFrames arguments are incompatible!";
98 StkFloat *samples = &frames[channel];
99 unsigned int hop = frames.
channels();
100 for (
unsigned int i=0; i<frames.
frames(); i++, samples += hop ) {
101 inputs_[0] = gain_ * *samples;
102 *samples = b_[0] * inputs_[0] + b_[1] * inputs_[1] - a_[1] * outputs_[1];
103 inputs_[1] = inputs_[0];
104 outputs_[1] = *samples;
107 lastFrame_[0] = outputs_[1];
STK abstract filter class.
Definition: Filter.h:23
STK one-pole, one-zero filter class.
Definition: PoleZero.h:22
StkFloat tick(StkFloat input)
Input one sample to the filter and return one output.
Definition: PoleZero.h:79
void setAllpass(StkFloat coefficient)
Set the filter for allpass behavior using coefficient.
void setB0(StkFloat b0)
Set the b[0] coefficient value.
Definition: PoleZero.h:32
StkFloat lastOut(void) const
Return the last computed output value.
Definition: PoleZero.h:62
~PoleZero()
Class destructor.
void setBlockZero(StkFloat thePole=0.99)
Create a DC blocking filter with the given pole position in the z-plane.
PoleZero()
Default constructor creates a first-order pass-through filter.
void setB1(StkFloat b1)
Set the b[1] coefficient value.
Definition: PoleZero.h:35
void setA1(StkFloat a1)
Set the a[1] coefficient value.
Definition: PoleZero.h:38
void setCoefficients(StkFloat b0, StkFloat b1, StkFloat a1, bool clearState=false)
Set all filter coefficients.
An STK class to handle vectorized audio data.
Definition: Stk.h:287
unsigned int channels(void) const
Return the number of channels represented by the data.
Definition: Stk.h:415
unsigned int frames(void) const
Return the number of sample frames represented by the data.
Definition: Stk.h:418
static void handleError(const char *message, StkError::Type type)
Static function for error reporting and handling using c-strings.
The STK namespace.
Definition: ADSR.h:8