aimsalgo 6.0.0
Neuroimaging image processing
aims::SymAllPoleIIRFilter Class Reference

Symmetric, all-pole, infinite impulse response Filter. More...

#include <aims/signalfilter/iirfilter.h>

Inheritance diagram for aims::SymAllPoleIIRFilter:
Collaboration diagram for aims::SymAllPoleIIRFilter:

Public Member Functions

 SymAllPoleIIRFilter (const double gain=0., const std::vector< double > &poles=std::vector< double >())
 Constructor / Destructor / Copy.
 
 SymAllPoleIIRFilter (const SymAllPoleIIRFilter &other)
 
virtual ~SymAllPoleIIRFilter ()
 
SymAllPoleIIRFilteroperator= (const SymAllPoleIIRFilter &other)
 
virtual void filter1d (const carto::VolumeRef< double > in, carto::VolumeRef< double > out, int dir=-1) const
 Execution.
 
const double & gain () const
 Parameters.
 
const std::vector< double > & poles () const
 
void setPoles (const std::vector< double > &poles)
 
void addPole (const double &pole)
 
void setGain (const double &gain)
 Relative to Unser & al, gain = c0.
 
void setModePreciseGain (bool precise=true)
 If this mode is activated, provided gain should be c * prod(-poles).
 
- Public Member Functions inherited from aims::IIRFilterBase
 IIRFilterBase ()
 Constructor / Destructor / Copy.
 
 IIRFilterBase (const IIRFilterBase &other)
 
virtual ~IIRFilterBase ()
 
IIRFilterBaseoperator= (const IIRFilterBase &other)
 
template<typename T>
carto::VolumeRef< double > execute (const carto::VolumeRef< T > &in) const
 Execution.
 
carto::VolumeRef< double > execute (carto::VolumeRef< double > &in, bool inplace=false) const
 
virtual const std::vector< bool > & directions () const
 Parameters.
 
virtual void setDirections (const std::vector< bool > &dir)
 
virtual void setDirections (bool dirx, bool diry, bool dirz, bool dirt)
 
virtual void setDirectionX (bool dirx)
 default: true
 
virtual void setDirectionY (bool diry)
 default: true
 
virtual void setDirectionZ (bool dirz)
 default: true
 
virtual void setDirectionT (bool dirt)
 default: false
 
virtual const FilterType::Boundaryboundary () const
 Because the filter is infinite, the signal must be extended outisde the image domain.
 
virtual void setBoundary (const FilterType::Boundary &boundary)
 
virtual void setVerbose (int verbose=1)
 Verbosity level.
 
virtual void setQuiet ()
 Set verbosity level to 0 -> Remove all possible traces.
 

Protected Member Functions

void computeK0 ()
 Helpers.
 
void computePreciseGain ()
 
- Protected Member Functions inherited from aims::IIRFilterBase
virtual void filter (carto::VolumeRef< double > vol) const
 Helpers.
 
virtual void filter1d (carto::VolumeRef< double > vol, int dir=-1, carto::VolumeRef< double > tmp=carto::VolumeRef< double >((carto::Volume< double > *) 0)) const
 redirection for in place fitlering
 
virtual double & at (carto::VolumeRef< double > &vector, long k, int dir) const
 Fast access : k must be in [0, size-1].
 
virtual const double & at (const carto::VolumeRef< double > &vector, long k, int dir) const
 Fast access : k must be in [0, size-1].
 
virtual double at (const carto::VolumeRef< double > &vector, long k, int dir, long fullsize, int binf) const
 Mirror access : k can be outside [0, size - 1].
 
virtual long mirrorCoeff (long i, long size) const
 If i is outside [0, size-1], it is mirrored to fall inside.
 
virtual long selectCoeff (long i, long fullsize, int binf) const
 If i is outside [binf, fullsize-1], it is mirrored to fall inside.
 
virtual long computeK0 (double pole, double tolerance=-1.) const
 compute K0 so that pole^K0 < precision
 

Protected Attributes

std::vector< double > _poles
 
std::vector< long > _k0
 
double _gain
 
double _precisegain
 
bool _precise
 
