v2.0.0
Loading...
Searching...
No Matches
UTILSLIB::FilterKernel Class Reference

The FilterKernel class provides methods to create/design a FIR filter kernel. More...

#include <filterkernel.h>

Public Member Functions

 FilterKernel ()
 FilterKernel creates a default FilterKernel object.
 FilterKernel (const QString &sFilterName, int iFilterType, int iOrder, double dCenterfreq, double dBandwidth, double dParkswidth, double dSFreq, int iDesignMethod)
void prepareFilter (int iDataSize)
Eigen::RowVectorXd applyConvFilter (const Eigen::RowVectorXd &vecData, bool bKeepOverhead=false) const
void applyFftFilter (Eigen::RowVectorXd &vecData, bool bKeepOverhead=false)
QString getName () const
void setName (const QString &sFilterName)
double getSamplingFrequency () const
void setSamplingFrequency (double dSFreq)
int getFilterOrder () const
void setFilterOrder (int iOrder)
double getCenterFrequency () const
void setCenterFrequency (double dCenterFreq)
double getBandwidth () const
void setBandwidth (double dBandwidth)
double getParksWidth () const
void setParksWidth (double dParksWidth)
double getHighpassFreq () const
void setHighpassFreq (double dHighpassFreq)
double getLowpassFreq () const
void setLowpassFreq (double dLowpassFreq)
Eigen::RowVectorXd getCoefficients () const
void setCoefficients (const Eigen::RowVectorXd &vecCoeff)
Eigen::RowVectorXcd getFftCoefficients () const
void setFftCoefficients (const Eigen::RowVectorXcd &vecFftCoeff)
FilterParameter getDesignMethod () const
void setDesignMethod (int iDesignMethod)
FilterParameter getFilterType () const
void setFilterType (int iFilterType)
QString getShortDescription () const

Static Public Attributes

static QVector< FilterParameterm_designMethods
static QVector< FilterParameterm_filterTypes

Detailed Description

The FilterKernel class provides methods to create/design a FIR filter kernel.

The FilterKernel class provides methods to create/design a FIR filter kernel

Definition at line 132 of file filterkernel.h.

Constructor & Destructor Documentation

◆ FilterKernel() [1/2]

FilterKernel::FilterKernel ( )

FilterKernel creates a default FilterKernel object.

Definition at line 94 of file filterkernel.cpp.

◆ FilterKernel() [2/2]

FilterKernel::FilterKernel ( const QString & sFilterName,
int iFilterType,
int iOrder,
double dCenterfreq,
double dBandwidth,
double dParkswidth,
double dSFreq,
int iDesignMethod )

Constructs a FilterKernel object

Parameters
[in]sFilterNameDefines the name of the generated filter.
[in]typeTyep of the filter: LPF, HPF, BPF, NOTCH (from enum FilterType).
[in]iOrderRepresents the order of the filter, the higher the higher is the stopband attenuation.
[in]dCenterfreqDetermines the center of the frequency - normed to sFreq/2 (nyquist).
[in]dBandwidthIgnored if FilterType is set to LPF,HPF. if NOTCH/BPF: bandwidth of stop-/passband - normed to sFreq/2 (nyquist).
[in]dParkswidthDetermines the width of the filter slopes (steepness) - normed to sFreq/2 (nyquist).
[in]dSFreqThe sampling frequency.
[in]designMethodSpecifies the design method to use. Choose between Cosind and Tschebyscheff.

Definition at line 112 of file filterkernel.cpp.

Member Function Documentation

◆ applyConvFilter()

RowVectorXd FilterKernel::applyConvFilter ( const Eigen::RowVectorXd & vecData,
bool bKeepOverhead = false ) const

Applies the current filter to the input data using convolution in time domain.

Parameters
[in]vecDataHolds the data to be filtered.
[in]bKeepOverheadWhether the result should still include the overhead information in front and back of the data. Default is set to false.
Returns
the filtered data in form of a RowVectorXd.

Definition at line 155 of file filterkernel.cpp.

◆ applyFftFilter()

void FilterKernel::applyFftFilter ( Eigen::RowVectorXd & vecData,
bool bKeepOverhead = false )

Applies the current filter to the input data using multiplication in frequency domain.

Parameters
[in,out]vecDataHolds the data to be filtered. Gets overwritten with its filtered result.
[in]bKeepOverheadWhether the result should still include the overhead information in front and back of the data. Default is set to false.
Returns
the filtered data in form of a RowVectorXd.

Definition at line 179 of file filterkernel.cpp.

◆ getBandwidth()

