A C++ library mirroring some of the most common Matlab functions.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
mcl::IirFilter Class Reference

#include <iirfilter.h>

Inheritance diagram for mcl::IirFilter:

Public Member Functions

 IirFilter ()
 IirFilter (std::vector< Real > B, std::vector< Real > A)
virtual Real Filter (const Real input) noexcept
virtual void Filter (const Real *input_data, const Int num_samples, Real *output_data) noexcept
Int order () const noexcept
void SetCoefficients (const std::vector< Real > &B, const std::vector< Real > &A) noexcept
void SetCoefficients (const IirFilter &filter) noexcept
Real GetNumeratorCoefficient (const Int coeff_id) const noexcept
Real GetDenominatorCoefficient (const Int coeff_id) const noexcept
void SetNumeratorCoefficient (const Int coeff_id, const Real value) noexcept
void SetDenominatorCoefficient (const Int coeff_id, const Real value) noexcept
std::vector< RealB () const
std::vector< RealA () const
void Reset ()
IirFilteroperator= (const IirFilter &)
 IirFilter (const IirFilter &)
virtual ~IirFilter ()
- Public Member Functions inherited from mcl::DigitalFilter
void FilterSerial (const Real *input_data, const Int num_samples, Real *output_data) noexcept
std::vector< RealFilter (const std::vector< Real > &input) noexcept
virtual ~DigitalFilter ()

Static Public Member Functions

static bool Test ()

Detailed Description

IIR Filter

Constructor & Destructor Documentation

mcl::IirFilter::IirFilter ( )

Constructs a default filter, i.e. identical filter

mcl::IirFilter::IirFilter ( std::vector< Real B,
std::vector< Real A 

Constructs an IIR filter (II-type direct implementation). B and A are numerator and denominator of the filter, respectively.

mcl::IirFilter::IirFilter ( const IirFilter copy)

Copy operator

mcl::IirFilter::~IirFilter ( )

Member Function Documentation

std::vector< Real > mcl::IirFilter::A ( ) const

Returns the backward coefficients

std::vector< Real > mcl::IirFilter::B ( ) const

Returns the forward coefficients

Real mcl::IirFilter::Filter ( const Real  input)

Returns the output of the filter for an input equal to input. For example, if B=1, A=1, output will be equal to input. As a second example, if B=[0,1], A=[1, 0], you will have (1) Filter(0.5)==0 and then (2) Filter(0.0)==0.5

Implements mcl::DigitalFilter.

void mcl::IirFilter::Filter ( const Real input_data,
const Int  num_samples,
Real output_data 

Reimplemented from mcl::DigitalFilter.

Real mcl::IirFilter::GetDenominatorCoefficient ( const Int  coeff_id) const
Real mcl::IirFilter::GetNumeratorCoefficient ( const Int  coeff_id) const
IirFilter & mcl::IirFilter::operator= ( const IirFilter other)

Assignment operator

Int mcl::IirFilter::order ( ) const

Returns the order of the filter.

void mcl::IirFilter::Reset ( )

Resets the state of the filter

Implements mcl::DigitalFilter.

void mcl::IirFilter::SetCoefficients ( const std::vector< Real > &  B,
const std::vector< Real > &  A 

Updates the filter coefficients. May cause articafts if the coefficients are updated too rapidly.

void mcl::IirFilter::SetCoefficients ( const IirFilter filter)

Sets the coefficients as identical to those of another filter.

void mcl::IirFilter::SetDenominatorCoefficient ( const Int  coeff_id,
const Real  value 
void mcl::IirFilter::SetNumeratorCoefficient ( const Int  coeff_id,
const Real  value 
bool mcl::IirFilter::Test ( )


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