STFINV library: seek source wavelet correction filter

◆ exec()

void stfinv::STFEngineFDLeastSquares::exec ( )
virtual

Start engine.

Reimplemented from stfinv::STFFourierDomainEngine.

Definition at line 111 of file stfinvfdleastsquares.cc.

References stfinv::STFFourierDomainEngine::fftinput(), stfinv::STFFourierDomainEngine::fftoutput(), stfinv::STFBaseEngine::Mdebug, Mwaterlevel, stfinv::STFFourierDomainEngine::nfreq(), stfinv::STFBaseEngine::nreceivers(), stfinv::STFFourierDomainEngine::recordingcoeff(), stfinv::STFFourierDomainEngine::stfcoeff(), STFINV_debug, stfinv::STFBaseEngine::synthetic(), stfinv::STFFourierDomainEngine::syntheticcoeff(), and stfinv::STFBaseEngine::weight().

112  {
113  // read signals and calculate FFT
114  this->fftinput();
115 
116  // calculate waterlevel
117  double waterlevel=0.;
118  for (unsigned int i=0; i<this->nreceivers(); ++i)
119  {
120  waterlevel += this->weight(i)*this->weight(i)
121  *aff::func::sqrsum(this->synthetic(i));
122  } // for (unsigned int i=0; i<this->nreceivers(); ++i)
123  waterlevel *= Mwaterlevel;
124 
125  STFINV_debug(Mdebug&2, "STFEngineFDLeastSquares::exec()",
126  "waterlevel=" << waterlevel);
127 
128  STFINV_debug(Mdebug&2, "STFEngineFDLeastSquares::exec()",
129  "nfreq=" << this->nfreq());
130  // cycle through frequencies
131  for (unsigned int i=0; i<this->nfreq(); ++i)
132  {
133  STFINV_debug(Mdebug&4, "STFEngineFDLeastSquares::exec()",
134  "frequency=" << i);
135  TAspectrum syntheticref=this->syntheticcoeff(i);
136  TAspectrum recordingref=this->recordingcoeff(i);
137  STFINV_debug(Mdebug&4, "STFEngineFDLeastSquares::exec()",
138  "syntheticref.first(0)=" << syntheticref.first(0) << " " <<
139  "syntheticref.last(0)=" << syntheticref.last(0) << " "
140  "syntheticref.first(1)=" << syntheticref.first(1) << " " <<
141  "syntheticref.last(1)=" << syntheticref.last(1) << " ");
142  TAspectrum::Tvalue numerator, denominator;
143  denominator=waterlevel;
144  numerator=0.;
145  for (unsigned int j=0; j<this->nreceivers(); ++j)
146  {
147  numerator += this->weight(j)*this->weight(j)
148  *conj(syntheticref(j))*recordingref(j);
149  denominator += this->weight(j)*this->weight(j)
150  *conj(syntheticref(j))*syntheticref(j);
151  }
152  this->stfcoeff(i)=numerator/denominator;
153  } // for (unsigned int i=0; i<this->nfreq(); ++i)
154 
155  // provide results to user
156  this->fftoutput();
157  } // void STFEngineFDLeastSquares::exec()
unsigned int nreceivers() const
return number of receiver signals in use
Definition: stfinvbase.h:259
float Tvalue
Value type of samples.All references to time series samples in user workspace are based on this type...
double weight(const unsigned int &i) const
return weight for signal at receiver i
Definition: stfinvbase.h:303
void fftinput()
copy input signals to workspace and transform input workspace to Fourier domain
Tfftengine::TAspectrum TAspectrum
type of array for Fourier transforms
TAspectrum recordingcoeff(const unsigned int &i) const
return reference to Fourier coeffients of recorded data for frequency i
TAspectrum::Tvalue & stfcoeff(const unsigned int &i) const
return reference to Fourier coefficients of stf for frequency i
int Mdebug
debug level
Definition: stfinvbase.h:336
Tseries::Tcoc synthetic(const unsigned int &i) const
return synthetic data at receiver i
Definition: stfinvbase.cc:311
unsigned int nfreq() const
return number of frequencies in use
TAspectrum syntheticcoeff(const unsigned int &i) const
return reference to Fourier coefficients of synthetics for frequency i
void fftoutput()
convolve synthetics with Fourier transform of stf and transform convolved synthetics and stf to time ...
#define STFINV_debug(C, N, M)
produce debug output
Definition: debug.h:49
Here is the call graph for this function: