class IIRFilter : public Pipe

Digital IIR filter implementation API

Inheritance:


Public Methods

IIRFilter(void)
Default constructor.
IIRFilter(unsigned int npoles, dComplex* pole, unsigned int nzeros, dComplex* zero, double design_sample_rate)
Constructor from poles and zeros
int dumpSPlaneRoots(void)
Print the root values
~IIRFilter(void)
Default destructor.
TSeries apply(const TSeries& data_in)
Apply filter to a timeseries.
void dataCheck(const TSeries& data_in) const
Check data integrity
void reset(void)
Not implemented.
bool inUse(void) const
Check filter for coefficients, history buffers.
Time getStartTime(void) const
Get data start time.
Time getCurrentTime(void) const
Get start time for current data.
unsigned getOrder(void) const
not implemented.

Inherited from Pipe:

Public Methods

virtual TSeries operator)(const TSeries& in)
FilterIO& operator)(const FilterIO& in)
virtual bool isDataValid(const TSeries& in) const
KeyChain& getInputKeys(void) const
KeyChain& getOutputKeys(void) const

Inherited from FilterBase:

Public Methods

virtual bool rootGetStartTime(Time& t) const throw()
virtual bool rootGetCurrentTime(Time& t) const throw()

Documentation

IIR Filter implements digital IIR (Infinite Impulse Response) filters. An object of class IIRFilter is constructed by specifying the positions of the filter poles and zeros in the S plane and the sampling rate of the data. Any TSeries object can be filtered. Note that error trapping to spot gaps between successive TSeries inputs applied to the same filter is not yet implemented.
IIRFilter(void)
Default constructor. No coefficient or history storage is allocated.

IIRFilter(unsigned int npoles, dComplex* pole, unsigned int nzeros, dComplex* zero, double design_sample_rate)
Constructor from S plane poles and zeros. The pole and zero positions are written to two arrays of type dComplex. For example, to initialize a filter with two poles at 10Hz and no zeros, you could type: dComplex pole0(-10,0); dComplex pole1(-10,0); dComplex poles[2]; pole[0]=pole0; pole[1]=pole1; IIRFilter myfilter(2,poles,0,0x0,256); This IIRFilter myfilter could be applied to any channel with a 256 Hz sampling rate.
Parameters:
npoles - The number of poles.
pole - An array of type dComplex containing the list of poles. Note that where a complex pole is in the list, its complex conjugate must also be in the list. The convention for root specification is the same as for Matlab, except that matlab expresses s plane values in whereas here s plane values are in Hz. So to enter Matlab generated poles and zeros with this software, divide real and imaginary parts by .
nzeros. - The number of zeros.
zero - An array of type dComplex containing the list of zeros. See comment above for pole specification.
design_sample_rate - The sampling rate of the channel to be filtered, in Hz.

int dumpSPlaneRoots(void)
Print the positions of the S plane poles and zeros in rad s^-1.

~IIRFilter(void)
Default destructor. Frees the history buffers.

TSeries apply(const TSeries& data_in)
Apply filter to a timeseries. No error trapping for gaps between successive timeseries filtered. Note that a filter should always be applied to the same channel.
Returns:
Filtered TSeries.

void dataCheck(const TSeries& data_in) const
Check data before filtering. Not implemented.

void reset(void)
Clear history buffers, clear error flag. Not implemented.

bool inUse(void) const
See if filter coefficients have been set and history buffers created.
Returns:
1 (true) if yes, 0 (false) if no

Time getStartTime(void) const
Get data start time.
Returns:
Start time for first data set on which IIR filter applied.

Time getCurrentTime(void) const
Get start time for current data.
Returns:
Current time for first data set on which IIR filter applied.

unsigned getOrder(void) const
Get filter order. Not implemented. The filter order is defined as max(number of zeros,number of poles)
Returns:
Order of filter


This class has no child classes.
Author:
Edward J. Daw @email edaw@lsuligo.phys.lsu.edu
Version:
1.0; Last modified: June 9, 2001

alphabetic index hierarchy of classes


generated by doc++