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

signal correction

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: 1579
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 3648fdd2
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: sigfit.cc,v 1.17 2004-09-24 14:51:43 tforb Exp $
* $Id: sigfit.cc,v 1.18 2004-09-24 15:15:25 tforb Exp $
* \author Thomas Forbriger
* \date 28/01/2004
*
......@@ -17,15 +17,18 @@
* more output values
* V1.2 correction: searchfac is a factor!
* - 16/03/2004 V1.3 add trend and offset fit
* - 24/09/2004 V1.4 allow to skip samples if this is helpful to remove
* transient filter loading response
* - 24/09/2004 V1.4
* - allow to skip samples if this is helpful to remove
* transient filter loading response
* - remove correction from synthetics and signal
* and make this process transparent
*
* ============================================================================
*/
#define SIGFIT_VERSION \
"SIGFIT V1.4 fit signal by trial-signals"
#define SIGFIT_CVSID \
"$Id: sigfit.cc,v 1.17 2004-09-24 14:51:43 tforb Exp $"
"$Id: sigfit.cc,v 1.18 2004-09-24 15:15:25 tforb Exp $"
#include <fstream>
#include <iostream>
......@@ -302,6 +305,7 @@ int main(int iargc, char* argv[])
{ cout << " " << wid2line.substr(0,69) << endl; }
}
}
unsigned int ntracesread=bundlevec.size();
// add synthetic trial files
if (opt.fitoffset)
......@@ -485,6 +489,26 @@ int main(int iargc, char* argv[])
synthetics.header=signal.header;
synthetics.header.channel="synt";
// set up correction
Tbundle correction;
correction=Tseries(signal.shape());
correction.series()=0.;
if (ntracesread<bundlevec.size())
{
for (int i=ntracesread; i<N; ++i)
{ correction += coeff(i+1) * bundlevec[i]; }
}
correction.header=signal.header;
correction.header.channel="corr";
Tbundle corrsignal;
corrsignal.header=signal.header;
corrsignal.header.channel="csig";
corrsignal=signal-correction;
Tbundle corrsynthetics;
corrsynthetics.header=signal.header;
corrsynthetics.header.channel="csyn";
corrsynthetics=synthetics-correction;
// set up residual
Tbundle residual;
residual=Tseries(signal.shape());
......@@ -517,6 +541,9 @@ int main(int iargc, char* argv[])
psyn.header.channel=std::string(chan);
os << psyn;
}
os << corrsignal;
os << corrsynthetics;
os << correction;
}
// calculate rms values
......
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