-
Notifications
You must be signed in to change notification settings - Fork 214
/
Copy pathqf_cauer.h
89 lines (71 loc) · 2.51 KB
/
qf_cauer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/***************************************************************************
qf_cauer.h
--------------
begin : Mon Jan 02 2006
copyright : (C) 2006 by Vincent Habchi, F5RCS
email : [email protected]
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef _QF_CAUER_H
#define _QF_CAUER_H
class qf_cauer: public qf_filter {
protected:
// General variables
unsigned m;
qf_double_t Ws;
qf_double_t rho;
Rvector * zr;
qf_cauer (qf_spec*);
bool order (void);
bool iorder (void);
void scpt_odd (void);
void scpt_b (void);
void scpt_c (void);
bool synth_even (void);
bool synth_odd (void);
bool do_synth (void);
bool do_synth_even (void);
bool do_synth_odd (void);
// Optimization functions and variables
vector <unsigned> pole, best;
vector <bool> poleb;
qf_double_t opt_best;
qf_double_t check_optim (void);
void pole_idx_std (unsigned);
void pole_idx_init (unsigned);
bool pole_idx_next (unsigned, unsigned, bool);
void cauer_optimize(void);
public :
virtual ~qf_cauer (void) {delete zr;};
bool synth (void);
friend qf_filter* cauer (qf_spec* Pspec)
{return new qf_cauer (Pspec);}
};
qf_filter* cauer (qf_spec*);
# ifdef _QF_API
struct qf_filter_api qf_cauer_api =
{
"Cauer",
QF_CAUER,
NULL,
cauer,
false,
true,
false,
"\004",
CAN_ORDER |
CAN_ALL_ORDERS | CAN_BANDPASS | CAN_OPTIMIZE | CAN_POLE,
CAN_STOPBAND | CAN_ATTENUATION | CAN_IMPEDANCE2 | CAN_RIPPLE,
CAN_SUBORDER | CAN_IMPEDANCE2 | CAN_ANGLE | CAN_RIPPLE,
CAN_RIPPLE | CAN_ANGLE,
QF_NONETF
};
# endif // _QF_API
# endif // _QF_CAUER_H