mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches

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 160 of file psdVarMean.hpp.

#include <sigproc/psdVarMean.hpp>

Public Member Functions

 psdVarMean ()
 Default c'tor.
 psdVarMean (size_t wm)
 Constructor which initializes workspace size.
 ~psdVarMean ()
 d'tor cleans up the workspace memory
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.

Public Attributes

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

Protected Member Functions

void init ()
 Initializes the gsl library.

Protected Attributes

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

Constructor & Destructor Documentation

◆ psdVarMean() [1/2]

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

Default c'tor.

Definition at line 180 of file psdVarMean.hpp.

References 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 186 of file psdVarMean.hpp.

References init(), and wSize.

◆ ~psdVarMean()

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

d'tor cleans up the workspace memory

Definition at line 193 of file psdVarMean.hpp.

References 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 172 of file psdVarMean.hpp.

Referenced by psdVarMean(), and 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 205 of file psdVarMean.hpp.

References mx::error, extrapAlpha, w, and 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 164 of file psdVarMean.hpp.

Referenced by operator()().

◆ w

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

The GSL integration workspace memory.

Definition at line 167 of file psdVarMean.hpp.

Referenced by ~psdVarMean(), and operator()().

◆ wSize

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

The size of the GSL workspace.

Definition at line 169 of file psdVarMean.hpp.

Referenced by psdVarMean(), and operator()().


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