stfinvfourier.cc 5.61 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
/*! \file stfinvfourier.cc
 * \brief a base class for all engines which operate in the Fourier domain (implementation)
 * 
 * ----------------------------------------------------------------------------
 * 
 * $Id$
 * \author Thomas Forbriger
 * \date 08/05/2011
 * 
 * a base class for all engines which operate in the Fourier domain (implementation)
 * 
 * Copyright (c) 2011 by Thomas Forbriger (BFO Schiltach) 
 *
 * ----
 * 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
 * ----
 *
 * 
 * REVISIONS and CHANGES 
 *  - 08/05/2011   V1.0   Thomas Forbriger
 * 
 * ============================================================================
 */
#define STFINV_STFINVFOURIER_CC_VERSION \
  "STFINV_STFINVFOURIER_CC   V1.0   "
#define STFINV_STFINVFOURIER_CC_CVSID \
  "$Id$"

41
#include <sstream>
42
43
44
45
#include <stfinv/stfinvfourier.h>

namespace stfinv {

thomas.forbriger's avatar
thomas.forbriger committed
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
  /*! 
   * - Refernces to signal storage are available
   * - Parameters are parsed and available through the base class
   * What has to be done here:
   * -# The FFT engine must be initialized appropriately
   *    -# Time domain padding has to be read from the parameters
   *    -# Number of sample modulo has to be read from parameters
   *    -# number of samples must be calculated from these values
   *    -# based on these values workspace arrays must be constructed
   *    -# The FFT engine must be constructed from the workspace arrays.
   *       This requires a copy constructor for the FFT engine, which
   *       currently is not present.
   *       Alternatively, we could only use a pointer to the engine.
   */
  STFFourierDomainEngine::STFFourierDomainEngine(const stfinv::Tvectoroftriples& triples,
                                                 const stfinv::Waveform& stf,
                                                 const std::string& parameters)
thomas.forbriger's avatar
thomas.forbriger committed
63
    :Tbase(triples, stf, parameters)
thomas.forbriger's avatar
thomas.forbriger committed
64
  { 
thomas.forbriger's avatar
thomas.forbriger committed
65
    this->initialize();
thomas.forbriger's avatar
thomas.forbriger committed
66
67
  } // STFFourierDomainEngine::STFFourierDomainEngine

68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
  /*----------------------------------------------------------------------*/

  void STFFourierDomainEngine::help(std::ostream& os) const
  {
    STFFourierDomainEngine::classhelp(os);
  } // void STFFourierDomainEngine::help(std::ostream& os) const

  /*----------------------------------------------------------------------*/

  void STFFourierDomainEngine::classhelp(std::ostream& os)
  {
    os << "This class is not yet implemented." << std::endl;
    os << "Online help is not yet provided." << std::endl;
  } // void STFFourierDomainEngine::classhelp(std::ostream& os)

83
84
85
86
87
88
89
  /*----------------------------------------------------------------------*/

  const char* STFFourierDomainEngine::name() const
  {
    return("STFFourierDomainEngine");
  } //  const char const* STFFourierDomainEngine::name() const

thomas.forbriger's avatar
thomas.forbriger committed
90
91
92
93
94
  /*----------------------------------------------------------------------*/

  void STFFourierDomainEngine::initialize()
  {
    STFINV_abort("STFFourierDomainEngine::initialize not yet implemented");
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
    // extract parameter values
    double padfactor;
    {
      std::istringstream is(this->parameter("fpad","1.5"));
      is >> padfactor;
    }
    STFINV_assert(padfactor >= 1.,
                  "ERROR: parameter for option \"fpad\" not larger or equal 1");
    bool poweroftwo=(this->parameter("fpow2","false")=="true");
    bool divisorset=this->parameterisset("fdiv");
    unsigned int divisor;
    if (divisorset)
    {
      std::istringstream is (this->parameter("fdiv","100")); 
    }

    // define number of samples to be used by Fourier engine

thomas.forbriger's avatar
thomas.forbriger committed
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
  } // void STFFourierDomainEngine::initialize() 

  /*----------------------------------------------------------------------*/

  void STFFourierDomainEngine::fftinput()
  {
    STFINV_abort("STFFourierDomainEngine::fftinput not yet implemented");
  } // void STFFourierDomainEngine::fftinput() 

  /*----------------------------------------------------------------------*/

  void STFFourierDomainEngine::fftoutput()
  {
    STFINV_abort("STFFourierDomainEngine::fftoutput not yet implemented");
  } // void STFFourierDomainEngine::fftoutput() 

  /*----------------------------------------------------------------------*/

  STFFourierDomainEngine::TAspectrum STFFourierDomainEngine::data() const
  {
    STFINV_abort("STFFourierDomainEngine::data not yet implemented");
  } // STFFourierDomainEngine::TAspectrum STFFourierDomainEngine::data() const

  /*----------------------------------------------------------------------*/

  STFFourierDomainEngine::TAspectrum STFFourierDomainEngine::synthetics() const
  {
    STFINV_abort("STFFourierDomainEngine::synthetics not yet implemented");
  } // STFFourierDomainEngine::TAspectrum STFFourierDomainEngine::synthetics() const

  /*----------------------------------------------------------------------*/

  STFFourierDomainEngine::Tspectrum STFFourierDomainEngine::stf() const
  {
    STFINV_abort("STFFourierDomainEngine::stf not yet implemented");
  } // STFFourierDomainEngine::Tspectrum STFFourierDomainEngine::stf() const

150
151
152
} // namespace stfinv

/* ----- END OF stfinvfourier.cc ----- */