v2.0.0
Loading...
Searching...
No Matches
parksmcclellan.h
Go to the documentation of this file.
1//=============================================================================================================
31
32#ifndef PARKSMCCLELLAN_H
33#define PARKSMCCLELLAN_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 <QObject>
52
53//=============================================================================================================
54// DEFINE NAMESPACE UTILSLIB
55//=============================================================================================================
56
57namespace UTILSLIB
58{
59
65class DSPSHARED_EXPORT ParksMcClellan : public QObject
66{
67 Q_OBJECT
68 Q_ENUMS(TPassType) //makes enum available to the class' Qt meta object
69
70public:
72
74
75 //=========================================================================================================
97 ParksMcClellan(int NumTaps,
98 double OmegaC,
99 double BW,
100 double ParksWidth,
101 TPassType PassType);
102
104
105 //=========================================================================================================
110 void init(int NumTaps,
111 double OmegaC,
112 double BW,
113 double ParksWidth,
114 TPassType PassType);
115
116 //=========================================================================================================
119 void CalcParkCoeff2(int NBANDS, int NFILT);
120
121 //=========================================================================================================
125 double LeGrangeInterp2(int K, int N, int M);
126
127 //=========================================================================================================
132 double GEE2(int K, int N);
133
134 //=========================================================================================================
137 int Remez2(int GridIndex);
138
139 //=========================================================================================================
143 bool ErrTest(int k,
144 int Nut,
145 double Comp,
146 double *Err);
147
148 //=========================================================================================================
153 void CalcCoefficients();
154
155 Eigen::RowVectorXd FirCoeff;
156
157private:
158 int HalfTapCount;
159 Eigen::VectorXi ExchangeIndex;
160 Eigen::VectorXd LeGrangeD;
161 Eigen::VectorXd Alpha;
162 Eigen::VectorXd CosOfGrid;
163 Eigen::VectorXd DesPlus;
164 Eigen::VectorXd Coeff;
165 Eigen::VectorXd Edge;
166 Eigen::VectorXd BandMag;
167 Eigen::VectorXd InitWeight;
168 Eigen::VectorXd DesiredMag;
169 Eigen::VectorXd Grid;
170 Eigen::VectorXd Weight;
171
172 bool InitDone2;
173};
174} // NAMESPACE UTILSLIB
175
176#endif // PARKSMCCLELLAN_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).
Parks-McClellan equiripple FIR filter design algorithm (Remez exchange).
Eigen::RowVectorXd FirCoeff