version  0.0.1
Defines the C++ API for MsPASS
Loading...
Searching...
No Matches
ShapingWavelet.h
1#ifndef __SHAPING_WAVELET_H__
2#define __SHAPING_WAVELET_H__
3#include "mspass/algorithms/deconvolution/ComplexArray.h"
4#include "mspass/seismic/CoreTimeSeries.h"
5#include "mspass/utility/Metadata.h"
6#include <boost/archive/text_iarchive.hpp>
7#include <boost/archive/text_oarchive.hpp>
8#include <boost/serialization/vector.hpp>
9namespace mspass::algorithms::deconvolution {
22public:
24 dt = -1;
25 df = -1;
26 };
37 ShapingWavelet(const mspass::utility::Metadata &md, int npts = 0);
38 /* \brief Use a wavelet defined by a TimeSeries object.
39 *
40 This constructor uses the data stored in a TimeSeries object to define
41 the shaping wavelet. Note to assure output is properly time aligned
42 this signal is forced to be symmetric around relative time 0. That is
43 necessary because of the way this, like every fft we are aware of, handles
44 phase. Hence, the user should assure zero time is an appropriate
45 zero reference (e.g. a zero phase filter should the dominant peak at 0
46 time.) If the input data size is smaller than the buffer size
47 specified the buffer is zero padded.
48
49 \param w - TimeSeries specifying wavelet. Note dt will be extracted
50 and stored in this object.
51 \param nfft - buffer size = fft length for frequency domain representation
52 of the wavelet. If ns of d is less than nfft or the time range defined
53 by d is does not exceed -(nfft/2)*dt to (nfft2)*dt the result will
54 be sero padded before computing the fft. if nfft is 0 the d.ns will
55 set the fft length.
56 */
59 ShapingWavelet(const double fpeak, const double dtin, const int n);
69 ShapingWavelet(const int npolelo, const double f3dblo, const int npolehi,
70 const double f3dbhi, const double dtin, const int n);
71 ShapingWavelet(const ShapingWavelet &parent);
72 ShapingWavelet &operator=(const ShapingWavelet &parent);
75 ComplexArray *wavelet() { return &w; };
79 double freq_bin_size() { return df; };
80 double sample_interval() { return dt; };
81 std::string type() { return wavelet_name; };
82 int size() const { return w.size(); };
83
84private:
85 int nfft;
87 ComplexArray w;
88 double dt, df;
89 std::string wavelet_name;
90 friend boost::serialization::access;
91 template <class Archive>
92 void serialize(Archive &ar, const unsigned int version) {
93 ar & nfft;
94 ar & dt;
95 ar & df;
96 ar & wavelet_name;
97 ar & w;
98 }
99};
100} // namespace mspass::algorithms::deconvolution
101#endif
Frequency domain shaping wavelet.
Definition ShapingWavelet.h:21
mspass::seismic::CoreTimeSeries impulse_response()
Definition ShapingWavelet.cc:265
ComplexArray * wavelet()
Definition ShapingWavelet.h:75
Scalar time series data object.
Definition CoreTimeSeries.h:17
Definition Metadata.h:71