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

proceeding

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: 1824
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent e3631e76
This diff is collapsed.
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: filter.cc,v 1.8 2005-07-05 15:54:07 tforb Exp $
* $Id: filter.cc,v 1.9 2005-07-06 10:05:06 tforb Exp $
* \author Thomas Forbriger
* \date 05/07/2005
*
......@@ -19,7 +19,7 @@
#define TF_FILTER_CC_VERSION \
"TF_FILTER_CC V1.0 "
#define TF_FILTER_CC_CVSID \
"$Id: filter.cc,v 1.8 2005-07-05 15:54:07 tforb Exp $"
"$Id: filter.cc,v 1.9 2005-07-06 10:05:06 tforb Exp $"
#include <cmath>
#include <sstream>
......@@ -133,6 +133,23 @@ namespace ts {
return s;
}
//! reverse time series
Ttimeseries Reverse::operator()(const Ttimeseries& s) const
{
Tindex k=s.f();
Tindex l=s.l();
while ((k<=s.l()) && (l>=s.f()))
{
Tvalue vk=s(k);
Tvalue vl=s(l);
s(k)=vl;
s(l)=vk;
++k;
--l;
}
return s;
}
/*----------------------------------------------------------------------*/
//! function to generate filter class
......@@ -162,6 +179,8 @@ namespace ts {
} else if (ID=="fbl") {
is >> n >> n2 >> n3;
fh=Tfh(new ForceToBase(n, n2, n3));
} else if (ID=="rev") {
fh=Tfh(new Reverse());
} else {
TSXX_UnknownFilterAbort("ts::filter::make_filter", ID);
}
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: filter.h,v 1.10 2005-07-05 15:54:07 tforb Exp $
* $Id: filter.h,v 1.11 2005-07-06 10:05:06 tforb Exp $
* \author Thomas Forbriger
* \date 05/07/2005
*
......@@ -23,7 +23,7 @@
#define TF_FILTER_H_VERSION \
"TF_FILTER_H V1.0 "
#define TF_FILTER_H_CVSID \
"$Id: filter.h,v 1.10 2005-07-05 15:54:07 tforb Exp $"
"$Id: filter.h,v 1.11 2005-07-06 10:05:06 tforb Exp $"
#include<tsxx/filterbase.h>
......@@ -31,7 +31,7 @@ namespace ts {
namespace filter {
/*! remove trend
/*! \brief remove trend
*
* We calculate the linear trend over the first \p n samples by a linear
* regression.
......@@ -48,7 +48,7 @@ namespace ts {
int Mn;
}; // class RemoveTrend
/*! remove average
/*! \brief remove average
*
* Calculate average over first \p n samples and remove this value from
* the whole time series.
......@@ -88,7 +88,7 @@ namespace ts {
double Mv;
}; // class Add
/*! force signal to a baseline
/*! \brief force signal to a baseline.
*
* The filter removes a linear trend from the time series.
* After this operation the average in the index ranges [i1,i2] and
......@@ -115,6 +115,12 @@ namespace ts {
int Mn1, Mn2, Mne;
}; // class ForceToBase
//! reverse time series
class Reverse: public ts::filter::BasicFilter {
public:
Ttimeseries operator()(const Ttimeseries& s) const;
}; // class Reverse
//! create a filter
ts::filter::Tfilterhandle make_filter(const std::string& 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