- Protected Attributes inherited from aims::IIRFilterBase
int _verbose
 
std::vector< bool > _dir
 
FilterType::Boundary _boundary
 
FilterType::CopyType _copy
 

Detailed Description

Symmetric, all-pole, infinite impulse response Filter.

Special case of Infinite Impulse Response filter: Separable filter whose transfer function is of the form H(z) = c / P(z) with the coefficients of P symmetric, i.e. p(k) = p(-k)

This implementation follows that of Unser, Aldroubi & Eden, "B-Spline Signal Processing: Part II - Efficient Design and Applications" in IEEE Transactions on Signal Processing (1993)

To diminish rounding errors, it is possible to give the gain value c * prod( -p(k) ) instead of c, and enable the precise mode with setModePreciseGain().

Note
If borders are allocated, they will be used, else inside values will be mirrored in the outside. However, for spline interpolation, note that border values should mirror inside values. It is the caller role to ensure that eventual borders are properly filled.

Definition at line 417 of file iirfilter.h.

Constructor & Destructor Documentation

◆ SymAllPoleIIRFilter() [1/2]

aims::SymAllPoleIIRFilter::SymAllPoleIIRFilter ( const double gain = 0.,
const std::vector< double > & poles = std::vector< double >() )

Constructor / Destructor / Copy.

References gain(), and poles().

Referenced by operator=(), and SymAllPoleIIRFilter().

◆ SymAllPoleIIRFilter() [2/2]

aims::SymAllPoleIIRFilter::SymAllPoleIIRFilter ( const SymAllPoleIIRFilter & other)

References SymAllPoleIIRFilter().

◆ ~SymAllPoleIIRFilter()

virtual aims::SymAllPoleIIRFilter::~SymAllPoleIIRFilter ( )
virtual

Member Function Documentation

◆ addPole()

void aims::SymAllPoleIIRFilter::addPole ( const double & pole)

◆ computeK0()

void aims::SymAllPoleIIRFilter::computeK0 ( )
protected

Helpers.

◆ computePreciseGain()

void aims::SymAllPoleIIRFilter::computePreciseGain ( )
protected

◆ filter1d()

virtual void aims::SymAllPoleIIRFilter::filter1d ( const carto::VolumeRef< double > in,
carto::VolumeRef< double > out,
int dir = -1 ) const
virtual

Execution.

Implements aims::IIRFilterBase.

◆ gain()

const double & aims::SymAllPoleIIRFilter::gain ( ) const

Parameters.

Referenced by setGain(), and SymAllPoleIIRFilter().

◆ operator=()

SymAllPoleIIRFilter & aims::SymAllPoleIIRFilter::operator= ( const SymAllPoleIIRFilter & other)

References SymAllPoleIIRFilter().

◆ poles()

const std::vector< double > & aims::SymAllPoleIIRFilter::poles ( ) const

Referenced by setPoles(), and SymAllPoleIIRFilter().

◆ setGain()

void aims::SymAllPoleIIRFilter::setGain ( const double & gain)

Relative to Unser & al, gain = c0.

References gain().

◆ setModePreciseGain()

void aims::SymAllPoleIIRFilter::setModePreciseGain ( bool precise = true)

If this mode is activated, provided gain should be c * prod(-poles).

This allows to avoid some floating points operations, which is especially useful at high orders. Default value at construction is false.

◆ setPoles()

void aims::SymAllPoleIIRFilter::setPoles ( const std::vector< double > & poles)

References poles().

Member Data Documentation

◆ _gain

double aims::SymAllPoleIIRFilter::_gain
protected

Definition at line 468 of file iirfilter.h.

◆ _k0

std::vector<long> aims::SymAllPoleIIRFilter::_k0
protected

Definition at line 467 of file iirfilter.h.

◆ _poles

std::vector<double> aims::SymAllPoleIIRFilter::_poles
protected

Definition at line 466 of file iirfilter.h.

◆ _precise

bool aims::SymAllPoleIIRFilter::_precise
protected

Definition at line 470 of file iirfilter.h.

◆ _precisegain

double aims::SymAllPoleIIRFilter::_precisegain
protected

Definition at line 469 of file iirfilter.h.


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