Fourier library: Operations in the Fourier domain
polesnzeroes.h
Go to the documentation of this file.
1 
35 // include guard
36 #ifndef TF_POLESNZEROES_H_VERSION
37 
38 #define TF_POLESNZEROES_H_VERSION \
39  "TF_POLESNZEROES_H V1.0 "
40 
41 #include<cmath>
42 #include<complex>
43 #include<vector>
44 
45 namespace fourier {
46 
47  class PolesNZeroes {
48  public:
49  typedef std::complex<double> Tcvalue;
50  typedef std::vector<Tcvalue> Tlist;
52  Mdenominator(1.), Mnormal(true) { }
53 
54  bool isnormal() const { return(Mnormal); }
55  bool isinverse() const { return(!Mnormal); }
56 
57  void clear();
58 
59  void setnormal() { Mnormal=true; }
60  void setinverse() { Mnormal=false; }
61 
62  void setpole(const Tcvalue& pole);
63  void setzero(const Tcvalue& zero);
64 
65  void numfactor(const Tcvalue& factor);
66  void numfactor(const double& factor)
67  { this->numfactor(Tcvalue(factor)); };
68 
69  void denfactor(const Tcvalue& factor);
70  void denfactor(const double& factor)
71  { this->denfactor(Tcvalue(factor)); };
72 
73  Tcvalue operator()(const double& omega) const
74  { return(this->operator()(Tcvalue(omega))); }
75  Tcvalue operator()(const Tcvalue& omega) const;
76  private:
77  // poles
79  // zeroes
81  // scale factor
83  // scale factor
85  // normal (or inverse)
86  bool Mnormal;
87  }; // class PolesNZeroes
88 
89 } // namespace fourier
90 
91 #endif // TF_POLESNZEROES_H_VERSION (includeguard)
92 
93 /* ----- END OF polesnzeroes.h ----- */
void numfactor(const Tcvalue &factor)
Definition: polesnzeroes.cc:72
bool isinverse() const
Definition: polesnzeroes.h:55
void denfactor(const double &factor)
Definition: polesnzeroes.h:70
bool isnormal() const
Definition: polesnzeroes.h:54
Definition: error.cc:44
void denfactor(const Tcvalue &factor)
Definition: polesnzeroes.cc:82
Tcvalue operator()(const double &omega) const
Definition: polesnzeroes.h:73
std::vector< Tcvalue > Tlist
Definition: polesnzeroes.h:50
void numfactor(const double &factor)
Definition: polesnzeroes.h:66
void setpole(const Tcvalue &pole)
Definition: polesnzeroes.cc:52
void setzero(const Tcvalue &zero)
Definition: polesnzeroes.cc:62
std::complex< double > Tcvalue
Definition: polesnzeroes.h:49