v2.0.0
Loading...
Searching...
No Matches
iirfilter.h
Go to the documentation of this file.
1//=============================================================================================================
31
32#ifndef IIRFILTER_DSP_H
33#define IIRFILTER_DSP_H
34
35//=============================================================================================================
36// INCLUDES
37//=============================================================================================================
38
39#include "dsp_global.h"
40
41//=============================================================================================================
42// EIGEN INCLUDES
43//=============================================================================================================
44
45#include <Eigen/Core>
46
47//=============================================================================================================
48// QT INCLUDES
49//=============================================================================================================
50
51#include <QVector>
52
53//=============================================================================================================
54// DEFINE NAMESPACE UTILSLIB
55//=============================================================================================================
56
57namespace UTILSLIB
58{
59
60//=============================================================================================================
73{
74 double b0 = 1.0;
75 double b1 = 0.0;
76 double b2 = 0.0;
77 double a1 = 0.0;
78 double a2 = 0.0;
79};
80
81//=============================================================================================================
92{
93public:
94 //=========================================================================================================
99 {
104 };
105
106 //=========================================================================================================
118 static QVector<IirBiquad> designButterworth(int iOrder,
119 FilterType type,
120 double dCutoffLow,
121 double dCutoffHigh,
122 double dSFreq);
123
124 //=========================================================================================================
133 static Eigen::RowVectorXd applySos(const Eigen::RowVectorXd& vecData,
134 const QVector<IirBiquad>& sos);
135
136 //=========================================================================================================
146 static Eigen::RowVectorXd applyZeroPhase(const Eigen::RowVectorXd& vecData,
147 const QVector<IirBiquad>& sos);
148
149 //=========================================================================================================
158 static Eigen::MatrixXd applyZeroPhaseMatrix(const Eigen::MatrixXd& matData,
159 const QVector<IirBiquad>& sos);
160
161private:
162 //=========================================================================================================
170 static QVector<std::complex<double>> butterworthPrototypePoles(int n);
171
172 //=========================================================================================================
182 static IirBiquad poleToDigitalBiquad(std::complex<double> pole,
183 double dC,
184 double dGain);
185
186 //=========================================================================================================
197 static IirBiquad realPoleToDigitalSection(double dPoleReal,
198 double dC,
199 double dGain);
200};
201
202} // namespace UTILSLIB
203
204#endif // IIRFILTER_DSP_H
Export/import macros and namespace declaration for the DSP library.
#define DSPSHARED_EXPORT
Definition dsp_global.h:50
Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).
Coefficients of one second-order IIR section (biquad).
Definition iirfilter.h:73
Butterworth IIR filter design and application using second-order sections.
Definition iirfilter.h:92
FilterType
Filter type selector.
Definition iirfilter.h:99