double FilterKernel::getBandwidth ( ) const

Definition at line 284 of file filterkernel.cpp.

◆ getCenterFrequency()

double FilterKernel::getCenterFrequency ( ) const

Definition at line 270 of file filterkernel.cpp.

◆ getCoefficients()

Eigen::RowVectorXd FilterKernel::getCoefficients ( ) const

Definition at line 340 of file filterkernel.cpp.

◆ getDesignMethod()

UTILSLIB::FilterParameter FilterKernel::getDesignMethod ( ) const

Definition at line 506 of file filterkernel.cpp.

◆ getFftCoefficients()

Eigen::RowVectorXcd FilterKernel::getFftCoefficients ( ) const

Definition at line 354 of file filterkernel.cpp.

◆ getFilterOrder()

int FilterKernel::getFilterOrder ( ) const

Definition at line 256 of file filterkernel.cpp.

◆ getFilterType()

UTILSLIB::FilterParameter FilterKernel::getFilterType ( ) const

Definition at line 516 of file filterkernel.cpp.

◆ getHighpassFreq()

double FilterKernel::getHighpassFreq ( ) const

Definition at line 312 of file filterkernel.cpp.

◆ getLowpassFreq()

double FilterKernel::getLowpassFreq ( ) const

Definition at line 326 of file filterkernel.cpp.

◆ getName()

QString FilterKernel::getName ( ) const

Definition at line 228 of file filterkernel.cpp.

◆ getParksWidth()

double FilterKernel::getParksWidth ( ) const

Definition at line 298 of file filterkernel.cpp.

◆ getSamplingFrequency()

double FilterKernel::getSamplingFrequency ( ) const

Definition at line 242 of file filterkernel.cpp.

◆ getShortDescription()

QString FilterKernel::getShortDescription ( ) const

Definition at line 496 of file filterkernel.cpp.

◆ prepareFilter()

void FilterKernel::prepareFilter ( int iDataSize)

Prepares a filter kernel to be used wiht a specific data block length. This is favorable to call before filtering, in order to avoid transforming the filter coefficients anew during filtering. This functions was introduced since one does not always know the data length of the data blocks to be filtered when designing the filter.

Parameters
[in]iDataSizeThe data size to setup the filters to.

Definition at line 139 of file filterkernel.cpp.

◆ setBandwidth()

void FilterKernel::setBandwidth ( double dBandwidth)

Definition at line 291 of file filterkernel.cpp.

◆ setCenterFrequency()

void FilterKernel::setCenterFrequency ( double dCenterFreq)

Definition at line 277 of file filterkernel.cpp.

◆ setCoefficients()

void FilterKernel::setCoefficients ( const Eigen::RowVectorXd & vecCoeff)

Definition at line 347 of file filterkernel.cpp.

◆ setDesignMethod()

void FilterKernel::setDesignMethod ( int iDesignMethod)

Definition at line 526 of file filterkernel.cpp.

◆ setFftCoefficients()

void FilterKernel::setFftCoefficients ( const Eigen::RowVectorXcd & vecFftCoeff)

Definition at line 361 of file filterkernel.cpp.

◆ setFilterOrder()

void FilterKernel::setFilterOrder ( int iOrder)

Definition at line 263 of file filterkernel.cpp.

◆ setFilterType()

void FilterKernel::setFilterType ( int iFilterType)

Definition at line 537 of file filterkernel.cpp.

◆ setHighpassFreq()

void FilterKernel::setHighpassFreq ( double dHighpassFreq)

Definition at line 319 of file filterkernel.cpp.

◆ setLowpassFreq()

void FilterKernel::setLowpassFreq ( double dLowpassFreq)

Definition at line 333 of file filterkernel.cpp.

◆ setName()

void FilterKernel::setName ( const QString & sFilterName)

Definition at line 235 of file filterkernel.cpp.

◆ setParksWidth()

void FilterKernel::setParksWidth ( double dParksWidth)

Definition at line 305 of file filterkernel.cpp.

◆ setSamplingFrequency()

void FilterKernel::setSamplingFrequency ( double dSFreq)

Definition at line 249 of file filterkernel.cpp.

Member Data Documentation

◆ m_designMethods

QVector< UTILSLIB::FilterParameter > FilterKernel::m_designMethods
static

Vector of possible filter design methods.

Definition at line 240 of file filterkernel.h.

◆ m_filterTypes

QVector< UTILSLIB::FilterParameter > FilterKernel::m_filterTypes
static

Vector of possible filter design types.

Definition at line 241 of file filterkernel.h.


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