stfinvnormalize.h 5.96 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
/*! \file stfinvnormalize.h
 * \brief a Fourier domain engine which finds a normalizing source wavelet (prototypes)
 * 
 * ----------------------------------------------------------------------------
 * 
 * \author Thomas Forbriger
 * \date 08/05/2011
 * 
 * a Fourier domain engine which finds a normalizing source wavelet (prototypes)
 * 
 * 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
32
 *  - 04/10/2011   V1.1   renamed Fourier domain least squares engine
33
34
35
36
37
38
39
40
 * 
 * ============================================================================
 */

// include guard
#ifndef STFINV_STFINVNORMALIZE_H_VERSION

#define STFINV_STFINVNORMALIZE_H_VERSION \
41
  "STFINV_STFINVNORMALIZE_H   V1.1"
42
43
44
45
46

#include<stfinv/stfinvfourier.h>

namespace stfinv {

thomas.forbriger's avatar
thomas.forbriger committed
47
  /*! \brief Normalization engine
48
   * \ingroup group_engines
thomas.forbriger's avatar
thomas.forbriger committed
49
   *
50
51
52
53
54
55
56
57
   * \attention
   * This engine is not yet implemented.
   * The concept of the approach is drafted in the comments to the class
   * declaration. 
   * However this approach is under debate and might not even work properly.
   * As long a stfinv::STFEngineNormalize is not made available through
   * stfinv::STFEngine::initialize it must be regarded as a stub.
   *
thomas.forbriger's avatar
thomas.forbriger committed
58
   * \par Motivation
59
60
61
   * On the down-side of Fourier domain least squares as is implemented
   * in stfinv::STFEngineFDLeastSquares is the least squares approach.
   * Least squares aims in minimizing the least squares misfit between
thomas.forbriger's avatar
thomas.forbriger committed
62
63
64
   * recorded data and synthetics. 
   * In cases where it is difficult to minimize the misfit, e.g. when the wave
   * propagation properties of the synthetics differ from those of the
65
66
67
68
69
   * recorded data, the least squares misfit optimum might be a 
   * source correction filter equal zero.
   * The current approach (stfinv::STFEngineNormalize) seeks a source
   * correction filter such that the average energy as well as the average
   * phase of data and synthetics equal.
thomas.forbriger's avatar
thomas.forbriger committed
70
71
72
73
74
75
76
77
   * This is what you usually want in a early stage of inversion.
   *
   * \par Concept of this algorithm
   * Consider that
   * - \f$d_{lk}\f$ is the Fourier coefficient of recorded data at Frequency
   *   \f$f_l\f$ and receiver \f$k\f$ at offset \f$r_k\f$ and
   * - \f$s_{lk}\f$ is the Fourier coefficient of the corresponding
   *   synthetics.
78
   *
79
   * Then we seek a source correction filter with Fourier coefficients
thomas.forbriger's avatar
thomas.forbriger committed
80
81
82
83
84
85
86
87
88
   * \f$q_l\f$ such that
   * \f[
   *   \sum\limits_{k}\left|d_{lk}\right|^2
   *   =
   *   \sum\limits_{k}\left|s_{lk}\,q_l\right|^2
   *   \quad\forall\, l
   * \f]
   * and
   * \f[
thomas.forbriger's avatar
thomas.forbriger committed
89
   *   \sum\limits_{k}\Im(\ln(d_{lk}))
thomas.forbriger's avatar
thomas.forbriger committed
90
   *   =
thomas.forbriger's avatar
thomas.forbriger committed
91
   *   \sum\limits_{k}\Im(\ln(s_{lk}\,q_l))
thomas.forbriger's avatar
thomas.forbriger committed
92
93
   *   \quad\forall\, l.
   * \f]
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
   *
   * Actually we will apply weights \f$w_k\f$ to data from different offsets
   * \f$r_k\f$ such that
   * \f[
   *   \sum\limits_{k}\left|w_k\,d_{lk}\right|^2
   *   =
   *   \sum\limits_{k}\left|w_k\,s_{lk}\,q_l\right|^2
   *   \quad\forall\, l
   * \f]
   * and
   * \f[
   *   \sum\limits_{k}w_k\,\Im(\ln(d_{lk}))
   *   =
   *   \sum\limits_{k}w_k\,\Im(\ln(s_{lk}\,q_l))
   *   \quad\forall\, l.
   * \f]
   * Additionally we will apply a waterlevel \f$\epsilon^2\f$, such that
   * Fourier coefficients for which the average weighted energy of the
   * synthetics is smaller than a fraction \f$\epsilon^2\f$ of the total
   * average energy of the synthetics, will be damped.
   *
   * These conditions are satisfied by
   * \f[
   *   q_l=A_l\,e^{i\Phi_{l}}
   * \f]
   * with
   * \f[
   *   A_l=\sqrt{\frac{\sum\limits_{k}\left|w_k\,d_{lk}\right|^2}{
   *     \sum\limits_{k}\left|w_k\,s_{lk}\right|^{2}
   *     +
   *     \frac{\epsilon^2}{N_{f}}\,\sum\limits_{k}\sum\limits_{l=0}^{N_{f}-1}
   *     \left|w_k\,s_{lk}\right|^2}}
   * \f]
   * and
   * \f[
   *   \Phi_{l}=\frac{\sum\limits_{k}w_{k}\left(
   *             \Im\left(\ln(d_{lk})\right)-\Im\left(\ln(s_{lk})\right)
   *          \right)}{\sum\limits_k w_{k}}
   * \f]
133
134
135
136
137
138
139
140
141
142
143
144
   */
  class STFEngineNormalize: public stfinv::STFFourierDomainEngine {
    public:
      //! \brief typedef to refer to base class
      typedef stfinv::STFFourierDomainEngine Tbase;
      //! \brief ID used to select thsi engine
      static const char* const ID;
      //! \brief short description of this engine
      static const char* const description;
      /*! \brief Constructor.
       */
      STFEngineNormalize(const stfinv::Tvectoroftriples& triples,
145
146
147
148
                         const stfinv::Waveform& stf,
                         const std::string& parameters)
        : Tbase(triples, stf, parameters)
      { this->initialize(); }
149
150
      //! \brief abstract base requires virtual destructor
      virtual ~STFEngineNormalize() { }
151
      //! \brief Start engine 
152
      virtual void exec();
153
154
155
156
      //! \brief print online help
      virtual void help(std::ostream& os=std::cout) const;
      //! \brief print online help
      static void classhelp(std::ostream& os=std::cout);
157
158
      //! \brief return name of engine
      virtual const char* name() const;
159
    private:
160
      //! \brief initialize work space
161
162
163
164
      void initialize();

      // member data
    private:
165
166
      //! \brief waterlevel
      double Mwaterlevel;
167
168
169
170
171
172
173
  }; // class STFEngineNormalize

} // namespace stfinv

#endif // STFINV_STFINVNORMALIZE_H_VERSION (includeguard)

/* ----- END OF stfinvnormalize.h ----- */