ldas-tools-filters  2.6.4
Public Member Functions | List of all members
Filters::LinFilt< TCoeffs, TIn > Class Template Reference

Class for performing linear filtering on arbitrary data sequences. More...

#include <LinFilt.hh>

Inheritance diagram for Filters::LinFilt< TCoeffs, TIn >:
Filters::LinFiltBase Filters::LinFiltBase Filters::LinFiltBase

Public Member Functions

 LinFilt (const std::valarray< TCoeffs > &b, const std::valarray< TCoeffs > &a=std::valarray< TCoeffs >(1.0, 1))
 Construct from transfer function. More...
 
virtual ~LinFilt ()
 Destructor.
 
const LinFiltoperator= (const LinFilt &rhs)
 Assignment operator. More...
 
void getB (std::valarray< TCoeffs > &b) const
 Get FIR coefficients.
 
size_t getBSize () const
 Get FIR size.
 
void getA (std::valarray< TCoeffs > &a) const
 Get IIR coefficients.
 
size_t getASize () const
 Get IIR size.
 
void getZ (std::valarray< TState > &z) const
 Get state vector.
 
size_t getZSize () const
 Get state size.
 
virtual void reset ()
 Reset the internal state to its initial condition. More...
 
void apply (std::valarray< TOut > &x)
 In-place filter action. More...
 
void apply (std::valarray< TOut > &y, const std::valarray< TIn > &x)
 Out-of-place filter action. More...
 
 LinFilt (const std::valarray< TCoeffs > &b, const std::valarray< TCoeffs > &a=std::valarray< TCoeffs >(1.0, 1))
 Construct from transfer function. More...
 
virtual ~LinFilt ()
 Destructor.
 
const LinFiltoperator= (const LinFilt &rhs)
 Assignment operator. More...
 
void getB (std::valarray< TCoeffs > &b) const
 Get FIR coefficients.
 
size_t getBSize () const
 Get FIR size.
 
void getA (std::valarray< TCoeffs > &a) const
 Get IIR coefficients.
 
size_t getASize () const
 Get IIR size.
 
void getZ (std::valarray< TState > &z) const
 Get state vector.
 
size_t getZSize () const
 Get state size.
 
virtual void reset ()
 Reset the internal state to its initial condition. More...
 
void apply (std::valarray< TOut > &x)
 In-place filter action. More...
 
void apply (std::valarray< TOut > &y, const std::valarray< TIn > &x)
 Out-of-place filter action. More...
 
 LinFilt (const std::valarray< TCoeffs > &b, const std::valarray< TCoeffs > &a=std::valarray< TCoeffs >(1.0, 1))
 Construct from transfer function. More...
 
virtual ~LinFilt ()
 Destructor.
 
const LinFiltoperator= (const LinFilt &rhs)
 Assignment operator. More...
 
void getB (std::valarray< TCoeffs > &b) const
 Get FIR coefficients.
 
size_t getBSize () const
 Get FIR size.
 
void getA (std::valarray< TCoeffs > &a) const
 Get IIR coefficients.
 
size_t getASize () const
 Get IIR size.
 
void getZ (std::valarray< TState > &z) const
 Get state vector.
 
size_t getZSize () const
 Get state size.
 
virtual void reset ()
 Reset the internal state to its initial condition. More...
 
void apply (std::valarray< TOut > &x)
 In-place filter action. More...
 
void apply (std::valarray< TOut > &y, const std::valarray< TIn > &x)
 Out-of-place filter action. More...
 

Detailed Description

template<class TCoeffs, class TIn>
class Filters::LinFilt< TCoeffs, TIn >

Class for performing linear filtering on arbitrary data sequences.

TCoeffs is the data type of the elements in the filter coefficient arrays a and b. Internally, coefficients are stored at double precision.

TIn is the data type of the elements in the input array.

The output type TOut is derived from TCoeffs and TIn using trait classes. The internal state type TState is also derived from TCoeffs and TIn.

TCoeffs TIn gives TOut TState

float float float double float double double double float complex<float> complex<float> complex<double> float complex<double> complex<double> complex<double>

double float float double double double double double double complex<float> complex<float> complex<double> double complex<double> complex<double> complex<double>

complex<float> float complex<float> complex<double> complex<float> double complex<double> complex<double> complex<float> complex<float> complex<float> complex<double> complex<float> complex<double> complex<double> complex<double>

complex<double> float float complex<double> complex<double> double double complex<double> complex<double> complex<float> complex<float> complex<double> complex<double> complex<double> complex<double> complex<double>

Constructor & Destructor Documentation

◆ LinFilt() [1/3]

template<class TCoeffs, class TIn >
Filters::LinFilt< TCoeffs, TIn >::LinFilt ( const std::valarray< TCoeffs > &  b,
const std::valarray< TCoeffs > &  a = std::valarray< TCoeffs >( 1.0, 1 ) 
)

Construct from transfer function.

Parameters
[in]bFIR transfer function
[in]aIIR transfer function (defaults to FIR if a is not provided)

◆ LinFilt() [2/3]

