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

documentation update

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: 1625
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 622e4c9b
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: convolve.h,v 1.2 2004-02-07 22:13:12 tforb Exp $
* $Id: convolve.h,v 1.3 2005-01-26 16:05:38 tforb Exp $
* \author Thomas Forbriger
* \date 07/02/2004
*
......@@ -23,13 +23,13 @@
#define TF_CONVOLVE_H_VERSION \
"TF_CONVOLVE_H V1.0 "
#define TF_CONVOLVE_H_CVSID \
"$Id: convolve.h,v 1.2 2004-02-07 22:13:12 tforb Exp $"
"$Id: convolve.h,v 1.3 2005-01-26 16:05:38 tforb Exp $"
#include<aff/series.h>
namespace ts {
/*! Calculate convolution of two series.
/*! \brief Calculate convolution of two series.
*
* The function evaluates
* \f[
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: correlate.h,v 1.2 2004-02-07 22:13:12 tforb Exp $
* $Id: correlate.h,v 1.3 2005-01-26 16:05:38 tforb Exp $
* \author Thomas Forbriger
* \date 07/02/2004
*
......@@ -23,13 +23,13 @@
#define TF_CORRELATE_H_VERSION \
"TF_CORRELATE_H V1.0 "
#define TF_CORRELATE_H_CVSID \
"$Id: correlate.h,v 1.2 2004-02-07 22:13:12 tforb Exp $"
"$Id: correlate.h,v 1.3 2005-01-26 16:05:38 tforb Exp $"
#include<aff/series.h>
namespace ts {
/*! Calculate crosscorrelation of two series.
/*! \brief Calculate crosscorrelation of two series.
*
* The function evaluates
* \f[
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: innerproduct.h,v 1.3 2004-02-10 15:38:29 tforb Exp $
* $Id: innerproduct.h,v 1.4 2005-01-26 16:05:38 tforb Exp $
* \author Thomas Forbriger
* \date 07/02/2004
*
......@@ -23,13 +23,32 @@
#define TF_INNERPRODUCT_H_VERSION \
"TF_INNERPRODUCT_H V1.0 "
#define TF_INNERPRODUCT_H_CVSID \
"$Id: innerproduct.h,v 1.3 2004-02-10 15:38:29 tforb Exp $"
"$Id: innerproduct.h,v 1.4 2005-01-26 16:05:38 tforb Exp $"
#include<aff/series.h>
namespace ts {
//! calculate inner product of two series
/*! \brief Calculate inner product of two series.
*
* If both series are of unequal index range, they are padded with zeros.
*
* The function evaluates
* \f[
* c_k = \sum\limits_{l=F}^{L} a_l b_l,
* \f]
* where the index ranges of the input series are
* \f$ a_l: l \in [F_a,L_a] \f$ and
* \f$ b_l: l \in [F_b,L_b]. \f$
* and
* \f$F=\textrm{max}(F_a,F_b)\f$
* as well as
* \f$L=\textrm{min}(L_a,L_b).\f$
*
* \param a \f$ a_l \f$
* \param b \f$ b_l \f$
* \return c \f$ c_l \f$
*/
template<class T>
T innerproduct(const aff::ConstSeries<T>& a,
const aff::ConstSeries<T>& b)
......@@ -47,7 +66,16 @@ namespace ts {
return(retval);
} // innerproduct
//! calculate rms value
/*! \brief Calculate rms value.
*
* The function evaluates
* \f[
* c = \sqrt{\sum\limits_l a_l^2}
* \f]
*
* \param a \f$ a_l \f$
* \return c
*/
template<class T>
T rms(const aff::ConstSeries<T>& a)
{ return(sqrt(innerproduct(a,a)/a.size())); }
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: tsxx.h,v 1.5 2004-02-15 20:43:08 tforb Exp $
* $Id: tsxx.h,v 1.6 2005-01-26 16:05:38 tforb Exp $
* \author Thomas Forbriger
* \date 19/12/2003
*
......@@ -26,7 +26,7 @@
#define TF_TSXX_H_VERSION \
"TF_TSXX_H V1.0 "
#define TF_TSXX_H_CVSID \
"$Id: tsxx.h,v 1.5 2004-02-15 20:43:08 tforb Exp $"
"$Id: tsxx.h,v 1.6 2005-01-26 16:05:38 tforb Exp $"
#include<aff/series.h>
#include<sffostream.h>
......@@ -34,6 +34,30 @@
//! All stuff in this library will be placed within namespace ts
namespace ts {
/*! \brief Structure to hold the data samples of a series together with
* header information to form a time series.
*
* Relevant information to be contained in the header:
* - date and time of first sample
* - sampling interval
* - station, channel, etc. identifiers
*
* The first two are necessary for time series processing, like filtering or
* application of tapers and windows.
* The third is relevant for keeping track of the data source.
* The most natural choice for the header structure appears to be an
* sff::WID2 header.
* Consequently we provide typdefs for these combinations of samples and
* header.
*
* \note
* ts::TimeSeries is derived from the series base class.
* Thus TimesSeries \b is a full series and can directly be fed to functions
* that take series as their arguments.
*
* There are no hidden (private) parts of this class.
* Consequently it is defined to be a struct.
*/
template<class S, class H>
struct TimeSeries: public S
{
......@@ -43,6 +67,7 @@ namespace ts {
typedef typename Tseries::Tvalue Tvalue;
typedef typename Tseries::Tcoc Tcoc;
typedef TimeSeries<Tseries, Theader> Ttimeseries;
typedef TimeSeries<Tcoc, Theader> Tconsttimeseries;
TimeSeries() { }
TimeSeries(const Tseries& s): Tseries(s) { }
TimeSeries(const Theader& h): header(h) { }
......@@ -50,21 +75,24 @@ namespace ts {
Tseries(s), header(h) { }
Tseries& series() { return(*this); }
Ttimeseries& operator=(const Tseries& s)
{ this->Tseries::operator=(s); return(*this); }
operator TimeSeries<Tcoc, Theader>() const
{ return(TimeSeries<Tcoc, Theader>(*this, header)); }
{ this->Tseries::operator=(s); return(*this); }
operator Tconsttimeseries() const
{ return(Tconsttimeseries(*this, header)); }
public:
//! data header fields
Theader header;
}; // struct TimeSeries
//! write a bundle to an output stream
//! write an SFF bundle to an SFF output stream
template<class C>
sff::SFFostream<C>&
operator<<(sff::SFFostream<C>& os,
const TimeSeries<C, sff::WID2>& b)
{ os << C(b) << b.header; return(os); }
// define bundle typedefs
//! double precision data with SFF header
typedef TimeSeries<aff::Series<double>, sff::WID2> TDsfftimeseries;
//! single precision data with SFF header
typedef TimeSeries<aff::Series<float>, sff::WID2> TSsfftimeseries;
} // namespace ts
......
Supports Markdown
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