STFINV library: seek source wavelet correction filter
stfinv::STFFourierDomainEngine Class Reference

Base class for all engines which operate in the Fourier domain. More...

#include <stfinvfourier.h>

Inheritance diagram for stfinv::STFFourierDomainEngine:
Collaboration diagram for stfinv::STFFourierDomainEngine:

Public Types

typedef Tfftengine::TAseries TAseries
 type of array for time series values More...
 
typedef Tfftengine::TAspectrum TAspectrum
 type of array for Fourier transforms More...
 
typedef stfinv::STFBaseEngine Tbase
 typedef to refer to base class More...
 
typedef fourier::fft::DRFFTWAFFArrayEngine Tfftengine
 type of underlying Fourier engine More...
 

Public Member Functions

virtual ~STFFourierDomainEngine ()
 abstract base requires virtual destructor More...
 
virtual void exec ()
 Start engine. More...
 
virtual void help (std::ostream &os=std::cout) const
 print online help More...
 
virtual const char * name () const
 return name of engine More...
 
virtual void usage (std::ostream &os=std::cout) const
 print detailed description More...
 
Basic interface for users
stfinv::Waveform run ()
 Start engine and return reference to source correction filter. More...
 
Shape query functions
unsigned int nsamples () const
 return number of samples used in time series More...
 
unsigned int nreceivers () const
 return number of receiver signals in use More...
 
unsigned int npairs () const
 return number of additional signals to be convolved More...
 
double dt () const
 return sampling interval More...
 
Data query functions
Tseries stf () const
 return source correction filter series More...
 
Tseries::Tcoc recording (const unsigned int &i) const
 return recorded data at receiver i More...
 
Tseries::Tcoc synthetic (const unsigned int &i) const
 return synthetic data at receiver i More...
 
Tseries convolvedsynthetic (const unsigned int &i) const
 return synthetic data convolved with stf at receiver i More...
 
Tseries::Tcoc series (const unsigned int &i) const
 return synthetic data of pair i More...
 
Tseries convolvedseries (const unsigned int &i) const
 return synthetic data convolved with stf for pair i More...
 

Static Public Member Functions

static void classhelp (std::ostream &os=std::cout)
 print online help More...
 
static void classusage (std::ostream &os=std::cout)
 print detailed description More...
 

Protected Member Functions

 STFFourierDomainEngine (const stfinv::Tvectoroftriples &triples, const stfinv::Waveform &stf, const std::string &parameters)
 Constructor. More...
 
 STFFourierDomainEngine (const stfinv::Tvectoroftriples &triples, const stfinv::Waveform &stf, const stfinv::Tvectorofpairs &pairs, const std::string &parameters)
 Constructor. More...
 
Access and control functions to be used by derived classes.

These functions are part of the interface implemented in STFFourierDomainEngine.

void fftinput ()
 copy input signals to workspace and transform input workspace to Fourier domain More...
 
void fftoutput ()
 convolve synthetics with Fourier transform of stf and transform convolved synthetics and stf to time domain and pass signals to user memory space More...
 
TAspectrum recordingspec () const
 return reference to Fourier transform of recorded data More...
 
TAspectrum syntheticspec () const
 return reference to Fourier transform of synthetics More...
 
TAspectrum stfspec () const
 return reference to Fourier transform of stf More...
 
TAspectrum recordingcoeff (const unsigned int &i) const
 return reference to Fourier coeffients of recorded data for frequency i More...
 
TAspectrum syntheticcoeff (const unsigned int &i) const
 return reference to Fourier coefficients of synthetics for frequency i More...
 
TAspectrum::Tvaluestfcoeff (const unsigned int &i) const
 return reference to Fourier coefficients of stf for frequency i More...
 
double frequency (const unsigned int &i) const
 return value of frequency i in Hz More...
 
unsigned int nfreq () const
 return number of frequencies in use More...
 
Functions presented to derived classes
std::string parameter (const std::string &key, const std::string &defvalue="false") const
 return the value of a parameters More...
 
bool parameterisset (const std::string &key) const
 check is parameter was set by user More...
 
void checkreceiverindex (const unsigned int &i) const
 check for vaid receiver index More...
 
