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

unclear

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: 1505
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 908aac36
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
* *
* $Id: sigfit.cc,v 1.15 2004-03-17 15:00:32 tforb Exp $ * $Id: sigfit.cc,v 1.16 2004-03-17 17:30:49 tforb Exp $
* \author Thomas Forbriger * \author Thomas Forbriger
* \date 28/01/2004 * \date 28/01/2004
* *
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define SIGFIT_VERSION \ #define SIGFIT_VERSION \
"SIGFIT V1.3 fit signal by trial-signals" "SIGFIT V1.3 fit signal by trial-signals"
#define SIGFIT_CVSID \ #define SIGFIT_CVSID \
"$Id: sigfit.cc,v 1.15 2004-03-17 15:00:32 tforb Exp $" "$Id: sigfit.cc,v 1.16 2004-03-17 17:30:49 tforb Exp $"
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
...@@ -64,6 +64,35 @@ struct Options { ...@@ -64,6 +64,35 @@ struct Options {
double amptrend, ampoffset; double amptrend, ampoffset;
}; // struct Options }; // struct Options
/*======================================================================*/
/* functions */
// remove average
void removeavg(Tseries& s)
{
double avg=0.;
for (int i=s.first(); i<=s.last(); ++i) { avg += s(i); }
avg /= s.size();
for (int i=s.first(); i<=s.last(); ++i) { s(i) -= avg; }
}
// remove trend
void removetre(Tseries& s)
{
double sum=0.;
double jser=0.;
double jqser=0.;
for (int i=s.first(); i<=s.last(); ++i)
{
sum += s(i);
jser += i;
jqser += i*i;
}
double a,b;
sum /= s.size();
for (int i=s.first(); i<=s.last(); ++i) { s(i) -= sum; }
}
// formatted number output // formatted number output
std::string formatfloat(const double &v) std::string formatfloat(const double &v)
{ {
...@@ -72,6 +101,9 @@ std::string formatfloat(const double &v) ...@@ -72,6 +101,9 @@ std::string formatfloat(const double &v)
return(std::string(seq)); return(std::string(seq));
} }
/*======================================================================*/
/* main progran */
int main(int iargc, char* argv[]) int main(int iargc, char* argv[])
{ {
......
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