36 #ifndef DSPFILTERS_ELLIPTIC_H
37 #define DSPFILTERS_ELLIPTIC_H
43 #include "PoleFilter.h"
58 static double ellipticK (
double k);
68 void design (
const int numPoles,
73 void prodpoly (
int sn);
77 double findfact (
int t);
78 double calcsn (
double u);
84 double& operator[](
size_t index)
131 void setup (
int order,
133 double cutoffFrequency,
140 void setup (
int order,
142 double cutoffFrequency,
149 void setup (
int order,
151 double centerFrequency,
152 double widthFrequency,
159 void setup (
int order,
161 double centerFrequency,
162 double widthFrequency,
173 template <
int MaxOrder>
178 template <
int MaxOrder>
183 template <
int MaxOrder>
188 template <
int MaxOrder>
208 static int getNumParams ()
215 return ParamInfo::defaultCutoffFrequencyParam ();
220 return ParamInfo::defaultRippleDbParam ();
225 return ParamInfo::defaultRolloffParam ();
229 template <
class FilterClass>
232 void setParams (
const Params& params)
234 FilterClass::setup (
int(params[1]), params[0], params[2], params[3], params[4]);
245 static int getNumParams ()
252 return ParamInfo::defaultCenterFrequencyParam ();
257 return ParamInfo::defaultBandwidthHzParam ();
262 return ParamInfo::defaultRippleDbParam ();
267 return ParamInfo::defaultRolloffParam ();
271 template <
class FilterClass>
274 void setParams (
const Params& params)
276 FilterClass::setup (
int(params[1]), params[0], params[2], params[3], params[4], params[5]);
284 static Kind getKind () {
return kindLowPass; }
285 static const char* getName() {
return "Elliptic Low Pass"; }
290 static Kind getKind () {
return kindHighPass; }
291 static const char* getName() {
return "Elliptic High Pass"; }
296 static Kind getKind () {
return kindHighPass; }
297 static const char* getName() {
return "Elliptic Band Pass"; }
302 static Kind getKind () {
return kindHighPass; }
303 static const char* getName() {
return "Elliptic Band Stop"; }
307 template <
int MaxOrder,
308 template <
class>
class TypeClass,
309 template <
int>
class FilterClass>
314 return ParamInfo (idOrder,
"Order",
"Order",
316 &ParamInfo::Int_toControlValue,
317 &ParamInfo::Int_toNativeValue,
318 &ParamInfo::Int_toString);
328 template <
int MaxOrder>
334 template <
int MaxOrder>
340 template <
int MaxOrder>
346 template <
int MaxOrder>