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

Tools for for AR process PSDs

Functions

template<typename realT >
realT mx::sigproc::ar1FreqPhase (realT f, realT fsamp)
 Get the phase of a given frequency.
 
template<typename realT >
realT mx::sigproc::ar1PSDNorm (realT beta, realT alpha, realT fpole, realT fsamp)
 Calculate the norm of an AR1 PSD.
 
template<typename realT >
void mx::sigproc::ar1PSD (std::vector< realT > &psd, const std::vector< realT > &f, realT beta, realT alpha, realT fpole)
 Generate an AR1 PSD.
 
template<typename realT >
void mx::sigproc::ar1PSD (std::vector< realT > &psd, const std::vector< realT > &f, realT beta, std::complex< realT > alpha)
 Generate an AR1 PSD.
 

Function Documentation

◆ ar1FreqPhase()

template<typename realT >
realT mx::sigproc::ar1FreqPhase ( realT  f,
realT  fsamp 
)

Get the phase of a given frequency.

Returns
\( 2\pi \frac{f}{f_s} \)
Parameters
[in]fthe desired frequency, usually Hz
[in]fsampthe samplingfrequency, same units as freq

Definition at line 49 of file arpsd.hpp.

References mx::math::six_fifths().

◆ ar1PSD() [1/2]

template<typename realT >
void mx::sigproc::ar1PSD ( std::vector< realT > &  psd,
const std::vector< realT > &  f,
realT  beta,
realT  alpha,
realT  fpole 
)

Generate an AR1 PSD.

Fills in the the PSD of the form

\[ P(f) = \frac{\beta}{ \left| 1 - \alpha e ^{-i 2\pi f/f_s}\right|^2 } \]

where \( f_s \) is the sampling frequency and the AR1 constant \( \alpha \) is complex with phase set by the pole frequency

\[ \alpha = \left|\alpha\right|^2 e^{-i 2\pi f_p/ f_s} \]

Parameters
[out]psdthe PSD, will be resized and filled in with the values of the AR1 PSD
[in]fthe frequency scale. 2*f.back() is the sampling frequency.
[in]betathe normalization parameter
[in]alphamagnitude of the AR1 constant
[in]fpolethe pole frequency, which sets the phase of complex \( \alpha \).

Definition at line 108 of file arpsd.hpp.

References mx::math::six_fifths().

Referenced by mx::sigproc::ar1PSD().

◆ ar1PSD() [2/2]

template<typename realT >
void mx::sigproc::ar1PSD ( std::vector< realT > &  psd,
const std::vector< realT > &  f,
realT  beta,
std::complex< realT >  alpha 
)

Generate an AR1 PSD.

Fills in the the PSD of the form

\[ P(f) = \frac{\beta}{ \left| 1 - \alpha e ^{-i 2\pi f/f_s}\right|^2 } \]

where \( f_s \) is the sampling frequency and the AR1 constant \( \alpha \).

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
[out]psdthe PSD, will be resized and filled in with the values of the AR1 PSD
[in]fthe frequency scale. 2*f.back() is the sampling frequency.
[in]betathe normalization parameter
[in]alphathe complex AR1 constant

Definition at line 138 of file arpsd.hpp.

References mx::sigproc::ar1PSD(), and mx::math::six_fifths().

◆ ar1PSDNorm()

template<typename realT >
realT mx::sigproc::ar1PSDNorm ( realT  beta,
realT  alpha,
realT  fpole,
realT  fsamp 
)

Calculate the norm of an AR1 PSD.

For the PSD of the form

\[ P(f) = \frac{\beta}{ \left| 1 - \alpha e ^{-i 2\pi f/f_s}\right|^2 } \]

where \( f_s \) is the sampling frequency and \( \alpha \) is complex with the pole frequency set by

\[ f_p = \arg(\alpha)\frac{f_s}{2\pi} \]

this returns the one-sided norm

\[ \int_0^{f_s/2} P(f) df \]

Uses 2.553 #3 of Gradshteyn (2007) [6]

Parameters
betathe normalization parameter
alphathe magnitude of the AR1 constant
fpolethe pole frequency, which sets the phase of complex \(\alpha\)
fsampthe sampling frequency

Definition at line 76 of file arpsd.hpp.

References mx::math::six_fifths().