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

OnePole Class Reference

#include <OnePole.h>

Inheritance diagram for OnePole:

Filter Stk

List of all members.


Detailed Description

STK one-pole filter class.

This protected Filter subclass implements a one-pole digital filter. A method is provided for setting the pole position along the real axis of the z-plane while maintaining a constant peak filter gain.

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

Definition at line 115 of file physutil.h.


Public Member Functions

void clear (void)
 Clears the internal state of the filter.
StkFloat getGain (void) const
 Return the current filter gain.
StkFloat lastOut (void) const
 Return the last computed output value.
 OnePole (StkFloat thePole)
 Overloaded constructor which sets the pole position during instantiation.
 OnePole ()
 Default constructor creates a first-order low-pass filter.
void setA1 (StkFloat a1)
 Set the a[1] coefficient value.
void setB0 (StkFloat b0)
 Set the b[0] coefficient value.
void setGain (StkFloat gain)
 Set the filter gain.
void setPole (StkFloat thePole)
 Set the pole position in the z-plane.
StkFramestick (StkFrames &frames, unsigned int channel=0)
 Take a channel of the StkFrames object as inputs to the filter and replace with corresponding outputs.
StkFloat tick (StkFloat sample)
 Input one sample to the filter and return one output.
 ~OnePole ()
 Class destructor.

Public Attributes

MYFLT gain
MYFLT outputs
MYFLT poleCoeff
MYFLT sgain

Protected Types

typedef unsigned long StkFormat

Protected Member Functions

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