mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
mx::sigproc::psdVarMean< paramsT > Struct Template Reference

template<typename paramsT>
struct mx::sigproc::psdVarMean< paramsT >

Calculate the variance of the mean for a process given its PSD.

Functor which manages the GSL integration workspace memory.

Todo:
document the paramsT interface
Template Parameters
paramsTis a parameter structure with the correct interface.

Definition at line 159 of file psdVarMean.hpp.

#include <sigproc/psdVarMean.hpp>

Public Member Functions

 psdVarMean ()
 Default c'tor. More...
 
 psdVarMean (size_t wm)
 Constructor which initializes workspace size. More...
 
 ~psdVarMean ()
 d'tor cleans up the workspace memory More...
 
realT operator() (realT &error, std::vector< realT > &freq, std::vector< realT > &psd, realT T)
 Calculate the variance of the mean for a psd over a sample length. More...
 

Public Attributes

realT extrapAlpha {0}
 The extrapolation exponent. No extrapolation if 0. More...
 

Protected Member Functions

void init ()
 Initializes the gsl library. More...
 

Protected Attributes

gsl_integration_workspace * w {nullptr}
 The GSL integration workspace memory. More...
 
size_t wSize {10000}
 The size of the GSL workspace. More...
 

Constructor & Destructor Documentation

◆ psdVarMean() [1/2]

template<typename paramsT >
mx::sigproc::psdVarMean< paramsT >::psdVarMean ( )
inline

Default c'tor.

Definition at line 179 of file psdVarMean.hpp.

References mx::sigproc::psdVarMean< paramsT >::init().

◆ psdVarMean() [2/2]

template<typename paramsT >
mx::sigproc::psdVarMean< paramsT >::psdVarMean ( size_t  wm)
inline

Constructor which initializes workspace size.

Parameters
[in]wmSize of the GSL integration workspace

Definition at line 185 of file psdVarMean.hpp.

References mx::sigproc::psdVarMean< paramsT >::init(), and mx::sigproc::psdVarMean< paramsT >::wSize.

◆ ~psdVarMean()

template<typename paramsT >
mx::sigproc::psdVarMean< paramsT >::~psdVarMean ( )
inline

d'tor cleans up the workspace memory

Definition at line 192 of file psdVarMean.hpp.

References mx::sigproc::psdVarMean< paramsT >::w.

Member Function Documentation

◆ init()

template<typename paramsT >
void mx::sigproc::psdVarMean< paramsT >::init ( )
inlineprotected

Initializes the gsl library.

Todo:
We'll get the occasional failure to reach tolerance error, just ignore them all for now.

Definition at line 171 of file psdVarMean.hpp.

Referenced by mx::sigproc::psdVarMean< paramsT >::psdVarMean().

◆ operator()()

template<typename paramsT >
realT mx::sigproc::psdVarMean< paramsT >::operator() ( realT &  error,
std::vector< realT > &  freq,
std::vector< realT > &  psd,
realT  T 
)
inline

Calculate the variance of the mean for a psd over a sample length.

Returns
the variance of the mean for the process governed by the PSD.
Parameters
[out]errorThe error estimate returned by gsl_integration_qagiu
[in]freqThe frequency vector
[in]psdThe psd vector
[in]TThe sample length (units approprate for freq)

Definition at line 204 of file psdVarMean.hpp.

References mx::sigproc::psdVarMean< paramsT >::extrapAlpha, mx::sigproc::psdVarMean< paramsT >::w, and mx::sigproc::psdVarMean< paramsT >::wSize.

Member Data Documentation

◆ extrapAlpha

template<typename paramsT >
realT mx::sigproc::psdVarMean< paramsT >::extrapAlpha {0}

The extrapolation exponent. No extrapolation if 0.

Definition at line 163 of file psdVarMean.hpp.

Referenced by mx::sigproc::psdVarMean< paramsT >::operator()().

◆ w

template<typename paramsT >
gsl_integration_workspace* mx::sigproc::psdVarMean< paramsT >::w {nullptr}
protected

The GSL integration workspace memory.

Definition at line 166 of file psdVarMean.hpp.

Referenced by mx::sigproc::psdVarMean< paramsT >::~psdVarMean(), and mx::sigproc::psdVarMean< paramsT >::operator()().

◆ wSize

template<typename paramsT >
size_t mx::sigproc::psdVarMean< paramsT >::wSize {10000}
protected

The size of the GSL workspace.

Definition at line 168 of file psdVarMean.hpp.

Referenced by mx::sigproc::psdVarMean< paramsT >::psdVarMean(), and mx::sigproc::psdVarMean< paramsT >::operator()().


The documentation for this struct was generated from the following file: