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

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

#include <Resample.hh>

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

Public Types

typedef LinFiltTraits< TCoeffs, TIn >::OutType TOut
 
typedef LinFiltCoeffTraits< TCoeffs >::CoeffType TCo
 
typedef LinFiltStateTraits< TCoeffs, TIn >::StateType TState
 
typedef LinFiltTraits< TCoeffs, TIn >::OutType TOut
 
typedef LinFiltCoeffTraits< TCoeffs >::CoeffType TCo
 
typedef LinFiltStateTraits< TCoeffs, TIn >::StateType TState
 
typedef LinFiltTraits< TCoeffs, TIn >::OutType TOut
 
typedef LinFiltCoeffTraits< TCoeffs >::CoeffType TCo
 
typedef LinFiltStateTraits< TCoeffs, TIn >::StateType TState
 

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. More...
 
const LinFiltoperator= (const LinFilt &rhs)
 Assignment operator. More...
 
bool operator== (const LinFilt &rhs)
 
virtual LinFiltClone () const
 
void getB (std::valarray< TCoeffs > &b) const
 Get FIR coefficients. More...
 
size_t getBSize () const
 Get FIR size. More...
 
void getA (std::valarray< TCoeffs > &a) const
 Get IIR coefficients. More...
 
size_t getASize () const
 Get IIR size. More...
 
void getZ (std::valarray< TState > &z) const
 Get state vector. More...
 
size_t getZSize () const
 Get state size. More...
 
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. More...
 
const LinFiltoperator= (const LinFilt &rhs)
 Assignment operator. More...
 
bool operator== (const LinFilt &rhs)
 
virtual LinFiltClone () const
 
void getB (std::valarray< TCoeffs > &b) const
 Get FIR coefficients. More...
 
size_t getBSize () const
 Get FIR size. More...
 
void getA (std::valarray< TCoeffs > &a) const
 Get IIR coefficients. More...
 
size_t getASize () const
 Get IIR size. More...
 
void getZ (std::valarray< TState > &z) const
 Get state vector. More...
 
size_t getZSize () const
 Get state size. More...
 
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. More...
 
const LinFiltoperator= (const LinFilt &rhs)
 Assignment operator. More...
 
bool operator== (const LinFilt &rhs)
 
virtual LinFiltClone () const
 
void getB (std::valarray< TCoeffs > &b) const
 Get FIR coefficients. More...
 
size_t getBSize () const
 Get FIR size. More...
 
void getA (std::valarray< TCoeffs > &a) const
 Get IIR coefficients. More...
 
size_t getASize () const
 Get IIR size. More...
 
void getZ (std::valarray< TState > &z) const
 Get state vector. More...
 
size_t getZSize () const
 Get state size. More...
 
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...
 

Private Member Functions

 LinFilt ()
 Default constructor private. More...
 
 LinFilt ()
 Default constructor private. More...
 
 LinFilt ()
 Default constructor private. More...
 

Private Attributes

std::valarray< TCom_b
 FIR coefficients. More...
 
std::valarray< TCom_a
 IIR coefficients. More...
 
std::valarray< TStatem_z
 State information. 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>

Member Typedef Documentation

◆ TCo [1/3]

template<class TCoeffs, class TIn>
typedef LinFiltCoeffTraits< TCoeffs >::CoeffType Filters::LinFilt< TCoeffs, TIn >::TCo

◆ TCo [2/3]

template<class TCoeffs, class TIn>
typedef LinFiltCoeffTraits< TCoeffs >::CoeffType Filters::LinFilt< TCoeffs, TIn >::TCo

◆ TCo [3/3]

template<class TCoeffs, class TIn>
typedef LinFiltCoeffTraits< TCoeffs >::CoeffType Filters::LinFilt< TCoeffs, TIn >::TCo

◆ TOut [1/3]

template<class TCoeffs, class TIn>
typedef LinFiltTraits< TCoeffs, TIn >::OutType Filters::LinFilt< TCoeffs, TIn >::TOut

◆ TOut [2/3]

template<class TCoeffs, class TIn>
typedef LinFiltTraits< TCoeffs, TIn >::OutType Filters::LinFilt< TCoeffs, TIn >::TOut

◆ TOut [3/3]

template<class TCoeffs, class TIn>
typedef LinFiltTraits< TCoeffs, TIn >::OutType Filters::LinFilt< TCoeffs, TIn >::TOut

◆ TState [1/3]

template<class TCoeffs, class TIn>
typedef LinFiltStateTraits< TCoeffs, TIn >::StateType Filters::LinFilt< TCoeffs, TIn >::TState

◆ TState [2/3]

template<class TCoeffs, class TIn>
typedef LinFiltStateTraits< TCoeffs, TIn >::StateType Filters::LinFilt< TCoeffs, TIn >::TState

◆ TState [3/3]

template<class TCoeffs, class TIn>
typedef LinFiltStateTraits< TCoeffs, TIn >::StateType Filters::LinFilt< TCoeffs, TIn >::TState

Constructor & Destructor Documentation

◆ LinFilt() [1/6]

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() [1/3]

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

Destructor.

◆ LinFilt() [2/6]

template<class TCoeffs, class TIn>
Filters::LinFilt< TCoeffs, TIn >::LinFilt ( )
private

Default constructor private.

◆ LinFilt() [3/6]

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>
virtual Filters::LinFilt< TCoeffs, TIn >::~LinFilt ( )
virtual

