filters.h 3.05 KB
Newer Older
1
2
3
4
5
/*! \file filters.h
 * \brief provides specific filters (prototypes)
 * 
 * ----------------------------------------------------------------------------
 * 
6
 * $Id$
7
8
9
10
11
12
13
14
 * \author Thomas Forbriger
 * \date 05/01/2003
 * 
 * provides specific filters (prototypes)
 * 
 * Copyright (c) 2003 by Thomas Forbriger (IMG Frankfurt) 
 *
 * ----
15
 * libfourier is free software; you can redistribute it and/or modify
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
 * 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. 
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 * ----
 *
 * 
 * REVISIONS and CHANGES 
 *  - 05/01/2003   V1.0   Thomas Forbriger
 *  - 08/01/2003   V1.1   make period mode the default (to be compatible with
 *                        seife command files)
 * 
 * ============================================================================
 */

// include guard
#ifndef TF_FILTERS_H_VERSION

#define TF_FILTERS_H_VERSION \
  "TF_FILTERS_H   V1.0   "
#define TF_FILTERS_H_CVSID \
45
  "$Id$"
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103

#include<fourier/polesnzeroes.h>
  
namespace fourier {

  class Filter: public PolesNZeroes {
    public:
      typedef PolesNZeroes Tbase;
      typedef Tbase::Tcvalue Tcvalue;

      static const double pi=3.141592653589793;
      static const Tcvalue ime;

      Filter(): Tbase(), Mfrequency(false) { }

      void clear() { this->Tbase::clear(); Mfrequency=false; }

      void setfreqmod() { Mfrequency=true; }
      void setpermod() { Mfrequency=false; }
      bool isfreqmod() const { return(Mfrequency); }
      bool ispermod() const { return(!Mfrequency); }

      Tcvalue eval(const double& par) const
      { return(this->eval(Tcvalue(par))); }
      Tcvalue eval(const Tcvalue& par) const
      { return(this->Tbase::operator()(omega(par))); }

      Tcvalue omega(const Tcvalue& par) const;

      void setint();
      void setdif();

      void sethpb(const Tcvalue& par, const int& ord);
      void sethpb(const double& par, const int& ord)
      { sethpb(Tcvalue(par), ord); }

      void setlpb(const Tcvalue& par, const int& ord);
      void setlpb(const double& par, const int& ord)
      { setlpb(Tcvalue(par), ord); }

      void sethp2(const Tcvalue& par, const double& h);
      void sethp2(const double& par, const double& h)
      { sethp2(Tcvalue(par), h); }

      void setlp2(const Tcvalue& par, const double& h);
      void setlp2(const double& par, const double& h)
      { setlp2(Tcvalue(par), h); }
    private:
      // use frequency (or period)
      bool Mfrequency;

  }; // class Filter

} // namespace fourier

#endif // TF_FILTERS_H_VERSION (includeguard)

/* ----- END OF filters.h ----- */