API
 
Loading...
Searching...
No Matches
modalPsdProcessor.hpp File Reference

Header-only template class for modal PSD noise estimation and disturbance extrapolation. More...

#include <algorithm>
#include <cctype>
#include <cmath>
#include <limits>
#include <string>
#include <vector>
#include <mx/error/error.hpp>
#include <mx/math/func/moffat.hpp>
#include <mx/math/vectorUtils.hpp>
Include dependency graph for modalPsdProcessor.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MagAOX::app::modalPsdProcessor< realT >
 
struct  MagAOX::app::modalPsdProcessor< realT >::processModelConfig
 Configuration of the disturbance-PSD extrapolation model. More...
 
struct  MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D
 Description of one detected spectral peak. More...
 
struct  MagAOX::app::modalPsdProcessor< realT >::processResults
 Results of modal PSD noise estimation and disturbance extrapolation. More...
 

Namespaces

namespace  MagAOX
 
namespace  MagAOX::app
 

Detailed Description

Header-only template class for modal PSD noise estimation and disturbance extrapolation.

Author
OpenAI Codex

Definition in file modalPsdProcessor.hpp.


Class Documentation

◆ MagAOX::app::modalPsdProcessor::processModelConfig

struct MagAOX::app::modalPsdProcessor::processModelConfig
template<typename realT>
struct MagAOX::app::modalPsdProcessor< realT >::processModelConfig

Configuration of the disturbance-PSD extrapolation model.

Definition at line 135 of file modalPsdProcessor.hpp.

Collaboration diagram for MagAOX::app::modalPsdProcessor< realT >::processModelConfig:
Collaboration graph
Class Members
realT m_clMinSignificantFraction { c_defaultClMinSignificantFraction }

The minimum fraction of raw-CL bins that must be significant for a mode to remain active.

string m_closedLoopOlEstimateMethod { c_defaultClosedLoopOlEstimateMethod }

How to reconstruct the OL PSD from a CL PSD when estimating noise in CL space.

realT m_clSignificanceThreshold { c_defaultClSignificanceThreshold }

The multiplier above the fitted raw-CL noise floor required for a bin to be considered significant.

realT m_dropoutGapFactor { c_defaultDropoutGapFactor } The threshold used to identify dropout bins.
size_t m_dropoutMaxBins { c_defaultDropoutMaxBins } The maximum dropout-run length repaired by the gap-filling logic.
realT m_dropoutTinyFactor { c_defaultDropoutTinyFactor }

The factor below the local good-bin scale that a candidate run must reach to be considered a true dropout.

bool m_fitPowerLawIndex { c_defaultFitPowerLawIndex } Whether to fit the power-law exponent from high-frequency bins.
string m_method { c_defaultProcessMethod } The extrapolation method name.
string m_noiseEstimateDomain { c_defaultNoiseEstimateDomain } The domain used to estimate the flat noise floor.
realT m_noiseEstimateLowFreqMaxHz { c_defaultNoiseEstimateLowFreqMaxHz }

The maximum frequency in Hz used by the low-frequency noise estimate, or 0 to disable.

string m_noiseEstimateRange { c_defaultNoiseEstimateRange } Which end of the PSD is used to estimate the flat noise floor.
string m_noiseEstimateStatistic { c_defaultNoiseEstimateStatistic }

Which statistic is used to estimate the flat noise floor from the selected bins.

realT m_peakDetectBroadFactor { c_defaultPeakDetectBroadFactor } The lower factor used for broad-peak candidates.
realT m_peakDetectFactor { c_defaultPeakDetectFactor } The minimum factor above the smoothed PSD for a strong peak.
realT m_peakDetectMinWidthLog { c_defaultPeakDetectMinWidthLog } The minimum accepted broad-peak width in log-frequency.
int m_peakDetectPasses { c_defaultPeakDetectPasses } The number of iterative peak-detection passes.
realT m_peakDetectWidthHz { c_defaultPeakDetectWidthHz } The wide smoothing width used for peak detection.
realT m_peakMoffatBeta { c_defaultPeakMoffatBeta } The minimum Moffat beta used for synthesized peaks.
realT m_powerLawAutoMaxFreqFraction { c_defaultPowerLawAutoMaxFreqFraction }

The fraction of the maximum sampled frequency searched when automatically locating the crossover. Set to 0 to disable the cap.

realT m_powerLawAutoSmoothWidthHz { c_defaultPowerLawAutoSmoothWidthHz }

The median-smoothing width used when automatically locating the crossover.

int m_powerLawBlendBins { c_defaultPowerLawBlendBins }

The number of bins used to blend between the measured PSD and the extrapolated continuum.

string m_powerLawCrossoverMode { c_defaultPowerLawCrossoverMode } How the power-law match/cutoff frequencies are chosen.
realT m_powerLawFitBinWidthHz { c_defaultPowerLawFitBinWidthHz } The width of the exponent-fit median bins.
bool m_powerLawFitIncludesMatchPoint { c_defaultPowerLawFitIncludesMatchPoint } Whether the match point is included directly in the exponent fit.
realT m_powerLawFitMaxFreqHz { c_defaultPowerLawFitMaxFreqHz } The high edge of the exponent-fit range.
realT m_powerLawFitMinFreqHz { c_defaultPowerLawFitMinFreqHz } The low edge of the exponent-fit range.
realT m_powerLawIndex { c_defaultPowerLawIndex } The power-law exponent $a$ in $1/f^a$.
realT m_powerLawMatchFallbackWindowHz { c_defaultPowerLawMatchFallbackWindowHz }

The half-width of the local fallback window used when the match point is in a trough.

realT m_powerLawMatchFreq { c_defaultPowerLawMatchFreq }

The frequency where the power law is forced to match the raw disturbance PSD.

realT m_powerLawNormFreq { c_defaultPowerLawNormFreq } The normalization frequency for the power-law continuum.
realT m_powerLawOnlyAboveFreq { c_defaultPowerLawOnlyAboveFreq } Above this frequency, force the extrapolation to be power-law only.

◆ MagAOX::app::modalPsdProcessor::identifiedPeak1D

struct MagAOX::app::modalPsdProcessor::identifiedPeak1D
template<typename realT>
struct MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D

Description of one detected spectral peak.

Definition at line 243 of file modalPsdProcessor.hpp.

Collaboration diagram for MagAOX::app::modalPsdProcessor< realT >::identifiedPeak1D:
Collaboration graph
Class Members
realT m_centerFreq { 0 } The detected peak center frequency in Hz.
size_t m_end { 0 } The last PSD bin in the detected peak region.
realT m_fwhm { 0 } The peak full-width at half maximum in Hz.
realT m_peakHeight { 0 } The peak height above the continuum PSD.
size_t m_peakIndex { 0 } The PSD bin containing the detected peak maximum.
size_t m_start { 0 } The first PSD bin in the detected peak region.

◆ MagAOX::app::modalPsdProcessor::processResults

struct MagAOX::app::modalPsdProcessor::processResults
template<typename realT>
struct MagAOX::app::modalPsdProcessor< realT >::processResults

Results of modal PSD noise estimation and disturbance extrapolation.

Definition at line 265 of file modalPsdProcessor.hpp.

Collaboration diagram for MagAOX::app::modalPsdProcessor< realT >::processResults:
Collaboration graph
Class Members
string m_closedLoopOlEstimateMethod { c_defaultClosedLoopOlEstimateMethod } Which CL-to-OL reconstruction method was used.
realT m_dropoutGapFactor { c_defaultDropoutGapFactor } The threshold used to identify dropout bins.
size_t m_dropoutMaxBins { c_defaultDropoutMaxBins } The maximum repaired dropout-run length in bins.
realT m_dropoutTinyFactor { c_defaultDropoutTinyFactor }

The factor below the local good-bin scale that a candidate run must reach to be considered a true dropout.

realT m_extrapolation { 0 } The continuum normalization at m_powerLawNormFreq.
bool m_fitPowerLawIndex { c_defaultFitPowerLawIndex } Whether the exponent was requested to be fit from the PSD.
realT m_lpContinuumFreq { 0 } The LP-only continuum cutoff frequency in Hz.
realT m_lpContinuumWidthHz { c_defaultLpContinuumWidthHz } The LP-only continuum smoothing width in Hz.
vector< realT > m_lpProcessPsd The disturbance PSD passed to the LP optimizer.
string m_noiseEstimateDomain { c_defaultNoiseEstimateDomain } The domain used to estimate the flat noise floor.
realT m_noiseEstimateLowFreqMaxHz { c_defaultNoiseEstimateLowFreqMaxHz }

The maximum frequency in Hz used by the low-frequency noise estimate, or 0 if disabled.

string m_noiseEstimateRange { c_defaultNoiseEstimateRange } Which end of the PSD was used to estimate the flat noise floor.
string m_noiseEstimateStatistic { c_defaultNoiseEstimateStatistic }

Which statistic was used to estimate the flat noise floor from the selected bins.

realT m_noiseFloor { 0 } The fitted flat noise floor.
vector< realT > m_noisePsd The flat noise PSD estimate.
realT m_peakDetectBroadFactor { c_defaultPeakDetectBroadFactor } The broad peak-detection factor threshold.
realT m_peakDetectFactor { c_defaultPeakDetectFactor } The strong peak-detection factor threshold.
realT m_peakDetectMinWidthLog { c_defaultPeakDetectMinWidthLog } The minimum accepted broad-peak width in dex.
int m_peakDetectPasses { c_defaultPeakDetectPasses } The number of iterative peak-detection passes.
realT m_peakDetectWidthHz { c_defaultPeakDetectWidthHz } The peak-detection smoothing width.
realT m_peakMoffatBeta { c_defaultPeakMoffatBeta } The Moffat beta used for synthesized peaks.
vector< identifiedPeak1D > m_peaks The peaks detected by the Moffat extrapolator.
realT m_powerLawAnchorFreq { 0 } The frequency where the continuum takes over.
size_t m_powerLawAnchorIndex { 0 } The last frequency bin used to anchor the continuum.
realT m_powerLawAutoMaxFreqFraction { c_defaultPowerLawAutoMaxFreqFraction }

The fraction of the maximum sampled frequency searched when automatically locating the crossover. Set to 0 to disable the cap.

realT m_powerLawAutoSmoothWidthHz { c_defaultPowerLawAutoSmoothWidthHz }

The median-smoothing width used when automatically locating the crossover.

int m_powerLawBlendBins { c_defaultPowerLawBlendBins } The blend width used at the power-law anchor.
string m_powerLawCrossoverMode { c_defaultPowerLawCrossoverMode } How the power-law match/cutoff frequencies were chosen.
size_t m_powerLawFitBinsUsed { 0 } The number of populated median bins used in the exponent fit.
realT m_powerLawFitBinWidthHz { c_defaultPowerLawFitBinWidthHz } The width of the exponent-fit median bins.
bool m_powerLawFitIncludesMatchPoint { c_defaultPowerLawFitIncludesMatchPoint } Whether the exponent fit included the explicit match point.
realT m_powerLawFitMaxFreqHz { c_defaultPowerLawFitMaxFreqHz } The high edge of the exponent-fit range.
realT m_powerLawFitMinFreqHz { c_defaultPowerLawFitMinFreqHz } The low edge of the exponent-fit range.
realT m_powerLawIndex { c_defaultPowerLawIndex } The power-law exponent used in extrapolation.
bool m_powerLawIndexFitSucceeded { false } Whether the exponent fit succeeded and was applied.
realT m_powerLawMatchFallbackWindowHz { c_defaultPowerLawMatchFallbackWindowHz } The half-width of the local match-frequency fallback window.
realT m_powerLawMatchFreq { 0 }

The frequency where the power law is forced to match the disturbance PSD.

realT m_powerLawNormFreq { 0 } The resolved normalization frequency of the power-law model.
realT m_powerLawOnlyAboveFreq { c_defaultPowerLawOnlyAboveFreq } Above this frequency, force the extrapolation to be power-law only.
string m_processMethod { c_defaultProcessMethod } The extrapolation method used for the disturbance PSD.
vector< realT > m_processPsd The disturbance PSD used for optimization.
vector< realT > m_rawProcessPsd The unsmoothed, unextrapolated OL disturbance PSD.
vector< realT > m_smoothedProcessPsd The smoothed but still unextrapolated OL disturbance PSD.