srcires.h 1.94 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
13
14
15
16
17
18
19
20
21
22
23
24
25
 * \author Thomas Forbriger
 * \date 04/01/2003
 * 
 * source wavelet impulse response (prototypes)
 * 
 * Copyright (c) 2003 by Thomas Forbriger (IMG Frankfurt) 
 * 
 * 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
26
  "$Id$"
thomas.forbriger's avatar
thomas.forbriger committed
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

#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
42
43
44
      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
45
46
47
48
49
      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
50
      int findex(const double& fr) const { return(static_cast<int>(fr/Mdf+1)); }
thomas.forbriger's avatar
thomas.forbriger committed
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

      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 ----- */