In file MultiRate/MultiRate.hh:

class MultiRate : public Pipe

Resampling filter

Inheritance:


Public Classes

enum datatype
Data type
kReal
float data

Public Methods

MultiRate ()
Default constructor.
MultiRate (double fsample, int up, int down, double atten = 80)
Constructor.
MultiRate (const MultiRate& filter)
Copy constructor.
virtual ~MultiRate ()
Destructor.
MultiRate& operator= (const MultiRate& filter)
Assignment operator.
virtual MultiRate* clone () const
Clone a MultiRate filter.
virtual void dataCheck (const TSeries& ts) const
Check input data validity.
virtual TSeries apply (const TSeries& in)
Filter a Time Series.
int apply (int N, const float* in, float* out)
Filter a float array.
int apply (int N, const fComplex* in, fComplex* out)
Filter a float array.
virtual void init (double fsample, int up, int down, double atten = 80)
Set filter to new values.
virtual void reset ()
Set filter coefficients and reset history.
virtual void resetHist ()
Reset history.
virtual bool inUse (void) const
Test the filter acitivity status.
virtual Time getCurrentTime () const
Get the current time.
virtual Time getStartTime () const
Get the start time.
virtual int getUp () const
Get the interpolation factor.
virtual int getDown () const
Get the decimation factor.
virtual double getAtten () const
Get the stopband attenuation.
virtual double getSampleIn () const
Get the input sampling frequency.
virtual double getSampleOut () const
Get the output sampling frequency.
virtual int getOrder () const
Get the filter order.
virtual datatype getHistType () const
Get the history data type.

Protected Methods

virtual bool xfer (fComplex& coeff, double f) const
Get a transfer coefficent of a Filter.
void allocHist (int size)
allocate history buffer
void allocCoeff (int num, int len)
allocate coefficient buffer

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
virtual Interval getTimeDelay(void) const
virtual bool Xfer(fComplex& coeff, double f) const
virtual bool Xfer(fComplex* tf, const float* freqs, int points) const
virtual bool Xfer(FSeries& Fs, float Fmin = 0.0, float Fmax = 1000.0, float dF = 1.0) const

Inherited from FilterBase:

Public Methods

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

Documentation

Resampling filter. This filter can be used for data rate conversion. It implements a polyphase filter using the following formula:
    y(m) = SUM_{n=0}^{K-1} g(n,m-[m/u]*u) * x([m*d/u]-n)
    \begin{end}
    The decimation/interpolation filter is a FIR filter designed
    with the Kaiser window method. Its corner frequency is at
    0.9 of the Nyquist frequency of the output series (when the
    sampling rate gets overall smaller) or of the input series
    (if the sampling rate gets larger).

    The stop band attenuation can be specified; default is 80dB. 
    Since this filter has equal stopband and pass band ripple, the 
    passband ripple can be calculated from the stopband attenuation
    with $ripple = 10^{-attenuation/20}$, where the attenuation
    is given in dB.

    If the overall down sampling factor is large, it is better to
    decimate in steps. Since this algorithm implements a set of 
    polyphase filters, a large  sampling mismatch---like if one 
    wants to go from 16384Hz to 10000Hz---is handled efficiently.
   
    @memo Multi rate filter
    @see J.G. Proakis and D.G. Manolakis, "Digital Signal Processing",
         chap. 10, pp 800.
    @see A.V. Oppenheim and R.W. Schafer, "Discrete-time Signal
         Processing", sect. 4.6, 4.7 and 7.2.
    @author Written July 2002 by Daniel Sigg
    @version 1.0

enum datatype
Data type

kReal
float data

MultiRate()
Constructs a multi rate filter.

MultiRate(double fsample, int up, int down, double atten = 80)
Constructs a multi rate filter.
Parameters:
fsample - Input sampling frequency
up - Interpolation factor
down - Decimation factor
attn - Stopband attenuation

MultiRate(const MultiRate& filter)
Copy constructor.

virtual ~MultiRate()
Destructs the multi rate filter.

MultiRate& operator= (const MultiRate& filter)
Assignment operator.

virtual MultiRate* clone() const
Create an identical Multirate filter and return a pointer to the new filter. The history is zeroed.
Returns:
pointer to an identical filter.

virtual void dataCheck(const TSeries& ts) const
Test whether the TSeries is valid as input data for the filter. a runtime_error exception is thrown if the data are invalid.

virtual TSeries apply(const TSeries& in)
The TSeries is filtered and the result placed in a new TSeries. The resulting TSeries is left on the stack and must be copied to be made permanent. The filter status flag is set if there are insufficient history entries (less than the Filter order) or if the TSeries start time isn't contiguous with the previous data. The input samples are appended to the filter history as the filter response is calculated.
Returns:
A new TSeries containing the filter response to the input series.
Parameters:
in - Time series to be filtered.

int apply(int N, const float* in, float* out)
An N-point float series is filtered from in and stored in out. in may overlap out. The input samples are appended to the filter history as the filter response is calculated.
Returns:
Number of values written to out
Parameters:
N - Number of elements in the input series.
in - Float array containing the input series.
out - Float array to contain the filter response. the end of out may overlap the start of in.

int apply(int N, const fComplex* in, fComplex* out)
An N-point complex series is filtered from in and stored in out. in may overlap out. The input samples are appended to the filter history as the filter response is calculated.
Returns:
Number of values written to out
Parameters:
N - Number of elements in the input series.
in - Float array containing the input series.
out - Float array to contain the filter response. the end of out may overlap the start of in.

virtual void init(double fsample, int up, int down, double atten = 80)
Set the filter to new values.
Returns:
void
Parameters:
fsample - Input sampling frequency
up - Interpolation factor
down - Decimation factor
attn - Stopband attenuation

virtual void reset()
Set the filter length and coefficients. The filter history buffer is cleared.

virtual void resetHist()
Set the filter history.

virtual bool inUse(void) const
Test the filter acitivity status.
Returns:
true if the filter is being used.

virtual Time getCurrentTime() const
Get the expected start time of the next TSeries to be filtered.
Returns:
true The current time.

virtual Time getStartTime() const
Get the start time of this filter run. This is set by the first filter operation after the filter has been created or reset.
Returns:
true The start time.

virtual int getUp() const
Get the interpolation factor.
Returns:
interpolation factor.

virtual int getDown() const
Get the decimation factor.
Returns:
decimation factor.

virtual double getAtten() const
Get the stopband attenuation.
Returns:
stopband attenuation.

virtual double getSampleIn() const
Get the input sampling frequency.
Returns:
input sampling frequency.

virtual double getSampleOut() const
Get the output sampling frequency.
Returns:
output sampling frequency.

virtual int getOrder() const
Get the filter order.
Returns:
filter order.

virtual datatype getHistType() const
Get the history data type.
Returns:
history data type.

virtual bool xfer(fComplex& coeff, double f) const
The transfer coefficient of the filter at the specified frequency is calculated and returned as a complex number.
Returns:
true if successful
Parameters:
coeff - a complex number representing the Filter response at the specified frequency (return)
F - Frequency at which to sample the transfer function.

void allocHist(int size)
allocate history buffer

void allocCoeff(int num, int len)
allocate coefficient buffer


This class has no child classes.

alphabetic index hierarchy of classes


Please send questions and comments to zweizig_j@ligo.caltech.edu


generated by doc++