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

filters compile

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: 1819
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 259e90d1
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: filter.cc,v 1.7 2005-07-05 15:48:58 tforb Exp $
* $Id: filter.cc,v 1.8 2005-07-05 15:54:07 tforb Exp $
* \author Thomas Forbriger
* \date 05/07/2005
*
......@@ -19,9 +19,10 @@
#define TF_FILTER_CC_VERSION \
"TF_FILTER_CC V1.0 "
#define TF_FILTER_CC_CVSID \
"$Id: filter.cc,v 1.7 2005-07-05 15:48:58 tforb Exp $"
"$Id: filter.cc,v 1.8 2005-07-05 15:54:07 tforb Exp $"
#include <cmath>
#include <sstream>
#include <tsxx/filter.h>
#include <aff/functions/avg.h>
#include <aff/seriesoperators.h>
......@@ -132,6 +133,41 @@ namespace ts {
return s;
}
/*----------------------------------------------------------------------*/
//! function to generate filter class
Tfilterhandle make_filter(const std::string& s)
{
typedef Tfilterhandle Tfh;
Tfh fh(new Noop());
std::string ID;
std::istringstream is(s);
is >> ID;
Tvalue v;
int n, n2, n3;
if (ID=="tre") {
is >> n;
fh=Tfh(new RemoveTrend(n));
} else if (ID=="avg") {
is >> n;
fh=Tfh(new RemoveAverage(n));
} else if (ID=="han") {
fh=Tfh(new HanningTaper());
} else if (ID=="fac") {
is >> v;
fh=Tfh(new Scale(v));
} else if (ID=="add") {
is >> v;
fh=Tfh(new Add(v));
} else if (ID=="fbl") {
is >> n >> n2 >> n3;
fh=Tfh(new ForceToBase(n, n2, n3));
} else {
TSXX_UnknownFilterAbort("ts::filter::make_filter", ID);
}
return(fh);
}
} // namespace filter
} // namespace ts
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: filter.h,v 1.9 2005-07-05 15:48:58 tforb Exp $
* $Id: filter.h,v 1.10 2005-07-05 15:54:07 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.9 2005-07-05 15:48:58 tforb Exp $"
"$Id: filter.h,v 1.10 2005-07-05 15:54:07 tforb Exp $"
#include<tsxx/filterbase.h>
......@@ -115,6 +115,9 @@ namespace ts {
int Mn1, Mn2, Mne;
}; // class ForceToBase
//! create a filter
ts::filter::Tfilterhandle make_filter(const std::string& s);
} // namespace filter
} // namespace ts
......
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