void checkseriesindex (const unsigned int &i) const
 check for vaid index off additional time series pair More...
 
double weight (const unsigned int &i) const
 return weight for signal at receiver i More...
 
aff::Series< double > weights () const
 return weights array More...
 

Protected Attributes

int Mdebug
 debug level More...
 
stfinv::Tvectorofpairs Mpairs
 Waveform pairs. More...
 
stfinv::Waveform Mstf
 source correction filter. More...
 
stfinv::Tvectoroftriples Mtriples
 Waveform triples. More...
 
int Mverbose
 verbose level More...
 

Private Member Functions

Internal processing control functions of.

These functions are part of the interface implemented in STFFourierDomainEngine.

void initialize ()
 initialize work space More...
 
void getinput ()
 copy input time series for recorded data and synthetics to workspace More...
 
void putoutput ()
 copy workspace time series for convolved synthetics and stf to user memory More...
 
void convolve ()
 convolve synthetics with stf More...
 
void stfshift ()
 apply time shift to stf prior to FFT to time domain More...
 
void taperstf ()
 apply a time domain taper to the correction filter response. More...
 
TAseries stfseries () const
 return reference to time series container of stf More...
 

Private Attributes

bool Mapplyshift
 true if shift must be applied More...
 
bool Mapplystftaper
 true if time domain taper should be applied to filter response. More...
 
Tfftengine Mfftengineinput
 combined FFT engine for recorded data and synthetics and additional time series More...
 
Tfftengine Mfftengineoutput
 combined FFT engine for stf and convolved synthetics and additional convolved time series More...
 
Tfftengine Mfftenginestf
 FFT processor for source time function correction filter. More...
 
double Mtshift
 time shift to be applied to STF in order to expose acausal parts More...
 
double Mtt1
 time values defining taper. More...
 
double Mtt2
 time values defining taper. More...
 
double Mtt3
 time values defining taper. More...
 
double Mtt4
 time values defining taper. More...
 

Detailed Description

Base class for all engines which operate in the Fourier domain.

This is just a base class. The constructor is protected and should only be called from a derived class. The intention of this class is to provide all processing steps common to all engines operating in the Fourier domain in one single base class. The individual engines of different Fourier domain approaches then need not reimplement these steps. They essentially need only provide a specific exec-function (e.g. STFEngineFDLeastSquares::exec).

This class maintains a workspace for Fourier transforms. It provides the FFT from input signals to the workspace through a member functions as well as the convolution of the synthetic data with a given source wavelet Fourier transform and a subsequent FFT to time domain for the convolved synthetics as well as the source correction filter separately.

What STFFourierDomainEngine does for you
All derived classes call STFFourierDomainEngine::fftinput prior to processing. This function copies (by calling STFFourierDomainEngine::getinput) the users workspace to the Fourier transform engine STFFourierDomainEngine::Mfftengineinput and transforms the time series to the Fourier domain.
When processing has finished, the derived classes should call STFFourierDomainEngine::fftoutput. This function first applies a time domain taper to the correction filter impulse response if requested (STFFourierDomainEngine::taperstf). Then it convolves the synthetic data with the source correction filter (STFFourierDomainEngine::convolve). If requested it applies a time shift to the source correction filter as a next step (STFFourierDomainEngine::stfshift). The convolved synthetics as well as the source correction filter then are transformed to time domain and written to the users workspace (STFFourierDomainEngine::putoutput).
This should take place in the exec-function (e.g. STFEngineFDLeastSquares::exec) of the derived class. I.e. the first statement in the exec function is a call to function STFFourierDomainEngine::fftinput of the base class and the very last statement is a call to function STFFourierDomainEngine::fftoutput of the base class. This also guarantees that STFFourierDomainEngine::fftoutput is only called once per derived correction filter response. This is necessary, since otherwise the taper function and the time shift would be applied twice to the impulse response.
Layout of Fourier transform arrays
The workspace for the Fourier transform engine is initialized by fourier::fft::DRFFTWAFFArrayEngine.

Definition at line 108 of file stfinvfourier.h.


The documentation for this class was generated from the following files: