

Static Public Member Functions | |
| static mx::error_t | analyzePsd (processResults &result, const std::vector< realT > &measuredPsd, const std::vector< realT > &freq, size_t modeIndex, const processModelConfig &config, realT lpContinuumFreq=static_cast< realT >(0), realT lpContinuumWidthHz=c_defaultLpContinuumWidthHz, const std::vector< realT > *etfPsd=nullptr, const std::vector< realT > *ntfPsd=nullptr) |
| Build the noise PSD, disturbance PSD, and LP continuum PSD for one mode. | |
| static mx::error_t | estimateNoisePsd (std::vector< realT > &noisePsd, realT &noiseFloor, const std::vector< realT > &measuredPsd, const std::vector< realT > &freq, size_t modeIndex, std::string noiseEstimateRange=c_defaultNoiseEstimateRange, std::string noiseEstimateStatistic=c_defaultNoiseEstimateStatistic, realT noiseEstimateLowFreqMaxHz=c_defaultNoiseEstimateLowFreqMaxHz) |
| Estimate the flat noise PSD using the configured modalGainOpt statistic. | |
| static mx::error_t | applyLpContinuum (std::vector< realT > &lpProcessPsd, const std::vector< realT > &processPsd, const std::vector< realT > &freq, realT cutoffFreq, realT continuumWidthHz) |
| Replace all LP content above a cutoff with a smoothed continuum. | |
Static Public Attributes | |
| static constexpr const char * | c_defaultProcessMethod = "legacy" |
| The default process-method name. | |
| static constexpr realT | c_defaultPowerLawIndex = static_cast<realT>( 8.0 / 3.0 ) |
The default 1/f^a exponent. | |
| static constexpr realT | c_defaultPowerLawNormFreq = static_cast<realT>( 0 ) |
| The default auto-selected power-law normalization frequency. | |
| static constexpr realT | c_defaultPowerLawMatchFreq = static_cast<realT>( 0 ) |
| The default disabled explicit power-law match frequency. | |
| static constexpr const char * | c_defaultNoiseEstimateDomain = "open-loop" |
| The default domain used for noise-floor estimation. | |
| static constexpr const char * | c_defaultNoiseEstimateRange = "high-freq" |
| The default end of the PSD used for noise-floor estimation. | |
| static constexpr realT | c_defaultNoiseEstimateLowFreqMaxHz = static_cast<realT>( 0 ) |
| The default disabled maximum frequency for low-frequency noise estimation. | |
| static constexpr const char * | c_defaultNoiseEstimateStatistic = "percentile" |
| The default statistic used to estimate the flat noise floor. | |
| static constexpr const char * | c_defaultClosedLoopOlEstimateMethod = "etf-only" |
| The default closed-loop to open-loop PSD reconstruction method. | |
| static constexpr realT | c_defaultPowerLawMatchFallbackWindowHz = static_cast<realT>( 5 ) |
| The default half-width of the local match-frequency fallback window. | |
| static constexpr const char * | c_defaultPowerLawCrossoverMode = "manual" |
| The default crossover-selection mode for the power-law handoff. | |
| static constexpr realT | c_defaultPowerLawAutoSmoothWidthHz = static_cast<realT>( 50 ) |
| The default median-smoothing width used by the automatic crossover finder. | |
| static constexpr realT | c_defaultPowerLawAutoMaxFreqFraction = static_cast<realT>( 0.4 ) |
| static constexpr bool | c_defaultFitPowerLawIndex = false |
| The default choice to keep the power-law exponent fixed. | |
| static constexpr bool | c_defaultPowerLawFitIncludesMatchPoint = true |
| The default choice to include the match point in the exponent fit. | |
| static constexpr realT | c_defaultPowerLawFitMinFreqHz = static_cast<realT>( 100 ) |
| The default low edge of the power-law exponent fit range. | |
| static constexpr realT | c_defaultPowerLawFitMaxFreqHz = static_cast<realT>( 1000 ) |
| The default high edge of the power-law exponent fit range. | |
| static constexpr realT | c_defaultPowerLawFitBinWidthHz = static_cast<realT>( 100 ) |
| The default width of each exponent-fit median bin. | |
| static constexpr int | c_defaultPowerLawBlendBins = 5 |
| static constexpr realT | c_defaultPeakDetectWidthHz = static_cast<realT>( 50 ) |
| The default wide smoothing width used by peak detection. | |
| static constexpr realT | c_defaultPeakDetectFactor = static_cast<realT>( 5 ) |
| The default strong-peak detection factor. | |
| static constexpr realT | c_defaultPeakDetectBroadFactor = static_cast<realT>( 3 ) |
| The default broad-peak detection factor. | |
| static constexpr realT | c_defaultPeakDetectMinWidthLog = static_cast<realT>( 0.02 ) |
| The default minimum accepted broad-peak width in dex. | |
| static constexpr realT | c_defaultPeakMoffatBeta = static_cast<realT>( 6 ) |
| The default lower bound on the Moffat beta parameter. | |
| static constexpr int | c_defaultPeakDetectPasses = 2 |
| The default number of subtract-and-redetect peak passes. | |
| static constexpr realT | c_defaultDropoutGapFactor = static_cast<realT>( 0.2 ) |
| The default dropout-detection threshold factor. | |
| static constexpr realT | c_defaultDropoutTinyFactor = static_cast<realT>( 1e-6 ) |
| static constexpr size_t | c_defaultDropoutMaxBins = 4 |
| The default maximum repaired dropout-run length in bins. | |
| static constexpr realT | c_defaultClSignificanceThreshold = static_cast<realT>( 1.1 ) |
| The default raw-CL significance threshold multiplier. | |
| static constexpr realT | c_defaultClMinSignificantFraction = static_cast<realT>( 0.05 ) |
| static constexpr realT | c_defaultLpContinuumWidthHz = static_cast<realT>( 25 ) |
| The default LP-continuum smoothing width. | |
| static constexpr realT | c_defaultPowerLawOnlyAboveFreq = static_cast<realT>( 0 ) |
Static Protected Member Functions | |
| static size_t | firstPositiveFreqIndex (const std::vector< realT > &freq) |
| Return the index of the first strictly-positive frequency bin. | |
| static std::string | normalizeNoiseEstimateDomain (std::string domain) |
| Normalize a noise-estimation-domain name to lowercase hyphenated form. | |
| static std::string | normalizeNoiseEstimateRange (std::string range) |
| Normalize a noise-estimation-range name to lowercase hyphenated form. | |
| static std::string | normalizeNoiseEstimateStatistic (std::string statistic) |
| Normalize a noise-estimation-statistic name to lowercase hyphenated form. | |
| static std::string | normalizeClosedLoopOlEstimateMethod (std::string method) |
| static std::string | normalizePowerLawCrossoverMode (std::string mode) |
| Normalize a power-law crossover mode name to lowercase hyphenated form. | |
| static realT | resolvePowerLawNormFreq (const std::vector< realT > &freq, realT requestedNormFreq) |
| static mx::error_t | buildSmoothedProcessPsd (std::vector< realT > &smoothedProcessPsd, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &freq, realT smoothWidthHz) |
| static mx::error_t | findAutoPowerLawCrossoverFreq (realT &crossoverFreq, const std::vector< realT > &smoothedProcessPsd, const std::vector< realT > &noisePsd, const std::vector< realT > &freq, realT maxFreqFraction) |
| static mx::error_t | resolvePowerLawCrossoverFrequencies (realT &powerLawMatchFreq, realT &powerLawOnlyAboveFreq, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &smoothedProcessPsd, const std::vector< realT > &noisePsd, const std::vector< realT > &freq, std::string powerLawCrossoverMode, realT powerLawAutoMaxFreqFraction) |
| static realT | powerLawContinuum (realT extrapolation, const std::vector< realT > &freq, size_t index, realT powerLawIndex, realT powerLawNormFreq) |
| Evaluate the extrapolated power-law continuum at one frequency bin. | |
| static realT | interpolatePsdAtFreq (const std::vector< realT > &psd, const std::vector< realT > &freq, realT targetFreq) |
| Linearly interpolate a sampled PSD onto an arbitrary frequency. | |
| static mx::error_t | matchPowerLawAtFreq (realT &extrapolation, const std::vector< realT > &anchorProcessPsd, const std::vector< realT > &freq, realT powerLawIndex, realT powerLawNormFreq, realT powerLawMatchFreq, realT powerLawMatchFallbackWindowHz) |
| static realT | moffatAlphaFromFwhm (realT fwhm, realT beta) |
| Invert the Moffat FWHM relation to recover the alpha parameter. | |
| static realT | moffatValueFromFwhm (realT radius, realT peakHeight, realT fwhm, realT beta) |
| Evaluate a zero-background Moffat profile from its height, FWHM, and beta. | |
| static realT | fitMoffatBetaToBoundary (realT peakHeight, realT fwhm, realT radius, realT target, realT betaFloor) |
| static realT | interpolateCrossing (realT x0, realT y0, realT x1, realT y1, realT target) |
| static mx::error_t | fitPowerLawIndexFromBinnedMedians (realT &powerLawIndex, size_t &nBinsUsed, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &freq, realT fitMinFreqHz, realT fitMaxFreqHz, realT fitBinWidthHz, realT includeMatchFreqHz=static_cast< realT >(0)) |
| static mx::error_t | estimatePowerLawContinuum (std::vector< realT > &continuumPsd, realT &extrapolation, size_t &anchorIndex, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &anchorProcessPsd, const std::vector< realT > &noisePsd, const std::vector< realT > &freq, realT powerLawIndex, realT powerLawNormFreq, realT powerLawMatchFreq, realT powerLawMatchFallbackWindowHz, bool fitPowerLawIndex=false, realT powerLawFitMinFreqHz=c_defaultPowerLawFitMinFreqHz, realT powerLawFitMaxFreqHz=c_defaultPowerLawFitMaxFreqHz, realT powerLawFitBinWidthHz=c_defaultPowerLawFitBinWidthHz, bool powerLawFitIncludesMatchPoint=c_defaultPowerLawFitIncludesMatchPoint, realT *usedPowerLawIndex=nullptr, size_t *fitBinsUsed=nullptr) |
| static mx::error_t | buildPowerLawContinuum (std::vector< realT > &continuumPsd, realT extrapolation, const std::vector< realT > &freq, realT powerLawIndex, realT powerLawNormFreq) |
| Populate a sampled power-law continuum from a resolved normalization. | |
| static mx::error_t | blendContinuumAtAnchor (std::vector< realT > &processPsd, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &continuumPsd, size_t anchorIndex, int blendBins) |
| static mx::error_t | identifyMoffatPeaks (std::vector< identifiedPeak1D > &peaks, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &continuumPsd, const std::vector< realT > &freq, realT peakDetectWidthHz, realT peakDetectFactor, realT peakDetectBroadFactor, realT peakDetectMinWidthLog) |
| static mx::error_t | addClippedMoffatPeakExcess (std::vector< realT > &peakModel, const identifiedPeak1D &peak, const std::vector< realT > &sourcePsd, const std::vector< realT > &continuumPsd, const std::vector< realT > &freq, realT peakMoffatBeta) |
| Add one clipped Moffat peak excess to a PSD model. | |
| static mx::error_t | identifyMoffatPeaksMultiPass (std::vector< identifiedPeak1D > &peaks, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &continuumPsd, const std::vector< realT > &freq, realT peakDetectWidthHz, realT peakDetectFactor, realT peakDetectBroadFactor, realT peakDetectMinWidthLog, int peakDetectPasses, realT peakMoffatBeta) |
| static mx::error_t | buildMoffatProcessFromContinuum (std::vector< realT > &processPsd, std::vector< identifiedPeak1D > &peaks, std::vector< unsigned char > &repairMask, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &noisePsd, const std::vector< realT > &continuumPsd, const std::vector< realT > &freq, size_t anchorIndex, const processModelConfig &config) |
| Build the full Moffat-peak disturbance model from a fixed continuum. | |
| static mx::error_t | buildPowerLawOnlyProcessFromContinuum (std::vector< realT > &processPsd, std::vector< unsigned char > &repairMask, const std::vector< realT > &rawProcessPsd, const std::vector< realT > &noisePsd, const std::vector< realT > &continuumPsd, const std::vector< realT > &freq, size_t anchorIndex, const processModelConfig &config) |
| Build the power-law-only disturbance model from a fixed continuum. | |
| static mx::error_t | estimateProcessPsdPowerLawOnly (std::vector< realT > &processPsd, realT &extrapolation, size_t &anchorIndex, std::vector< unsigned char > &repairMask, const std::vector< realT > &measuredPsd, const std::vector< realT > &anchorProcessPsd, const std::vector< realT > &noisePsd, const std::vector< realT > &freq, const processModelConfig &config, realT *usedPowerLawIndex=nullptr, size_t *fitBinsUsed=nullptr) |
Build a disturbance PSD from only the extrapolated 1/f^a continuum. | |
| static mx::error_t | estimateProcessPsdMoffatPeaks (std::vector< realT > &processPsd, realT &extrapolation, std::vector< identifiedPeak1D > &peaks, std::vector< unsigned char > &repairMask, const std::vector< realT > &measuredPsd, const std::vector< realT > &anchorProcessPsd, const std::vector< realT > &noisePsd, const std::vector< realT > &freq, const processModelConfig &config) |
| static mx::error_t | estimateProcessPsd (std::vector< realT > &processPsd, realT &extrapolation, const std::vector< realT > &measuredPsd, const std::vector< realT > &noisePsd, const std::vector< realT > &freq, realT powerLawNormFreq, realT powerLawMatchFreq, realT powerLawMatchFallbackWindowHz) |
| static mx::error_t | fillProcessPsdDropouts (std::vector< realT > &processPsd, const std::vector< realT > &freq, const std::vector< unsigned char > &repairMask, realT gapFactor, realT tinyFactor, size_t maxGapBins, realT powerLawIndex) |
| Fill isolated or short dropout runs in a disturbance PSD. | |
Definition at line 29 of file modalGainOpt_test.cpp.
|
staticprotectedinherited |
Add one clipped Moffat peak excess to a PSD model.
| peakModel | [in.out] the accumulated peak model | |
| [in] | peak | the detected peak |
| [in] | sourcePsd | the source PSD used to bound the peak |
| [in] | continuumPsd | the continuum PSD |
| [in] | freq | the one-sided frequency grid |
| [in] | peakMoffatBeta | the minimum Moffat beta |
Definition at line 2417 of file modalPsdProcessor.hpp.
References MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_centerFreq, MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_end, MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_fwhm, MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_peakHeight, MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_peakIndex, and MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_start.
|
staticinherited |
Build the noise PSD, disturbance PSD, and LP continuum PSD for one mode.
| [out] | result | the populated process-model results |
| [in] | measuredPsd | the measured one-sided PSD |
| [in] | freq | the one-sided frequency grid |
| [in] | modeIndex | the zero-based mode index |
| [in] | config | the disturbance-PSD configuration |
| [in] | lpContinuumFreq | the LP continuum cutoff |
| [in] | lpContinuumWidthHz | LP smoothing width |
| [in] | etfPsd | optional CL ETF^2 correction |
| [in] | ntfPsd | optional CL NTF^2 correction |
Definition at line 739 of file modalPsdProcessor.hpp.
References MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_closedLoopOlEstimateMethod, MagAOX::app::modalPsdProcessor< realT >::processResults::m_closedLoopOlEstimateMethod, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_dropoutGapFactor, MagAOX::app::modalPsdProcessor< realT >::processResults::m_dropoutGapFactor, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_dropoutMaxBins, MagAOX::app::modalPsdProcessor< realT >::processResults::m_dropoutMaxBins, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_dropoutTinyFactor, MagAOX::app::modalPsdProcessor< realT >::processResults::m_dropoutTinyFactor, MagAOX::app::modalPsdProcessor< realT >::processResults::m_extrapolation, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_fitPowerLawIndex, MagAOX::app::modalPsdProcessor< realT >::processResults::m_fitPowerLawIndex, MagAOX::app::modalPsdProcessor< realT >::processResults::m_lpContinuumFreq, MagAOX::app::modalPsdProcessor< realT >::processResults::m_lpContinuumWidthHz, MagAOX::app::modalPsdProcessor< realT >::processResults::m_lpProcessPsd, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_method, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_noiseEstimateDomain, MagAOX::app::modalPsdProcessor< realT >::processResults::m_noiseEstimateDomain, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_noiseEstimateLowFreqMaxHz, MagAOX::app::modalPsdProcessor< realT >::processResults::m_noiseEstimateLowFreqMaxHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_noiseEstimateRange, MagAOX::app::modalPsdProcessor< realT >::processResults::m_noiseEstimateRange, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_noiseEstimateStatistic, MagAOX::app::modalPsdProcessor< realT >::processResults::m_noiseEstimateStatistic, MagAOX::app::modalPsdProcessor< realT >::processResults::m_noiseFloor, MagAOX::app::modalPsdProcessor< realT >::processResults::m_noisePsd, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectBroadFactor, MagAOX::app::modalPsdProcessor< realT >::processResults::m_peakDetectBroadFactor, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectFactor, MagAOX::app::modalPsdProcessor< realT >::processResults::m_peakDetectFactor, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectMinWidthLog, MagAOX::app::modalPsdProcessor< realT >::processResults::m_peakDetectMinWidthLog, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectPasses, MagAOX::app::modalPsdProcessor< realT >::processResults::m_peakDetectPasses, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectWidthHz, MagAOX::app::modalPsdProcessor< realT >::processResults::m_peakDetectWidthHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakMoffatBeta, MagAOX::app::modalPsdProcessor< realT >::processResults::m_peakMoffatBeta, MagAOX::app::modalPsdProcessor< realT >::processResults::m_peaks, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawAnchorFreq, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawAnchorIndex, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawAutoMaxFreqFraction, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawAutoMaxFreqFraction, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawAutoSmoothWidthHz, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawAutoSmoothWidthHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawBlendBins, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawBlendBins, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawCrossoverMode, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawCrossoverMode, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawFitBinsUsed, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitBinWidthHz, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawFitBinWidthHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitIncludesMatchPoint, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawFitIncludesMatchPoint, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitMaxFreqHz, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawFitMaxFreqHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitMinFreqHz, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawFitMinFreqHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawIndex, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawIndex, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawIndexFitSucceeded, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawMatchFallbackWindowHz, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawMatchFallbackWindowHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawMatchFreq, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawMatchFreq, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawNormFreq, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawNormFreq, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawOnlyAboveFreq, MagAOX::app::modalPsdProcessor< realT >::processResults::m_powerLawOnlyAboveFreq, MagAOX::app::modalPsdProcessor< realT >::processResults::m_processMethod, MagAOX::app::modalPsdProcessor< realT >::processResults::m_processPsd, MagAOX::app::modalPsdProcessor< realT >::processResults::m_rawProcessPsd, and MagAOX::app::modalPsdProcessor< realT >::processResults::m_smoothedProcessPsd.
Referenced by MagAOX::app::modalGainOpt::goptThreadExec(), libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), and libXWCTest::modalGainOptTest::TEST_CASE().
|
staticinherited |
Replace all LP content above a cutoff with a smoothed continuum.
| [out] | lpProcessPsd | the LP disturbance PSD |
| [in] | processPsd | the nominal disturbance PSD |
| [in] | freq | the one-sided frequency grid |
| [in] | cutoffFreq | the continuum cutoff frequency |
| [in] | continuumWidthHz | the smoothing width |
Definition at line 3327 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Blend from a continuum model to the measured disturbance PSD at the anchor point.
| [out] | processPsd | the blended disturbance PSD |
| [in] | rawProcessPsd | measured disturbance PSD |
| [in] | continuumPsd | extrapolated continuum PSD |
| [in] | anchorIndex | the last bin where the continuum anchors |
| [in] | blendBins | the number of handoff bins |
Definition at line 2175 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Build the full Moffat-peak disturbance model from a fixed continuum.
| [out] | processPsd | the disturbance PSD |
| [out] | peaks | detected peaks |
| [out] | repairMask | repair-eligible bins |
| [in] | rawProcessPsd | raw disturbance PSD |
| [in] | noisePsd | the flat noise PSD |
| [in] | continuumPsd | the continuum PSD |
| [in] | freq | the one-sided frequency grid |
| [in] | anchorIndex | the continuum handoff bin |
| [in] | config | the process configuration |
Definition at line 2595 of file modalPsdProcessor.hpp.
References MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectBroadFactor, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectFactor, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectMinWidthLog, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectPasses, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakDetectWidthHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakMoffatBeta, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawBlendBins, and MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawOnlyAboveFreq.
|
staticprotectedinherited |
Populate a sampled power-law continuum from a resolved normalization.
| [out] | continuumPsd | the sampled continuum PSD |
| [in] | extrapolation | the continuum normalization |
| [in] | freq | the one-sided frequency grid |
| [in] | powerLawIndex | the power-law exponent |
| [in] | powerLawNormFreq | the normalization frequency |
Definition at line 2156 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Build the power-law-only disturbance model from a fixed continuum.
| [out] | processPsd | the disturbance PSD |
| [out] | repairMask | repair-eligible bins |
| [in] | rawProcessPsd | raw disturbance PSD |
| [in] | noisePsd | the flat noise PSD |
| [in] | continuumPsd | the continuum PSD |
| [in] | freq | the one-sided frequency grid |
| [in] | anchorIndex | the continuum handoff bin |
| [in] | config | the process configuration |
Definition at line 2721 of file modalPsdProcessor.hpp.
References MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawBlendBins, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawCrossoverMode, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawMatchFreq, and MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawOnlyAboveFreq.
|
staticprotectedinherited |
Median-smooth a disturbance PSD in log space while preserving the original sampling.
| [out] | smoothedProcessPsd | the smoothed disturbance PSD |
| [in] | rawProcessPsd | the raw disturbance PSD |
| [in] | freq | the one-sided frequency grid |
| [in] | smoothWidthHz | the median-smoothing width in Hz |
Definition at line 1461 of file modalPsdProcessor.hpp.
|
staticinherited |
Estimate the flat noise PSD using the configured modalGainOpt statistic.
| [out] | noisePsd | the flat noise PSD estimate |
| [out] | noiseFloor | the fitted noise floor |
| [in] | measuredPsd | the measured one-sided PSD |
| [in] | freq | the one-sided frequency grid |
| [in] | modeIndex | the zero-based mode index |
| [in] | noiseEstimateRange | which PSD end to use |
| [in] | noiseEstimateStatistic | how to summarize the selected bins |
| [in] | noiseEstimateLowFreqMaxHz | optional low-frequency upper limit |
Definition at line 1259 of file modalPsdProcessor.hpp.
Referenced by MagAOX::app::modalGainOpt::goptThreadExec(), libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), and libXWCTest::modalGainOptTest::TEST_CASE().
|
staticprotectedinherited |
Estimate the 1/f^a continuum used by the power-law and Moffat extrapolators.
| [out] | continuumPsd | the continuum PSD |
| [out] | extrapolation | the continuum normalization |
| [out] | anchorIndex | the last bin used to anchor the fit |
| [in] | rawProcessPsd | raw disturbance PSD |
| [in] | anchorProcessPsd | smoothed disturbance PSD used for anchoring |
| [in] | noisePsd | the flat noise PSD |
| [in] | freq | the one-sided frequency grid |
| [in] | powerLawIndex | the power-law exponent |
| [in] | powerLawNormFreq | the normalization frequency |
| [in] | powerLawMatchFreq | the optional match frequency |
| [in] | powerLawMatchFallbackWindowHz | the match fallback half-width |
| [in] | fitPowerLawIndex | whether to fit the exponent |
| [in] | powerLawFitMinFreqHz | fit low edge |
| [in] | powerLawFitMaxFreqHz | fit high edge |
| [in] | powerLawFitBinWidthHz | fit bin width |
| [in] | powerLawFitIncludesMatchPoint | include match point |
| [out] | usedPowerLawIndex | the exponent actually used |
| [out] | fitBinsUsed | the number of populated fit bins |
Definition at line 2030 of file modalPsdProcessor.hpp.
Referenced by libXWCTest::modalGainOptTest::TEST_CASE().
|
staticprotectedinherited |
Build the disturbance PSD used for optimization from the measured PSD and the flat noise estimate.
| [out] | processPsd | the disturbance PSD |
| [out] | extrapolation | the low-frequency extrapolation anchor |
| [in] | measuredPsd | the measured one-sided PSD |
| [in] | noisePsd | the flat noise PSD estimate |
| [in] | freq | the one-sided frequency grid |
| [in] | powerLawNormFreq | the power-law normalization frequency |
| [in] | powerLawMatchFreq | the optional power-law match frequency |
| [in] | powerLawMatchFallbackWindowHz | the local match fallback half-width |
Definition at line 2946 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Build a disturbance PSD by combining a 1/f^a continuum with detected Moffat peaks.
| [out] | processPsd | the disturbance PSD |
| [out] | extrapolation | the power-law continuum anchor |
| [out] | peaks | the detected peaks |
| [out] | repairMask | bins eligible for repair |
| [in] | measuredPsd | the measured one-sided PSD |
| [in] | anchorProcessPsd | the smoothed disturbance PSD used for anchoring |
| [in] | noisePsd | the flat noise PSD |
| [in] | freq | the one-sided frequency grid |
| [in] | config | the extrapolation configuration |
Definition at line 2877 of file modalPsdProcessor.hpp.
References MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_fitPowerLawIndex, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_peakMoffatBeta, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitBinWidthHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitIncludesMatchPoint, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitMaxFreqHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitMinFreqHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawIndex, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawMatchFallbackWindowHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawMatchFreq, and MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawNormFreq.
|
staticprotectedinherited |
Build a disturbance PSD from only the extrapolated 1/f^a continuum.
| [out] | processPsd | the disturbance PSD |
| [out] | extrapolation | the power-law continuum anchor |
| [out] | anchorIndex | the last frequency bin used to anchor the fit |
| [out] | repairMask | bins eligible for repair |
| [in] | measuredPsd | the measured one-sided PSD |
| [in] | anchorProcessPsd | the smoothed disturbance PSD used for anchoring |
| [in] | noisePsd | the flat noise PSD |
| [in] | freq | the one-sided frequency grid |
| [in] | config | the disturbance-PSD configuration |
| [out] | usedPowerLawIndex | the exponent actually used |
| [out] | fitBinsUsed | the number of populated fit bins |
Definition at line 2787 of file modalPsdProcessor.hpp.
References MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_fitPowerLawIndex, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawCrossoverMode, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitBinWidthHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitIncludesMatchPoint, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitMaxFreqHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawFitMinFreqHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawIndex, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawMatchFallbackWindowHz, MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawMatchFreq, and MagAOX::app::modalPsdProcessor< realT >::processModelConfig::m_powerLawNormFreq.
Referenced by libXWCTest::modalGainOptTest::TEST_CASE().
|
staticprotectedinherited |
Fill isolated or short dropout runs in a disturbance PSD.
| processPsd | [in.out] the disturbance PSD | |
| [in] | freq | the one-sided frequency grid |
| [in] | repairMask | repair-eligible bins |
| [in] | gapFactor | the threshold used to identify dropout bins |
| [in] | tinyFactor | the factor below the local good-bin scale required for a true dropout |
| [in] | maxGapBins | the maximum repaired gap length |
| [in] | powerLawIndex | the power-law exponent used to continue a trailing gap |
Definition at line 3059 of file modalPsdProcessor.hpp.
Referenced by libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), and libXWCTest::modalGainOptTest::TEST_CASE().
|
staticprotectedinherited |
Determine the automatic power-law crossover from a median-smoothed disturbance PSD.
| [out] | crossoverFreq | the resolved crossover frequency |
| [in] | smoothedProcessPsd | the smoothed disturbance PSD |
| [in] | noisePsd | the flat noise PSD |
| [in] | freq | the one-sided frequency grid |
| [in] | maxFreqFraction | the maximum searched frequency as a fraction of the sampled maximum |
Definition at line 1530 of file modalPsdProcessor.hpp.
Referenced by libXWCTest::modalGainOptTest::TEST_CASE(), libXWCTest::modalGainOptTest::TEST_CASE(), and libXWCTest::modalGainOptTest::TEST_CASE().
|
staticprotectedinherited |
Return the index of the first strictly-positive frequency bin.
| [in] | freq | the one-sided frequency grid |
Definition at line 1447 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Find the smallest beta that drives a Moffat wing down to a target level at a target radius.
| [in] | peakHeight | the peak height above the continuum |
| [in] | fwhm | the full-width at half maximum |
| [in] | radius | the target boundary radius |
| [in] | target | the desired level at that boundary |
| [in] | betaFloor | the minimum allowed beta |
Definition at line 1828 of file modalPsdProcessor.hpp.
References MagAOX::app::target.
|
staticprotectedinherited |
Fit the power-law exponent from binned median log PSD values over a selected frequency range.
| [out] | powerLawIndex | the fitted exponent |
| [out] | nBinsUsed | the number of populated bins |
| [in] | rawProcessPsd | disturbance PSD |
| [in] | freq | the one-sided frequency grid |
| [in] | fitMinFreqHz | the low edge of the fit range |
| [in] | fitMaxFreqHz | the high edge of the fit range |
| [in] | fitBinWidthHz | the width of the median bins |
| [in] | includeMatchFreqHz | optional explicit match point |
Definition at line 1892 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Identify peaks using strong-threshold or broad-but-wide discriminants above a smoothed PSD.
| [out] | peaks | the detected peaks |
| [in] | rawProcessPsd | the raw disturbance PSD |
| [in] | continuumPsd | the continuum PSD model |
| [in] | freq | the one-sided frequency grid |
| [in] | peakDetectWidthHz | the wide smoothing width |
| [in] | peakDetectFactor | the factor above smooth for strong peaks |
| [in] | peakDetectBroadFactor | the lower factor for broad candidates |
| [in] | peakDetectMinWidthLog | the minimum accepted broad-peak width |
Definition at line 2226 of file modalPsdProcessor.hpp.
References MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_centerFreq, MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_end, MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_fwhm, MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_peakHeight, MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_peakIndex, and MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D::m_start.
|
staticprotectedinherited |
Identify peaks iteratively, subtracting each pass's modeled peaks from the residual.
| [out] | peaks | the detected peaks |
| [in] | rawProcessPsd | the raw disturbance PSD |
| [in] | continuumPsd | the continuum PSD model |
| [in] | freq | the one-sided frequency grid |
| [in] | peakDetectWidthHz | the wide smoothing width |
| [in] | peakDetectFactor | the factor above smooth |
| [in] | peakDetectBroadFactor | the broad-peak factor |
| [in] | peakDetectMinWidthLog | the minimum log-width |
| [in] | peakDetectPasses | the number of iterative passes |
| [in] | peakMoffatBeta | the minimum Moffat beta |
Definition at line 2500 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Linearly interpolate the x-position where a profile crosses a target level.
| [in] | x0 | the first x-coordinate |
| [in] | y0 | the first y-coordinate |
| [in] | x1 | the second x-coordinate |
| [in] | y1 | the second y-coordinate |
| [in] | target | the y-level to interpolate |
Definition at line 1871 of file modalPsdProcessor.hpp.
References MagAOX::app::target.
|
staticprotectedinherited |
Linearly interpolate a sampled PSD onto an arbitrary frequency.
| [in] | psd | the sampled PSD values |
| [in] | freq | the sampled frequencies |
| [in] | targetFreq | the desired interpolation frequency |
Definition at line 1697 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Force the power-law normalization so the model matches the disturbance PSD at a chosen frequency.
| extrapolation | [in.out] the continuum normalization | |
| [in] | anchorProcessPsd | the PSD used for continuum anchoring |
| [in] | freq | the one-sided frequency grid |
| [in] | powerLawIndex | the power-law exponent |
| [in] | powerLawNormFreq | the continuum normalization frequency |
| [in] | powerLawMatchFreq | the desired match frequency |
| [in] | powerLawMatchFallbackWindowHz | the local fallback half-width |
Definition at line 1734 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Invert the Moffat FWHM relation to recover the alpha parameter.
| [in] | fwhm | the desired full-width at half-maximum |
| [in] | beta | the Moffat beta parameter |
Definition at line 1809 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Evaluate a zero-background Moffat profile from its height, FWHM, and beta.
| [in] | radius | the distance from the peak center |
| [in] | peakHeight | the peak height above the continuum |
| [in] | fwhm | the full-width at half maximum |
| [in] | beta | the Moffat beta parameter |
Definition at line 1816 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Normalize a CL-to-OL PSD reconstruction method name to lowercase hyphenated form.
| [in] | method | the requested CL-to-OL method |
Definition at line 1404 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Normalize a noise-estimation-domain name to lowercase hyphenated form.
| [in] | domain | the requested domain name |
Definition at line 1347 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Normalize a noise-estimation-range name to lowercase hyphenated form.
| [in] | range | the requested PSD-end selector |
Definition at line 1366 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Normalize a noise-estimation-statistic name to lowercase hyphenated form.
| [in] | statistic | the requested noise-fit statistic |
Definition at line 1385 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Normalize a power-law crossover mode name to lowercase hyphenated form.
| [in] | mode | the requested crossover mode |
Definition at line 1423 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Evaluate the extrapolated power-law continuum at one frequency bin.
| [in] | extrapolation | the continuum normalization |
| [in] | freq | the one-sided frequency grid |
| [in] | index | the bin index to evaluate |
| [in] | powerLawIndex | the power-law exponent |
| [in] | powerLawNormFreq | the continuum normalization frequency |
Definition at line 1687 of file modalPsdProcessor.hpp.
|
staticprotectedinherited |
Resolve effective power-law match and cutoff frequencies for manual or automatic crossover modes.
| powerLawMatchFreq | [in.out] match frequency | |
| powerLawOnlyAboveFreq | [in.out] cutoff frequency | |
| [in] | rawProcessPsd | raw OL disturbance PSD |
| [in] | smoothedProcessPsd | smoothed OL disturbance PSD |
| [in] | noisePsd | OL noise PSD |
| [in] | freq | frequency grid |
| [in] | powerLawCrossoverMode | mode |
| [in] | powerLawAutoMaxFreqFraction | the maximum searched frequency as a fraction of the sampled maximum |
Definition at line 1629 of file modalPsdProcessor.hpp.
Referenced by libXWCTest::modalGainOptTest::TEST_CASE().
|
staticprotectedinherited |
Resolve the power-law normalization frequency, defaulting to the first positive bin.
| [in] | freq | the one-sided frequency grid |
| [in] | requestedNormFreq | the requested normalization frequency |
Definition at line 1670 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default minimum fraction of significant raw-CL bins required to keep processing a mode.
Definition at line 125 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default closed-loop to open-loop PSD reconstruction method.
Definition at line 58 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default raw-CL significance threshold multiplier.
Definition at line 121 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default dropout-detection threshold factor.
Definition at line 111 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default maximum repaired dropout-run length in bins.
Definition at line 118 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default factor below the local good-bin scale that a candidate run must reach to be considered a true dropout.
Definition at line 115 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default choice to keep the power-law exponent fixed.
Definition at line 74 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default LP-continuum smoothing width.
Definition at line 128 of file modalPsdProcessor.hpp.
Referenced by MagAOX::app::modalGainOpt::goptThreadExec().
|
staticconstexprinherited |
The default domain used for noise-floor estimation.
Definition at line 46 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default disabled maximum frequency for low-frequency noise estimation.
Definition at line 52 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default end of the PSD used for noise-floor estimation.
Definition at line 49 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default statistic used to estimate the flat noise floor.
Definition at line 55 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default broad-peak detection factor.
Definition at line 99 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default strong-peak detection factor.
Definition at line 96 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default minimum accepted broad-peak width in dex.
Definition at line 102 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default number of subtract-and-redetect peak passes.
Definition at line 108 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default wide smoothing width used by peak detection.
Definition at line 93 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default lower bound on the Moffat beta parameter.
Definition at line 105 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default fraction of the maximum sampled frequency searched by the automatic crossover finder. Set to 0 to disable the cap.
Definition at line 71 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default median-smoothing width used by the automatic crossover finder.
Definition at line 67 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default number of bins used to blend between the raw PSD and the extrapolated continuum.
Definition at line 90 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default crossover-selection mode for the power-law handoff.
Definition at line 64 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default width of each exponent-fit median bin.
Definition at line 86 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default choice to include the match point in the exponent fit.
Definition at line 77 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default high edge of the power-law exponent fit range.
Definition at line 83 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default low edge of the power-law exponent fit range.
Definition at line 80 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default 1/f^a exponent.
Definition at line 37 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default half-width of the local match-frequency fallback window.
Definition at line 61 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default disabled explicit power-law match frequency.
Definition at line 43 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default auto-selected power-law normalization frequency.
Definition at line 40 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default disabled cutoff above which the extrapolation is pure power law only.
Definition at line 132 of file modalPsdProcessor.hpp.
|
staticconstexprinherited |
The default process-method name.
Definition at line 34 of file modalPsdProcessor.hpp.