version  0.0.1
Defines the C++ API for MsPASS
Loading...
Searching...
No Matches
MultiTaperXcorDecon.h
1#ifndef __SIMPLE_MULTITAPER_DECON_H__
2#define __SIMPLE_MULTITAPER_DECON_H__
3#include "mspass/algorithms/deconvolution/FFTDeconOperator.h"
4#include "mspass/algorithms/deconvolution/ScalarDecon.h"
5#include "mspass/algorithms/deconvolution/ShapingWavelet.h"
6#include "mspass/seismic/CoreTimeSeries.h"
7#include "mspass/utility/Metadata.h"
8#include "mspass/utility/dmatrix.h"
9#include <boost/archive/text_iarchive.hpp>
10#include <boost/archive/text_oarchive.hpp>
11#include <boost/serialization/base_object.hpp>
12#include <boost/serialization/vector.hpp>
13#include <vector>
14namespace mspass::algorithms::deconvolution {
16public:
20 const std::vector<double> &noise,
21 const std::vector<double> &wavelet,
22 const std::vector<double> &data);
26 void changeparameter(const mspass::utility::Metadata &md) {
27 this->read_metadata(md, true);
28 };
36 int loadnoise(const std::vector<double> &noise);
45 int load(const std::vector<double> &w, const std::vector<double> &d,
46 const std::vector<double> &n);
47 void process();
80 mspass::seismic::CoreTimeSeries inverse_wavelet(const double t0parent = 0.0);
92 int get_taperlen() { return taperlen; };
93 int get_number_tapers() { return nseq; };
94 double get_time_bandwidth_product() { return nw; };
95
96private:
97 /* noise data vector */
98 std::vector<double> noise;
99 double nw, damp;
100 int nseq; // number of tapers
101 unsigned int taperlen;
103 /* We also cache the actual output fft because the cost is
104 * small compared to need to recompute it when requested.
105 * This is a feature added for the GID method that adds
106 * an inefficiency for straight application */
107 ComplexArray ao_fft;
109 int read_metadata(const mspass::utility::Metadata &md, bool refresh);
110 /* Returns a tapered data in container of ComplexArray objects*/
111 std::vector<ComplexArray> taper_data(const std::vector<double> &signal);
112 int apply();
113 friend boost::serialization::access;
114 template <class Archive>
115 void serialize(Archive &ar, const unsigned int version) {
116 ar &boost::serialization::base_object<ScalarDecon>(*this);
117 ar &boost::serialization::base_object<FFTDeconOperator>(*this);
118 ar & noise;
119 ar & nw;
120 ar & damp;
121 ar & nseq;
122 ar & taperlen;
123 ar & tapers;
124 ar & ao_fft;
125 }
126};
127} // namespace mspass::algorithms::deconvolution
128#endif
Object to hold components needed in all fft based decon algorithms.
Definition FFTDeconOperator.h:20
int load(const std::vector< double > &w, const std::vector< double > &d, const std::vector< double > &n)
load all data components.
Definition MultiTaperXcorDecon.cc:145
mspass::seismic::CoreTimeSeries inverse_wavelet()
Return default FIR represesentation of the inverse filter.
Definition MultiTaperXcorDecon.cc:379
MultiTaperXcorDecon()
Definition MultiTaperXcorDecon.h:18
mspass::seismic::CoreTimeSeries actual_output()
Definition MultiTaperXcorDecon.cc:334
int loadnoise(const std::vector< double > &noise)
Load a section of preevent noise.
Definition MultiTaperXcorDecon.cc:125
mspass::utility::Metadata QCMetrics()
Return appropriate quality measures.
Definition MultiTaperXcorDecon.cc:387
Base class decon operator for single station 3C decon (receiver functions).
Definition ScalarDecon.h:29
Scalar time series data object.
Definition CoreTimeSeries.h:17
Definition Metadata.h:71
Lightweight, simple matrix object.
Definition dmatrix.h:104