srcires.h 2.66 KB
Newer Older
thomas.forbriger's avatar
thomas.forbriger committed
1
2
3
4
5
/*! \file srcires.h
 * \brief source wavelet impulse response (prototypes)
 * 
 * ----------------------------------------------------------------------------
 * 
thomas.forbriger's avatar
thomas.forbriger committed
6
 * $Id$
thomas.forbriger's avatar
thomas.forbriger committed
7
8
9
10
11
12
 * \author Thomas Forbriger
 * \date 04/01/2003
 * 
 * source wavelet impulse response (prototypes)
 * 
 * Copyright (c) 2003 by Thomas Forbriger (IMG Frankfurt) 
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 *
 * ----
 * 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. 
 * 
 * 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
 * ----
thomas.forbriger's avatar
thomas.forbriger committed
29
30
31
32
33
34
35
36
37
38
39
40
41
 * 
 * REVISIONS and CHANGES 
 *  - 04/01/2003   V1.0   Thomas Forbriger
 * 
 * ============================================================================
 */

// include guard
#ifndef TF_SRCIRES_H_VERSION

#define TF_SRCIRES_H_VERSION \
  "TF_SRCIRES_H   V1.0   "
#define TF_SRCIRES_H_CVSID \
thomas.forbriger's avatar
thomas.forbriger committed
42
  "$Id$"
thomas.forbriger's avatar
thomas.forbriger committed
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

#include<complex>
#include<iostream>
#include<aff/array.h>
#include<aff/shaper.h>

namespace gremlin1 {

  class GremlinIres {
    public:
      typedef std::complex<float> Tcvalue;
      typedef aff::Array<Tcvalue> Tcarray;
      GremlinIres(): Mdf(0.), Mires(1) { Mires=Tcvalue(0.); }
      GremlinIres(const double& df, const int& n1, const int& n2):
        Mdf(df), Mires(aff::Shaper(n1,n2)) { Mires=Tcvalue(0.); }
thomas.forbriger's avatar
thomas.forbriger committed
58
59
60
      GremlinIres(const double& df, const double& f1, const double& f2):
        Mdf(df), Mires(aff::Shaper(findex(f1),findex(f2))) 
        { Mires=Tcvalue(0.); }
thomas.forbriger's avatar
thomas.forbriger committed
61
62
63
64
65
      int nf() const { return(Mires.size(0)); }
      int n1() const { return(Mires.f(0)); }
      int n2() const { return(Mires.l(0)); }
      const double& df() const { return(Mdf); }
      double f(const int& i) const { return((i-1)*Mdf); }
thomas.forbriger's avatar
thomas.forbriger committed
66
      int findex(const double& fr) const { return(static_cast<int>(fr/Mdf+1)); }
thomas.forbriger's avatar
thomas.forbriger committed
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

      Tcarray ires() { return(Mires); }
      Tcarray::Tcoc ires() const { return(Mires); }
    private:
      // frequency step
      double Mdf;
      // coefficients
      Tcarray Mires;
  }; // GremlinIres

  std::istream& operator>>(std::istream& is, GremlinIres& green);
  std::ostream& operator<<(std::ostream& os, const GremlinIres& green);

}

#endif // TF_SRCIRES_H_VERSION (includeguard)

/* ----- END OF srcires.h ----- */