Commit 4db0fa4f authored by thomas.forbriger's avatar thomas.forbriger
Browse files

ts/wf/cross [WP]: provide sampling interval in FourierProcessor

parent b52e741c
......@@ -91,16 +91,20 @@ class FourierProcessor {
typedef Tfft::Tseries Tseries;
//! type of Fourier coefficient data
typedef Tfft::Tspectrum Tspectrum;
//! full time series with sampling interval
typedef ts::TDtimeseries Ttimeseries;
//! full time series with sampling interval
typedef Ttimeseries::Tconsttimeseries Tconsttimeseries;
//! create object
FourierProcessor(): Mspecavail(false), Minsize(0) { }
FourierProcessor(): Mspecavail(false), Minsize(0), Mdt(0) { }
//! create object by passing a time series
FourierProcessor(const Tseries::Tcoc& s):
Mspecavail(false), Minsize(0) { this->setseries(s); }
FourierProcessor(const Tconsttimeseries& s):
Mspecavail(false), Minsize(0), Mdt(0) { this->setseries(s); }
/*! create object by passing a time series and defining the desired length
* of padded series
*/
FourierProcessor(const Tseries::Tcoc& s, const unsigned int& n):
Mspecavail(false), Minsize(0)
FourierProcessor(const Tconsttimeseries& s, const unsigned int& n):
Mspecavail(false), Minsize(0), Mdt(0)
{
this->setseries(s);
this->padseries(n);
......@@ -108,10 +112,11 @@ class FourierProcessor {
//! return Fourier coefficients for padded time series with n samples
Tspectrum::Tcoc operator()(const unsigned int& n);
//! return Fourier coefficients for time series s padded to n samples
Tspectrum::Tcoc operator()(const Tseries::Tcoc& s, const unsigned int& n);
Tspectrum::Tcoc operator()(const Tconsttimeseries& s,
const unsigned int& n);
private:
//! set new input series
void setseries(const Tseries::Tcoc& s);
void setseries(const Tconsttimeseries& s);
//! pad input series and calculate Fourier coefficients
void padseries(const unsigned int& n);
private:
......@@ -127,18 +132,20 @@ class FourierProcessor {
bool Mspecavail;
//! size of original input series
unsigned int Minsize;
//! sampling interval
double Mdt;
}; // class FourierProcessor
/* ---------------------------------------------------------------------- */
FourierProcessor::Tspectrum::Tcoc
FourierProcessor::operator()(const Tseries::Tcoc& s,
FourierProcessor::operator()(const Tconsttimeseries& s,
const unsigned int& n)
{
this->setseries(s);
return(this->operator()(n));
} // FourierProcessor::Tspectrum::Tcoc
// FourierProcessor::operator()(const Tseries::Tcoc& s,
// FourierProcessor::operator()(const Tconsttimeseries& s,
// const unsigned int& n)
/* ---------------------------------------------------------------------- */
......@@ -155,7 +162,7 @@ FourierProcessor::Tspectrum::Tcoc
/* ---------------------------------------------------------------------- */
void FourierProcessor::setseries(const Tseries::Tcoc& s)
void FourierProcessor::setseries(const Tconsttimeseries& s)
{
Minsize=s.size();
if (Minsize>Mseries.size())
......@@ -164,9 +171,10 @@ void FourierProcessor::setseries(const Tseries::Tcoc& s)
}
Mseries=0.;
Mseries.copyin(s);
Mdt=s.header.dt;
Mpadded=Mseries;
Mspecavail=false;
} // void FourierProcessor::setseries(const Tseries::Tcoc& s)
} // void FourierProcessor::setseries(const Tconsttimeseries& s)
/* ---------------------------------------------------------------------- */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment