Logo Search packages:      
Sourcecode: csound version File versions  Download package

BiQuad Class Reference

#include <BiQuad.h>

Inheritance diagram for BiQuad:

Filter Stk FormSwep

List of all members.

Detailed Description

STK biquad (two-pole, two-zero) filter class.

This protected Filter subclass implements a two-pole, two-zero digital filter. A method is provided for creating a resonance in the frequency response while maintaining a constant filter gain.

by Perry R. Cook and Gary P. Scavone, 1995 - 2005.

Definition at line 206 of file physutil.h.

Public Member Functions

 BiQuad ()
 Default constructor creates a second-order pass-through filter.
void clear (void)
 Clears all internal states of the filter.
StkFloat getGain (void) const
 Return the current filter gain.
StkFloat lastOut (void) const
 Return the last computed output value.
void setA1 (StkFloat a1)
 Set the a[1] coefficient value.
void setA2 (StkFloat a2)
 Set the a[2] coefficient value.
void setB0 (StkFloat b0)
 Set the b[0] coefficient value.
void setB1 (StkFloat b1)
 Set the b[1] coefficient value.
void setB2 (StkFloat b2)
 Set the b[2] coefficient value.
void setEqualGainZeroes ()
 Sets the filter zeroes for equal resonance gain.
void setGain (StkFloat gain)
 Set the filter gain.
void setNotch (StkFloat frequency, StkFloat radius)
 Set the filter coefficients for a notch at frequency (in Hz).
void setResonance (StkFloat frequency, StkFloat radius, bool normalize=false)
 Sets the filter coefficients for a resonance at frequency (in Hz).
virtual StkFramestick (StkFrames &frames, unsigned int channel=0)
 Take a channel of the StkFrames object as inputs to the filter and replace with corresponding outputs.
virtual StkFloat tick (StkFloat sample)
 Input one sample to the filter and return one output.
virtual ~BiQuad ()
 Class destructor.

Public Attributes

MYFLT gain
MYFLT inputs [2]
MYFLT lastOutput
MYFLT poleCoeffs [2]
MYFLT zeroCoeffs [2]

Protected Types

typedef unsigned long StkFormat

Protected Member Functions

virtual StkFloat computeSample (StkFloat input)
void handleError (StkError::Type type)
 Internal function for error reporting which assumes message in errorString_ variable.
void setCoefficients (std::vector< StkFloat > &bCoefficients, std::vector< StkFloat > &aCoefficients, bool clearState=false)
 Set filter coefficients.
void setDenominator (std::vector< StkFloat > &aCoefficients, bool clearState=false)
 Set denominator coefficients.
void setNumerator (std::vector< StkFloat > &bCoefficients, bool clearState=false)
 Set numerator coefficients.

Static Protected Member Functions

static void handleError (std::string message, StkError::Type type)
 Static function for error reporting and handling using c++ strings.
static void handleError (const char *message, StkError::Type type)
 Static function for error reporting and handling using c-strings.
static void printErrors (bool status)
 Toggle display of error messages before throwing exceptions.
static std::string rawwavePath (void)
 Static method which returns the current rawwave path.
static StkFloat sampleRate (void)
 Static method which returns the current STK sample rate.
static void setRawwavePath (std::string path)
 Static method which sets the STK rawwave path.
static void setSampleRate (StkFloat rate)
 Static method which sets the STK sample rate.
static void showWarnings (bool status)
 Toggle display of WARNING and STATUS messages.
static void sleep (unsigned long milliseconds)
 Static cross-platform method to sleep for a number of milliseconds.
static void swap16 (unsigned char *ptr)
 Static method which byte-swaps a 16-bit data type.
static void swap32 (unsigned char *ptr)
 Static method which byte-swaps a 32-bit data type.
static void swap64 (unsigned char *ptr)
 Static method which byte-swaps a 64-bit data type.

Protected Attributes

std::vector< StkFloat > a_
std::vector< StkFloat > b_
std::ostringstream errorString_
StkFloat gain_
std::vector< StkFloat > inputs_
std::vector< StkFloat > outputs_

Static Protected Attributes

static const StkFormat STK_FLOAT32 = 0x10
static const StkFormat STK_FLOAT64 = 0x20
static const StkFormat STK_SINT16 = 0x2
static const StkFormat STK_SINT24 = 0x4
static const StkFormat STK_SINT32 = 0x8
static const StkFormat STK_SINT8 = 0x1

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

Generated by  Doxygen 1.6.0   Back to index