Commit 17807dfb authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

library now provides seife filters

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 1811
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent f575c285
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: seifeclass.cc,v 1.4 2005-07-05 10:51:43 tforb Exp $
* $Id: seifeclass.cc,v 1.5 2005-07-05 11:01:25 tforb Exp $
* \author Thomas Forbriger
* \date 04/07/2005
*
......@@ -19,7 +19,7 @@
#define TF_SEIFECLASS_CC_VERSION \
"TF_SEIFECLASS_CC V1.0 "
#define TF_SEIFECLASS_CC_CVSID \
"$Id: seifeclass.cc,v 1.4 2005-07-05 10:51:43 tforb Exp $"
"$Id: seifeclass.cc,v 1.5 2005-07-05 11:01:25 tforb Exp $"
#include<sstream>
#include<tsxx/seifexx.h>
......@@ -98,18 +98,61 @@ namespace ts {
//! function to generate filter class
ts::filter::Tfilterhandle make_seife_filter(const std::string& s)
{
ts::filter::Tfilterhandle retval(new ts::filter::Noop());
typedef ts::filter::Tfilterhandle Tfh;
Tfh fh(new ts::filter::Noop());
std::string ID;
std::istringstream is(s);
is >> ID;
if (ID=="LPB") {
std::cout << "LPB" << std::endl;
} else if (ID=="HPB") {
std::cout << "HPB" << std::endl;
ts::seife::Tvalue t0, t0s, h, hs;
int ni, o;
if (ID=="lpb") {
is >> t0 >> o;
fh=Tfh(new LPB(t0, o));
} else if (ID=="hpb") {
is >> t0 >> o;
fh=Tfh(new HPB(t0, o));
} else if (ID=="lp2") {
is >> t0 >> h;
fh=Tfh(new LP2(t0, h));
} else if (ID=="hp2") {
is >> t0 >> h;
fh=Tfh(new HP2(t0, h));
} else if (ID=="bp2") {
is >> t0 >> h;
fh=Tfh(new BP2(t0, h));
} else if (ID=="lp1") {
is >> t0;
fh=Tfh(new LP1(t0));
} else if (ID=="hp1") {
is >> t0;
fh=Tfh(new HP1(t0));
} else if (ID=="le1") {
is >> t0s >> t0;
fh=Tfh(new LE1(t0s, t0));
} else if (ID=="he1") {
is >> t0s >> t0;
fh=Tfh(new HE1(t0s, t0));
} else if (ID=="le2") {
is >> t0s >> hs >> t0 >> h;
fh=Tfh(new LE2(t0s, hs, t0, h));
} else if (ID=="he2") {
is >> t0s >> hs >> t0 >> h;
fh=Tfh(new HE2(t0s, hs, t0, h));
} else if (ID=="int") {
is >> t0;
fh=Tfh(new INT(t0));
} else if (ID=="dif") {
is >> t0;
fh=Tfh(new DIF(t0));
} else if (ID=="tid") {
is >> ni;
fh=Tfh(new TID(ni));
} else if (ID=="first") {
fh=Tfh(new FIRST());
} else {
TSXX_UnknownFilterAbort("ts::seife::make_seife_filter", ID);
}
return(retval);
return(fh);
}
} // namespace seife
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: seifeclass.h,v 1.3 2005-07-05 10:51:43 tforb Exp $
* $Id: seifeclass.h,v 1.4 2005-07-05 11:01:25 tforb Exp $
* \author Thomas Forbriger
* \date 04/07/2005
*
......@@ -23,7 +23,7 @@
#define TF_SEIFECLASS_H_VERSION \
"TF_SEIFECLASS_H V1.0 "
#define TF_SEIFECLASS_H_CVSID \
"$Id: seifeclass.h,v 1.3 2005-07-05 10:51:43 tforb Exp $"
"$Id: seifeclass.h,v 1.4 2005-07-05 11:01:25 tforb Exp $"
#include<string>
#include<tsxx/filter.h>
......@@ -35,7 +35,7 @@ namespace ts {
/*! Butterworth lowpass (period t0, order o) */
class LPB: public ts::filter::BasicFilter {
public:
LPB(const Tseries& s, double dt, double t0, int o):
LPB(double t0, int o):
Mt0(t0), Mo(o) { }
Ttimeseries operator()(const Ttimeseries& s) const;
private:
......@@ -46,7 +46,7 @@ namespace ts {
/*! Butterworth highpass (period t0, order o) */
class HPB: public ts::filter::BasicFilter {
public:
HPB(const Tseries& s, double dt, double t0, int o):
HPB(double t0, int o):
Mt0(t0), Mo(o) { }
Ttimeseries operator()(const Ttimeseries& s) const;
private:
......@@ -57,7 +57,7 @@ namespace ts {
/*! 2nd order lowpass (period t0, damping h) */
class LP2: public ts::filter::BasicFilter {
public:
LP2(const Tseries& s, double dt, double t0, double h):
LP2(double t0, double h):
Mt0(t0), Mh(h) { }
Ttimeseries operator()(const Ttimeseries& s) const;
private:
......@@ -67,7 +67,7 @@ namespace ts {
/*! 2nd order highpass (period t0, damping h) */
class HP2: public ts::filter::BasicFilter {
public:
HP2(const Tseries& s, double dt, double t0, double h):
HP2(double t0, double h):
Mt0(t0), Mh(h) { }
Ttimeseries operator()(const Ttimeseries& s) const;
private:
......@@ -77,7 +77,7 @@ namespace ts {
/*! 2nd order bandpass (period t0, damping h) */
class BP2: public ts::filter::BasicFilter {
public:
BP2(const Tseries& s, double dt, double t0, double h):
BP2(double t0, double h):
Mt0(t0), Mh(h) { }
Ttimeseries operator()(const Ttimeseries& s) const;
private:
......@@ -87,7 +87,7 @@ namespace ts {
/*! 1st order lowpass (period t0) */
class LP1: public ts::filter::BasicFilter {
public:
LP1(const Tseries& s, double dt, double t0):
LP1(double t0):
Mt0(t0) { }
Ttimeseries operator()(const Ttimeseries& s) const;
private:
......@@ -97,7 +97,7 @@ namespace ts {
/*! 1st order highpass (period t0) */
class HP1: public ts::filter::BasicFilter {
public:
HP1(const Tseries& s, double dt, double t0):
HP1(double t0):
Mt0(t0) { }
Ttimeseries operator()(const Ttimeseries& s) const;
private:
......@@ -107,7 +107,7 @@ namespace ts {
/*! integration (time constant t0) */
class INT: public ts::filter::BasicFilter {
public:
INT(const Tseries& s, double dt, double t0):
INT(double t0):
Mt0(t0) { }
Ttimeseries operator()(const Ttimeseries& s) const;
private:
......@@ -117,7 +117,7 @@ namespace ts {
/*! 1st order highpass equalizer (former period t0s, new period t0) */
class HE1: public ts::filter::BasicFilter {
public:
HE1(const Tseries& s, double dt, double t0s, double t0):
HE1(double t0s, double t0):
Mt0s(t0s), Mt0(t0) { }
Ttimeseries operator()(const Ttimeseries& s) const;
private:
......@@ -127,7 +127,7 @@ namespace ts {
/*! 1st order lowpass equalizer (former period t0s, new period t0) */
class LE1: public ts::filter::BasicFilter {
public:
LE1(const Tseries& s, double dt, double t0s, double t0):
LE1(double t0s, double t0):
Mt0s(t0s), Mt0(t0) { }
Ttimeseries operator()(const Ttimeseries& s) const;
private:
......@@ -139,8 +139,7 @@ namespace ts {
*/
class HE2: public ts::filter::BasicFilter {
public:
HE2(const Tseries& s, double dt,
double t0s, double hs, double t0, double h):
HE2(double t0s, double hs, double t0, double h):
Mt0s(t0s), Mhs(hs), Mt0(t0), Mh(h) { }
Ttimeseries operator()(const Ttimeseries& s) const;
private:
......@@ -153,8 +152,7 @@ namespace ts {
*/
class LE2: public ts::filter::BasicFilter {
public:
LE2(const Tseries& s, double dt,
double t0s, double hs, double t0, double h):
LE2(double t0s, double hs, double t0, double h):
Mt0s(t0s), Mhs(hs), Mt0(t0), Mh(h) { }
Ttimeseries operator()(const Ttimeseries& s) const;
private:
......@@ -165,7 +163,7 @@ namespace ts {
/*! detide with synthetic tides interpolated over ni samples */
class TID: public ts::filter::BasicFilter {
public:
TID(const Tseries& s, double dt, int ni):
TID(int ni):
Mni(ni) { }
Ttimeseries operator()(const Ttimeseries& s) const;
private:
......@@ -175,7 +173,7 @@ namespace ts {
/*! derivative (time constant t0) */
class DIF: public ts::filter::BasicFilter {
public:
DIF(const Tseries& s, double dt, double t0):
DIF(double t0):
Mt0(t0) { }
Ttimeseries operator()(const Ttimeseries& s) const;
private:
......
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