FilterKernel
Namespace: RTPROCESSINGLIB · Library: DSP Library
mne.filter.create_filter in MNE-Python.
#include <dsp/filterkernel.h>
class UTILSLIB::FilterKernel
The FilterKernel class provides methods to create/design a FIR filter kernel.
The FilterKernel class provides methods to create/design a FIR filter kernel
Public Methods
FilterKernel()
FilterKernel creates a default FilterKernel object.
FilterKernel(sFilterName, iFilterType, iOrder, dCenterfreq, dBandwidth, dParkswidth, dSFreq, iDesignMethod)
Constructs a FilterKernel object.
Parameters:
-
sFilterName : const QString & Defines the name of the generated filter.
-
type Tyep of the filter: LPF, HPF, BPF, NOTCH (from enum FilterType).
-
iOrder : int Represents the order of the filter, the higher the higher is the stopband attenuation.
-
dCenterfreq : double Determines the center of the frequency - normed to sFreq/2 (nyquist).
-
dBandwidth : double Ignored if FilterType is set to LPF,HPF. if NOTCH/BPF: bandwidth of stop-/passband - normed to sFreq/2 (nyquist).
-
dParkswidth : double Determines the width of the filter slopes (steepness) - normed to sFreq/2 (nyquist).
-
dSFreq : double The sampling frequency.
-
designMethod Specifies the design method to use. Choose between Cosind and Tschebyscheff.
prepareFilter(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:
- iDataSize : int The data size to setup the filters to.
applyConvFilter(vecData, bKeepOverhead)
Applies the current filter to the input data using convolution in time domain.
Parameters:
-
vecData : const Eigen::RowVectorXd & Holds the data to be filtered.
-
bKeepOverhead : bool Whether the result should still include the overhead information in front and back of the data. Default is set to false.
Returns:
- Eigen::RowVectorXd — the filtered data in form of a RowVectorXd.
applyFftFilter(vecData, bKeepOverhead)
Applies the current filter to the input data using multiplication in frequency domain.
Parameters:
-
vecData : Eigen::RowVectorXd & Holds the data to be filtered. Gets overwritten with its filtered result.
-
bKeepOverhead : bool Whether the result should still include the overhead information in front and back of the data. Default is set to false.
Returns:
- void — the filtered data in form of a RowVectorXd.