59 const double nyquist = dSFreq / 2.0;
61 double dCenterfreq = 0.0;
62 double dBandwidth = 0.0;
63 const double dParkswidth = dTransition / nyquist;
65 int iFilterType =
static_cast<int>(type);
70 dCenterfreq = dCutoffLow / nyquist;
75 dCenterfreq = (dCutoffLow + dCutoffHigh) / dSFreq;
76 dBandwidth = (dCutoffHigh - dCutoffLow) / nyquist;
82 case LowPass: sName = QStringLiteral(
"LP_%1Hz").arg(dCutoffLow);
break;
83 case HighPass: sName = QStringLiteral(
"HP_%1Hz").arg(dCutoffLow);
break;
84 case BandPass: sName = QStringLiteral(
"BP_%1-%2Hz").arg(dCutoffLow).arg(dCutoffHigh);
break;
85 case BandStop: sName = QStringLiteral(
"BS_%1-%2Hz").arg(dCutoffLow).arg(dCutoffHigh);
break;
95 static_cast<int>(method));
103 RowVectorXd work = vecData;
114 RowVectorXd work = vecData;
118 RowVectorXd rev = work.reverse();
121 return rev.reverse();
128 const RowVectorXi& vecPicks)
130 MatrixXd result = matData;
132 if (vecPicks.size() == 0) {
134 for (
int i = 0; i < result.rows(); ++i) {
135 RowVectorXd row = result.row(i);
139 for (
int k = 0; k < vecPicks.size(); ++k) {
141 if (i < 0 || i >= result.rows())
continue;
142 RowVectorXd row = result.row(i);
Discoverable design / apply façade over the FilterKernel FIR engine.
Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).
The FilterKernel class provides methods to create/design a FIR filter kernel.
void applyFftFilter(Eigen::RowVectorXd &vecData, bool bKeepOverhead=false)
FilterType
FIR filter type — mirrors IirFilter::FilterType for a uniform API.
static Eigen::MatrixXd applyZeroPhaseMatrix(const Eigen::MatrixXd &matData, FilterKernel &kernel, const Eigen::RowVectorXi &vecPicks=Eigen::RowVectorXi())
DesignMethod
FIR design method — wraps FilterKernel's iDesignMethod integer codes.
static Eigen::RowVectorXd applyZeroPhase(const Eigen::RowVectorXd &vecData, FilterKernel &kernel)
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)