Discoverable façade over the FilterKernel FIR-filter engine. More...
#include <firfilter.h>
Public Types | |
| enum | FilterType { LowPass = 0 , HighPass = 1 , BandPass = 2 , BandStop = 3 } |
| FIR filter type — mirrors IirFilter::FilterType for a uniform API. More... | |
| enum | DesignMethod { Cosine = 0 , ParksMcClellan = 1 } |
| FIR design method — wraps FilterKernel's iDesignMethod integer codes. More... | |
Static Public Member Functions | |
| static FilterKernel | design (int iOrder, FilterType type, double dCutoffLow, double dCutoffHigh, double dSFreq, double dTransition=5.0, DesignMethod method=Cosine) |
| static Eigen::RowVectorXd | apply (const Eigen::RowVectorXd &vecData, FilterKernel &kernel) |
| static Eigen::RowVectorXd | applyZeroPhase (const Eigen::RowVectorXd &vecData, FilterKernel &kernel) |
| static Eigen::MatrixXd | applyZeroPhaseMatrix (const Eigen::MatrixXd &matData, FilterKernel &kernel, const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi()) |
Discoverable façade over the FilterKernel FIR-filter engine.
Quick-start example — mirrors the IirFilter API:
Definition at line 79 of file firfilter.h.
FIR design method — wraps FilterKernel's iDesignMethod integer codes.
| Enumerator | |
|---|---|
| Cosine | Cosine window (fast, moderate roll-off). |
| ParksMcClellan | Equiripple Parks-McClellan (optimal minimax). |
Definition at line 97 of file firfilter.h.
FIR filter type — mirrors IirFilter::FilterType for a uniform API.
| Enumerator | |
|---|---|
| LowPass | Low-pass filter. |
| HighPass | High-pass filter. |
| BandPass | Band-pass filter. |
| BandStop | Band-stop (notch) filter. |
Definition at line 86 of file firfilter.h.
|
static |
Apply the filter to a single row vector.
Uses overlap-add FFT convolution. The group delay of a symmetric FIR is removed by the FilterKernel engine (it takes the output segment starting at order/2), so the result is already approximately zero-phase for symmetric designs.
| [in] | vecData | Input row vector. |
| [in,out] | kernel | FilterKernel (prepareFilter is called if needed). |
Definition at line 121 of file firfilter.cpp.
|
static |
Apply the filter in a zero-phase forward-backward pass to a single row vector.
Runs the filter twice (forward then reverse) to achieve exactly zero phase shift. Effective order is doubled; transition bandwidth is halved.
| [in] | vecData | Input row vector. |
| [in,out] | kernel | FilterKernel. |
Definition at line 131 of file firfilter.cpp.
|
static |
Apply the filter in a zero-phase forward-backward pass to every row of a matrix.
| [in] | matData | Input matrix (n_channels × n_samples). |
| [in,out] | kernel | FilterKernel. |
| [in] | vecPicks | Optional row indices to filter; if empty, all rows are filtered. |
Definition at line 147 of file firfilter.cpp.
|
static |
Design a linear-phase FIR filter using FilterKernel as the backend.
Frequencies are given in Hz; the method converts them to the Nyquist-normalised form expected by FilterKernel internally.
| [in] | iOrder | Filter order (number of taps − 1). Must be even for linear phase. |
| [in] | type | Filter type (LowPass, HighPass, BandPass, BandStop). |
| [in] | dCutoffLow | Lower cutoff frequency in Hz. For LowPass/HighPass: the single cutoff. For BandPass/BandStop: lower edge of the transition band. |
| [in] | dCutoffHigh | Upper cutoff frequency in Hz (ignored for LowPass/HighPass). |
| [in] | dSFreq | Sampling frequency in Hz. |
| [in] | dTransition | Width of the transition band in Hz (Parks-McClellan steepness / Cosine roll-off width). Defaults to 5 Hz. |
| [in] | method | Design method (Cosine or ParksMcClellan). |
Definition at line 63 of file firfilter.cpp.