RTXI  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
iir_dsgn.h
Go to the documentation of this file.
1 //
2 // File = iir_dsgn.h
3 //
4 
5 #ifndef _IIR_DSGN_H_
6 #define _IIR_DSGN_H_
7 
8 #include <fstream>
9 
10 #include "typedefs.h"
11 
13 {
14 public:
15  //---------------------
16  // default constructor
17 
19 
20  //----------------------------
21  // constructor that provides
22  // interactive initialization
23 
24  IirFilterDesign(std::istream& uin, std::ostream& uout);
25 
26  //-------------------------------------
27  // constructor that allocates arrays
28  // to hold coefficients
29 
30  IirFilterDesign(int num_numer_coeffs, int num_denom_coeffs);
31 
32  //-------------------------------------
33  // constructor that allocates arrays of
34  // length num_numer_coeffs and
35  // num_denom_coeffs and then initializes
36  // these arrays to values contained in
37  // input arrays *numer_coeffs and
38  // *denom_coeffs
39 
40  IirFilterDesign(int num_numer_coeffs, int num_denom_coeffs,
41  double* numer_coeffs, double* denom_coeffs);
42 
43  //------------------------------------------
44  // allocate coefficient array *Imp_Resp_Coeff
45  // after default constructor has been used
46 
47  void Initialize(int num_numer_coeffs, int num_denom_coeffs);
48 
49  //-------------------------------------------
50  // method to quantize coefficients
51 
52  void QuantizeCoefficients(long quant_factor, logical rounding_enabled);
53 
54  //-------------------------------------------
55  // method to scale coefficients
56 
57  void ScaleCoefficients(double scale_factor);
58 
59  //----------------------------------------
60  // copy coefficients from input array
61  // *coeff into array *Imp_Resp_Coeff
62 
63  void CopyCoefficients(double* numer_coeff, double* denom_coeff);
64 
65  //----------------------------------------------
66  // dump coefficient set to output_stream
67 
68  void DumpCoefficients(std::ofstream* output_stream);
69 
70  //----------------------------------
71  // get pointers to coefficient arrays
72 
73  double* GetNumerCoefficients(void);
74  double* GetDenomCoefficients(void);
75  void SetDenomCoefficients(int num_coeffs, double* coeffs);
76 
77  //---------------------------
78  // get number of filter coefficients
79 
80  int GetNumNumerCoeffs(void);
81  int GetNumDenomCoeffs(void);
82 
83  double GetSamplingInterval(void);
84  void SetSamplingInterval(double sampling_interval);
85 
86 protected:
89 
90  double* Numer_Coeffs;
91  double* Denom_Coeffs;
95 };
96 
97 #endif
double * Denom_Coeffs
Definition: iir_dsgn.h:91
void QuantizeCoefficients(long quant_factor, logical rounding_enabled)
Definition: iir_dsgn.cpp:105
void ScaleCoefficients(double scale_factor)
Definition: iir_dsgn.cpp:168
double * Orig_Numer_Coeffs
Definition: iir_dsgn.h:92
int logical
Definition: typedefs.h:4
double Sampling_Interval
Definition: iir_dsgn.h:94
void SetSamplingInterval(double sampling_interval)
Definition: iir_dsgn.cpp:241
double * GetNumerCoefficients(void)
Definition: iir_dsgn.cpp:204
double * GetDenomCoefficients(void)
Definition: iir_dsgn.cpp:215
int Num_Denom_Coeffs
Definition: iir_dsgn.h:88
int GetNumNumerCoeffs(void)
Definition: iir_dsgn.cpp:258
double * Orig_Denom_Coeffs
Definition: iir_dsgn.h:93
void Initialize(int num_numer_coeffs, int num_denom_coeffs)
Definition: iir_dsgn.cpp:90
void DumpCoefficients(std::ofstream *output_stream)
Definition: iir_dsgn.cpp:278
double * Numer_Coeffs
Definition: iir_dsgn.h:90
int GetNumDenomCoeffs(void)
Definition: iir_dsgn.cpp:268
void SetDenomCoefficients(int num_coeffs, double *coeffs)
Definition: iir_dsgn.cpp:229
int Num_Numer_Coeffs
Definition: iir_dsgn.h:87
void CopyCoefficients(double *numer_coeff, double *denom_coeff)
Definition: iir_dsgn.cpp:188
double GetSamplingInterval(void)
Definition: iir_dsgn.cpp:248