mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Tools for working with PSDs. More...
Tools for working with PSDs.
Definition in file psdUtils.hpp.
Go to the source code of this file.
Namespaces | |
mx | |
The mxlib c++ namespace. | |
Functions | |
template<typename realT > | |
realT | mx::sigproc::psdVar1sided (realT df, const realT *PSD, size_t sz, realT half=0.5) |
Calculate the variance of a 1-D, 1-sided PSD. More... | |
template<typename realT > | |
realT | mx::sigproc::psdVar2sided (realT df, const realT *PSD, size_t sz, realT half=0.5) |
Calculate the variance of a 1-D, 2-sided PSD. More... | |
template<typename realT > | |
realT | mx::sigproc::psdVar (const std::vector< realT > &f, const std::vector< realT > &PSD, realT half=0.5) |
Calculate the variance of a 1-D PSD. More... | |
template<typename eigenArrT > | |
eigenArrT::Scalar | mx::sigproc::psdVarDisabled (eigenArrT &freq, eigenArrT &PSD, bool trap=true) |
Calculate the variance of a PSD. More... | |
template<class realT > | |
realT | mx::sigproc::freq_sampling (size_t dim, realT f_max) |
Calculates the frequency sampling for a grid given maximum dimension and maximum frequency. More... | |
template<typename eigenArr > | |
void | mx::sigproc::frequency_grid1D (eigenArr &vec, typename eigenArr::Scalar dt, bool inverse=false) |
Create a 1-D frequency grid. More... | |
template<typename realT , typename realParamT > | |
int | mx::sigproc::frequencyGrid (std::vector< realT > &vec, realParamT dt, bool fftOrder=true) |
Create a 1-D frequency grid. More... | |
template<typename eigenArr , typename realParamT > | |
void | mx::sigproc::frequencyGrid (eigenArr &arr, realParamT drT, eigenArr *k_x, eigenArr *k_y) |
Create a 2-D frequency grid. More... | |
template<typename eigenArr > | |
void | mx::sigproc::frequencyGrid (eigenArr &arr, typename eigenArr::Scalar dt) |
Create a frequency grid. More... | |
template<typename eigenArr > | |
void | mx::sigproc::frequencyGrid (eigenArr &arr, typename eigenArr::Scalar dt, eigenArr &k_x, eigenArr &k_y) |
Create a frequency grid. More... | |
template<typename realT > | |
realT | mx::sigproc::oneoverf_norm (realT fmin, realT fmax, realT alpha) |
Calculate the normalization for a 1-D \( 1/|f|^\alpha \) PSD. More... | |
template<typename realT > | |
realT | mx::sigproc::oneoverk_norm (realT kmin, realT kmax, realT alpha) |
Calculate the normalization for a 2-D \( 1/|k|^\alpha \) PSD. More... | |
template<typename floatT , typename floatParamT > | |
int | mx::sigproc::normPSD (std::vector< floatT > &psd, std::vector< floatT > &f, floatParamT normT, floatT fmin=std::numeric_limits< floatT >::min(), floatT fmax=std::numeric_limits< floatT >::max()) |
Normalize a 1-D PSD to have a given variance. More... | |
template<typename floatT , typename floatParamT > | |
floatT | mx::sigproc::normPSD (Eigen::Array< floatT, Eigen::Dynamic, Eigen::Dynamic > &psd, Eigen::Array< floatT, Eigen::Dynamic, Eigen::Dynamic > &k, floatParamT normT, floatT kmin=std::numeric_limits< floatT >::min(), floatT kmax=std::numeric_limits< floatT >::max()) |
Normalize a 2-D PSD to have a given variance. More... | |
template<typename eigenArrp , typename eigenArrf > | |
void | mx::sigproc::oneoverf_psd (eigenArrp &psd, eigenArrf &freq, typename eigenArrp::Scalar alpha, typename eigenArrp::Scalar beta=-1) |
Generates a \( 1/|f|^\alpha \) power spectrum. More... | |
template<typename floatT , typename floatfT , typename alphaT , typename T0T , typename t0T , typename betaT > | |
int | mx::sigproc::vonKarmanPSD (std::vector< floatT > &psd, std::vector< floatfT > &f, alphaT alpha, T0T T0=0, t0T t0=0, betaT beta=1) |
Generate a 1-D von Karman power spectrum. More... | |
template<typename floatT > | |
int | mx::sigproc::kneePSD (std::vector< floatT > &psd, std::vector< floatT > &f, floatT beta, floatT fn, floatT alpha) |
Generate a 1-D "knee" PSD. More... | |
template<typename eigenArrp , typename eigenArrf , typename alphaT , typename L0T , typename l0T , typename betaT > | |
void | mx::sigproc::vonKarmanPSD (eigenArrp &psd, eigenArrf &freq, alphaT alpha, L0T L0=0, l0T l0=0, betaT beta=-1) |
Generates a von Karman power spectrum. More... | |
template<typename vectorTout , typename vectorTin > | |
void | mx::sigproc::augment1SidedPSD (vectorTout &psdTwoSided, vectorTin &psdOneSided, bool addZeroFreq=false, typename vectorTin::value_type scale=0.5) |
Augment a 1-sided PSD to standard 2-sided FFT form. More... | |
template<typename T > | |
void | mx::sigproc::augment1SidedPSDFreq (std::vector< T > &freqTwoSided, std::vector< T > &freqOneSided) |
Augment a 1-sided frequency scale to standard FFT form. More... | |
template<typename realT > | |
int | mx::sigproc::rebin1SidedPSD (std::vector< realT > &binFreq, std::vector< realT > &binPSD, std::vector< realT > &freq, std::vector< realT > &PSD, realT binSize, bool binAtZero=true) |
Rebin a PSD, including its frequency scale, to a larger frequency bin size (fewer bins) More... | |