Destructor.

◆ LinFilt() [4/6]

template<class TCoeffs, class TIn>
Filters::LinFilt< TCoeffs, TIn >::LinFilt ( )
private

Default constructor private.

◆ LinFilt() [5/6]

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>
virtual Filters::LinFilt< TCoeffs, TIn >::~LinFilt ( )
virtual

Destructor.

◆ LinFilt() [6/6]

template<class TCoeffs, class TIn>
Filters::LinFilt< TCoeffs, TIn >::LinFilt ( )
private

Default constructor private.

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

◆ Clone() [1/3]

template<class TCoeffs , class TIn >
LinFilt< TCoeffs, TIn > * Filters::LinFilt< TCoeffs, TIn >::Clone ( ) const
virtual

Implements Filters::LinFiltBase.

◆ Clone() [2/3]

template<class TCoeffs, class TIn>
virtual LinFilt* Filters::LinFilt< TCoeffs, TIn >::Clone ( ) const
virtual

Implements Filters::LinFiltBase.

◆ Clone() [3/3]

template<class TCoeffs, class TIn>
virtual LinFilt* Filters::LinFilt< TCoeffs, TIn >::Clone ( ) const
virtual

Implements Filters::LinFiltBase.

◆ getA() [1/3]

template<class TCoeffs, class TIn>
void Filters::LinFilt< TCoeffs, TIn >::getA ( std::valarray< TCoeffs > &  a) const

Get IIR coefficients.

◆ getA() [2/3]

template<class TCoeffs, class TIn >
void Filters::LinFilt< TCoeffs, TIn >::getA ( std::valarray< TCoeffs > &  a) const

Get IIR coefficients.

◆ getA() [3/3]

template<class TCoeffs, class TIn>
void Filters::LinFilt< TCoeffs, TIn >::getA ( std::valarray< TCoeffs > &  a) const

Get IIR coefficients.

◆ getASize() [1/3]

template<class TCoeffs, class TIn>
size_t Filters::LinFilt< TCoeffs, TIn >::getASize ( ) const

Get IIR size.

◆ getASize() [2/3]

template<class TCoeffs, class TIn>
size_t Filters::LinFilt< TCoeffs, TIn >::getASize ( ) const

Get IIR size.

◆ getASize() [3/3]

template<class TCoeffs , class TIn >
size_t Filters::LinFilt< TCoeffs, TIn >::getASize ( ) const
inline

Get IIR size.

◆ getB() [1/3]

template<class TCoeffs, class TIn>
void Filters::LinFilt< TCoeffs, TIn >::getB ( std::valarray< TCoeffs > &  b) const

Get FIR coefficients.

◆ getB() [2/3]

template<class TCoeffs, class TIn >
void Filters::LinFilt< TCoeffs, TIn >::getB ( std::valarray< TCoeffs > &  b) const

Get FIR coefficients.

◆ getB() [3/3]

template<class TCoeffs, class TIn>
void Filters::LinFilt< TCoeffs, TIn >::getB ( std::valarray< TCoeffs > &  b) const

Get FIR coefficients.

◆ getBSize() [1/3]

template<class TCoeffs, class TIn>
size_t Filters::LinFilt< TCoeffs, TIn >::getBSize ( ) const

Get FIR size.

◆ getBSize() [2/3]

template<class TCoeffs , class TIn >
size_t Filters::LinFilt< TCoeffs, TIn >::getBSize ( ) const
inline

Get FIR size.

◆ getBSize() [3/3]

template<class TCoeffs, class TIn>
size_t Filters::LinFilt< TCoeffs, TIn >::getBSize ( ) const

Get FIR size.

◆ getZ() [1/3]

template<class TCoeffs, class TIn>
void Filters::LinFilt< TCoeffs, TIn >::getZ ( std::valarray< TState > &  z) const

Get state vector.

◆ getZ() [2/3]

template<class TCoeffs , class TIn >
void Filters::LinFilt< TCoeffs, TIn >::getZ ( std::valarray< TState > &  z) const

Get state vector.

◆ getZ() [3/3]

template<class TCoeffs, class TIn>
void Filters::LinFilt< TCoeffs, TIn >::getZ ( std::valarray< TState > &  z) const

Get state vector.

◆ getZSize() [1/3]

template<class TCoeffs, class TIn>
size_t Filters::LinFilt< TCoeffs, TIn >::getZSize ( ) const

Get state size.

◆ getZSize() [2/3]

template<class TCoeffs , class TIn >
size_t Filters::LinFilt< TCoeffs, TIn >::getZSize ( ) const
inline

Get state size.

◆ getZSize() [3/3]

template<class TCoeffs, class TIn>
size_t Filters::LinFilt< TCoeffs, TIn >::getZSize ( ) const

Get state size.

◆ 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

◆ operator==() [1/3]

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

◆ operator==() [2/3]

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

◆ operator==() [3/3]

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

◆ 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.

Member Data Documentation

◆ m_a

template<class TCoeffs, class TIn>
std::valarray< TCo > Filters::LinFilt< TCoeffs, TIn >::m_a
private

IIR coefficients.

◆ m_b

template<class TCoeffs, class TIn>
std::valarray< TCo > Filters::LinFilt< TCoeffs, TIn >::m_b
private

FIR coefficients.

◆ m_z

template<class TCoeffs, class TIn>
std::valarray< TState > Filters::LinFilt< TCoeffs, TIn >::m_z
private

State information.


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