35 #define STFINV_STFINVNORMALIZE_CC_VERSION \ 36 "STFINV_STFINVNORMALIZE_CC V1.0" 39 #include <aff/functions/sqrsum.h> 48 =
"Fourier domain normalization";
61 return(
"STFEngineNormalize");
69 std::istringstream is (this->
parameter(
"waterlevel",
"1.e-3"));
74 "ERROR: parameter for option \"waterlevel\" not larger than 0");
88 double totalsyntheticenergy=0.;
89 for (
unsigned int i=0; i<this->
nfreq(); ++i)
92 for (
unsigned int j=0; j<this->
nreceivers(); ++j)
95 *std::norm(syntheticref(j));
97 totalsyntheticenergy += syntheticenergy(i);
103 double weightsum=aff::func::sqrsum(this->
weights());
105 for (
unsigned int i=0; i<this->
nfreq(); ++i)
107 double recordingenergy=0.;
110 for (
unsigned int j=0; j<this->
nreceivers(); ++j)
113 *std::norm(recordingref(j));
117 =std::sqrt(recordingenergy/(syntheticenergy(i)+waterlevel));
120 for (
unsigned int j=0; j<this->
nreceivers(); ++j)
123 (std::arg(recordingref(j))-std::arg(syntheticref(j)));
127 this->
stfcoeff(i)=std::polar(modulus, phase);
138 os <<
"class STFEngineNormalize (" 142 os <<
"DESCRIBE HERE\n" 143 <<
"A waterlevel as a fraction of the signal energy of the\n" 144 <<
"input synthetics is applied. If per receiver scaling is\n" 145 <<
"selected, the receivers will be weighted in the deconvolution.\n";
146 os <<
"Options and parameters:\n" 147 <<
"waterlevel=l waterlevel to be applied for regularization." static void classhelp(std::ostream &os=std::cout)
print online help
unsigned int nreceivers() const
return number of receiver signals in use
double weight(const unsigned int &i) const
return weight for signal at receiver i
void fftinput()
copy input signals to workspace and transform input workspace to Fourier domain
Tfftengine::TAspectrum TAspectrum
type of array for Fourier transforms
suport debugging in libstfinv (prototypes)
Root namespace of library.
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
std::string parameter(const std::string &key, const std::string &defvalue="false") const
return the value of a parameters
double Mwaterlevel
waterlevel
static void classhelp(std::ostream &os=std::cout)
print online help
virtual void exec()
Start engine.
#define STFINV_assert(C, M)
Check an assertion and report by throwing an exception.
a Fourier domain engine which finds a normalizing source wavelet (prototypes)
#define STFINV_illegal
Abort if function is called illegally.
void initialize()
initialize work space
unsigned int nfreq() const
return number of frequencies in use
virtual const char * name() const
return name of engine
static const char *const description
short description of this engine
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 ...
static const char *const ID
ID used to select thsi engine.
#define STFINV_debug(C, N, M)
produce debug output
aff::Series< Tvalue > Tseries
Type of sample values.
aff::Series< double > weights() const
return weights array
virtual void help(std::ostream &os=std::cout) const
print online help