template<class TCoeffs, class TIn>
Filters::LinFilt< TCoeffs, TIn >::LinFilt ( const std::valarray< TCoeffs > &  b,
const std::valarray< TCoeffs > &  a = std::valarray< TCoeffs >(1.0, 1) 
)

Construct from transfer function.

Parameters
[in]bFIR transfer function
[in]aIIR transfer function (defaults to FIR if a is not provided)

◆ LinFilt() [3/3]

template<class TCoeffs, class TIn>
Filters::LinFilt< TCoeffs, TIn >::LinFilt ( const std::valarray< TCoeffs > &  b,
const std::valarray< TCoeffs > &  a = std::valarray< TCoeffs >(1.0, 1) 
)

Construct from transfer function.

Parameters
[in]bFIR transfer function
[in]aIIR transfer function (defaults to FIR if a is not provided)

Member Function Documentation

◆ apply() [1/6]

template<class TCoeffs , class TIn >
void Filters::LinFilt< TCoeffs, TIn >::apply ( std::valarray< TOut > &  x)

In-place filter action.

Parameters
[in]xinput data for filter.
Exceptions
std::invalid_argumentx.size() == 0

◆ apply() [2/6]

template<class TCoeffs, class TIn>
void Filters::LinFilt< TCoeffs, TIn >::apply ( std::valarray< TOut > &  x)

In-place filter action.

Parameters
[in]xinput data for filter.
Exceptions
std::invalid_argumentx.size() == 0

◆ apply() [3/6]

template<class TCoeffs, class TIn>
void Filters::LinFilt< TCoeffs, TIn >::apply ( std::valarray< TOut > &  x)

In-place filter action.

Parameters
[in]xinput data for filter.
Exceptions
std::invalid_argumentx.size() == 0

◆ apply() [4/6]

template<class TCoeffs, class TIn>
void Filters::LinFilt< TCoeffs, TIn >::apply ( std::valarray< TOut > &  y,
const std::valarray< TIn > &  x 
)

Out-of-place filter action.

Parameters
[in]yresult of filter acting on in. Existing contents destroyed. param: x - input data for filter. exc: std::invalid_argument - x.size() == 0

◆ apply() [5/6]

template<class TCoeffs , class TIn>
void Filters::LinFilt< TCoeffs, TIn >::apply ( std::valarray< TOut > &  y,
const std::valarray< TIn > &  x 
)

Out-of-place filter action.

Parameters
[in]yresult of filter acting on in. Existing contents destroyed. param: x - input data for filter. exc: std::invalid_argument - x.size() == 0

◆ apply() [6/6]

template<class TCoeffs, class TIn>
void Filters::LinFilt< TCoeffs, TIn >::apply ( std::valarray< TOut > &  y,
const std::valarray< TIn > &  x 
)

Out-of-place filter action.

Parameters
[in]yresult of filter acting on in. Existing contents destroyed. param: x - input data for filter. exc: std::invalid_argument - x.size() == 0

◆ operator=() [1/3]

template<class TCoeffs , class TIn >
const LinFilt< TCoeffs, TIn > & Filters::LinFilt< TCoeffs, TIn >::operator= ( const LinFilt< TCoeffs, TIn > &  rhs)

Assignment operator.

Parameters
[in]lfLinFilt object to assign from

◆ operator=() [2/3]

template<class TCoeffs, class TIn>
const LinFilt& Filters::LinFilt< TCoeffs, TIn >::operator= ( const LinFilt< TCoeffs, TIn > &  rhs)

Assignment operator.

Parameters
[in]lfLinFilt object to assign from

◆ operator=() [3/3]

template<class TCoeffs, class TIn>
const LinFilt& Filters::LinFilt< TCoeffs, TIn >::operator= ( const LinFilt< TCoeffs, TIn > &  rhs)

Assignment operator.

Parameters
[in]lfLinFilt object to assign from

◆ reset() [1/3]

template<class TCoeffs, class TIn>
virtual void Filters::LinFilt< TCoeffs, TIn >::reset ( )
virtual

Reset the internal state to its initial condition.

This function sets the internal state information back to zero, exactly as it is when the LinFilt object is first created. This means that when the filter is next applied, data "before" the start of the series will be treated as if it were zero.

Implements Filters::LinFiltBase.

◆ reset() [2/3]

template<class TCoeffs , class TIn >
void Filters::LinFilt< TCoeffs, TIn >::reset ( )
virtual

Reset the internal state to its initial condition.

This function sets the internal state information back to zero, exactly as it is when the LinFilt object is first created. This means that when the filter is next applied, data "before" the start of the series will be treated as if it were zero.

Implements Filters::LinFiltBase.

◆ reset() [3/3]

template<class TCoeffs, class TIn>
virtual void Filters::LinFilt< TCoeffs, TIn >::reset ( )
virtual

Reset the internal state to its initial condition.

This function sets the internal state information back to zero, exactly as it is when the LinFilt object is first created. This means that when the filter is next applied, data "before" the start of the series will be treated as if it were zero.

Implements Filters::LinFiltBase.


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