mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
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. | |
realT mx::sigproc::ar1FreqPhase | ( | realT | f, |
realT | fsamp | ||
) |
Get the phase of a given frequency.
[in] | f | the desired frequency, usually Hz |
[in] | fsamp | the samplingfrequency, same units as freq |
Definition at line 49 of file arpsd.hpp.
References mx::math::six_fifths().
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} \]
[out] | psd | the PSD, will be resized and filled in with the values of the AR1 PSD |
[in] | f | the frequency scale. 2*f.back() is the sampling frequency. |
[in] | beta | the normalization parameter |
[in] | alpha | magnitude of the AR1 constant |
[in] | fpole | the 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().
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.
[out] | psd | the PSD, will be resized and filled in with the values of the AR1 PSD |
[in] | f | the frequency scale. 2*f.back() is the sampling frequency. |
[in] | beta | the normalization parameter |
[in] | alpha | the complex AR1 constant |
Definition at line 138 of file arpsd.hpp.
References mx::sigproc::ar1PSD(), and mx::math::six_fifths().
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]
beta | the normalization parameter |
alpha | the magnitude of the AR1 constant |
fpole | the pole frequency, which sets the phase of complex \(\alpha\) |
fsamp | the sampling frequency |
Definition at line 76 of file arpsd.hpp.
References mx::math::six_fifths().