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

template<typename _realT>
struct mx::AO::analysis::clGainOpt< _realT >

A class to manage optimizing closed-loop gains.

Template Parameters
_realTthe real floating point type in which to do all arithmetic. Is used to define the complex type as well.

Definition at line 68 of file clGainOpt.hpp.

#include <ao/analysis/clGainOpt.hpp>

Classes

struct  maxStableGainReport
 Diagnostic summary of a maximum-stable-gain search. More...
struct  optGainReport
 Diagnostic summary of an open-loop optimum-gain search. More...

Public Types

enum class  maxStableGainStatus { notRun , crossingFound , invalidInput , noCrossing }
 Termination state of a maximum-stable-gain search. More...
enum class  optGainStatus {
  notRun , converged , boundaryLimited , invalidInput ,
  stabilityFailure , iterationLimit , calculationFailure
}
 Termination state of an open-loop optimum-gain search. More...
typedef _realT realT
 The real data type.
typedef std::complex< _realT > complexT
 The complex data type.

Public Member Functions

 clGainOpt ()
 Default c'tor.
 clGainOpt (realT Ti, realT tau)
 C'tor setting the loop timings.
void init ()
 Initialize this instance.
int N ()
 Get the number of integrations in the (optional) moving average.
void N (int newN)
 Set the number of integrations in the moving average.
realT Ti ()
 Get the loop sampling interval.
void Ti (realT newTi)
 Set the loop sampling interval.
realT tau ()
 Get the loop delay.
void tau (realT newTau)
 Set the loop delay.
void b (const std::vector< realT > &newB)
 Set the vector of FIR coefficients.
void b (const Eigen::Array< realT, -1, -1 > &newB)
 Set the vector of FIR coefficients.
realT b (size_t i)
 Get a single FIR coefficient.
const std::vector< realT > & b ()
 Get the vector of FIR coefficients.
void a (const std::vector< realT > &newA)
 Set the vector of IIR coefficients.
void a (const Eigen::Array< realT, -1, -1 > &newA)
 Set the vector of IIR coefficients.
realT a (size_t i)
 Get a single IIR coefficient.
const std::vector< realT > & a ()
 Get the vector of IIR coefficients.
void remember (const realT &rem)
 Set the remember factor for a leaky integrator.
realT remember ()
 Get the remember factor.
void setLeakyIntegrator (realT remember)
 Set the FIR and IIR coefficients so that the control law is a leaky integrator.
void f (realT *newF, size_t nF)
 Set the vector of frequencies.
void f (const std::vector< realT > &newF)
 Set the vector of frequencies.
size_t f_size ()
 Get the size of the frequency vector.
realT f (size_t i)
 Get the i-th value of frequency.
complexT olXfer (int fi, complexT &H_dm, complexT &H_del, complexT &H_con)
 Calculate the open-loop transfer function.
complexT olXfer (int fi)
 Calculate the open-loop transfer function.
complexT clETF (int fi, realT g)
 Return the closed loop error transfer function (ETF) at frequency f for gain g.
realT clETFPhase (int fi, realT g)
 Return the closed loop error transfer function (ETF) phase at frequency f for gain g.
realT clETF2 (int fi, realT g)
 Return the norm of the closed loop error transfer function (ETF) at frequency f for gain g.
complexT clNTF (int fi, realT g)
 Return the closed loop noise transfer function (NTF) at frequency f for gain g.
realT clNTF2 (int fi, realT g)
 Return the norm of the closed loop noise transfer function (NTF) at frequency f for gain g.
void clTF2 (realT &ETF, realT &NTF, int fi, realT g)
 Return the norm of the closed loop transfer functions at frequency f for gain g.
realT clVariance (realT &varErr, realT &varNoise, const std::vector< realT > &PSDerr, const std::vector< realT > &PSDnoise, realT g)
 Calculate the closed loop variance given open-loop PSDs and gain.
realT clVariance (const std::vector< realT > &PSDerr, const std::vector< realT > &PSDnoise, realT g)
 Calculate the closed loop variance given open-loop PSDs and gain.
mx::error_t maxStableGain (realT &gain, maxStableGainReport *report=nullptr)
 Find the maximum stable gain for the loop parameters.
mx::error_t optGainOpenLoop (realT &gain, realT &var, const std::vector< realT > &PSDerr, const std::vector< realT > &PSDnoise, bool gridSearch, optGainReport *report=nullptr)
 Return the optimum closed loop gain given an open loop PSD.
mx::error_t optGainOpenLoop (realT &gain, realT &var, const std::vector< realT > &PSDerr, const std::vector< realT > &PSDnoise, realT maximumGain, bool gridSearch, optGainReport *report=nullptr)
 Return the optimum closed loop gain given an open loop PSD.
int pseudoOpenLoop (std::vector< realT > &PSD, realT g)
 Calculate the pseudo open-loop PSD given a closed loop PSD.

Public Attributes

realT m_maxFindMin
 The Minimum value for the maximum stable gain finding algorithm.
realT m_minFindMin
 The Minimum value for the minimum finding algorithm.
realT m_minFindMaxFact
 The maximum value, as a multiplicative factor of maximum gain.
int m_minFindBits
uintmax_t m_minFindMaxIter
 The maximum iterations allowed for minimization.

Protected Attributes

int m_N
 Number of integrations in the (optional) moving average. Default is 1.
realT m_Ti
 The loop sampling interval.
realT m_tau
 The loop delay.
realT m_remember { 1.0 }
 The leaky integrator forget factor.
std::vector< realTm_b
 Vector of FIR coefficients.
std::vector< realTm_a
 Vector of IIR coefficients.
std::vector< realTm_f
 Vector of frequencies.
bool m_trigCacheChanged { true }
 True when frequency, sampling interval, or required controller tap count invalidates m_cs and m_ss.
bool m_changed { true }
 True if any of the members which make up the basic transfer functions are changed.

Member Typedef Documentation

◆ complexT

template<typename _realT>
typedef std::complex<_realT> mx::AO::analysis::clGainOpt< _realT >::complexT

The complex data type.

Definition at line 71 of file clGainOpt.hpp.

◆ realT

template<typename _realT>
typedef _realT mx::AO::analysis::clGainOpt< _realT >::realT

The real data type.

Definition at line 70 of file clGainOpt.hpp.

Member Enumeration Documentation

◆ maxStableGainStatus

template<typename _realT>
enum class mx::AO::analysis::clGainOpt::maxStableGainStatus
strong

Termination state of a maximum-stable-gain search.

Enumerator
notRun 

No search has been attempted.

crossingFound 

A qualifying Nyquist crossing was found.

invalidInput 

The frequency grid or derived Nyquist values were invalid.

noCrossing 

No qualifying Nyquist crossing was found.

Definition at line 74 of file clGainOpt.hpp.

◆ optGainStatus

template<typename _realT>
enum class mx::AO::analysis::clGainOpt::optGainStatus
strong

Termination state of an open-loop optimum-gain search.

Enumerator
notRun 

No search has been attempted.

converged 

The minimizer converged inside the search interval.

boundaryLimited 

The reported minimum lies on a search boundary.

invalidInput 

The PSDs, search controls, or requested interval were invalid.

stabilityFailure 

The automatic maximum-stable-gain search failed.

iterationLimit 

The minimizer exhausted its iteration limit.

calculationFailure 

The minimizer threw or returned invalid output.

Definition at line 96 of file clGainOpt.hpp.

Constructor & Destructor Documentation

◆ clGainOpt() [1/2]

template<typename realT>
mx::AO::analysis::clGainOpt< realT >::clGainOpt ( )

Default c'tor.

Definition at line 467 of file clGainOpt.hpp.

References init().

◆ clGainOpt() [2/2]

template<typename realT>
mx::AO::analysis::clGainOpt< realT >::clGainOpt ( realT Ti,
realT tau )

C'tor setting the loop timings.

Parameters
[in]Tithe desired loop sampling interval.
[in]tauthe desired loop delay.

Definition at line 473 of file clGainOpt.hpp.

References init(), m_tau, m_Ti, tau(), and Ti().

Member Function Documentation

◆ a() [1/4]

template<typename _realT>
const std::vector< realT > & mx::AO::analysis::clGainOpt< _realT >::a ( )
inline

Get the vector of IIR coefficients.

Definition at line 268 of file clGainOpt.hpp.

References m_a.

◆ a() [2/4]

template<typename realT>
void mx::AO::analysis::clGainOpt< realT >::a ( const Eigen::Array< realT, -1, -1 > & newA)

Set the vector of IIR coefficients.

Parameters
[in]newAa column-vector Eigen::Array of coefficients, which is copied to m_a.

Definition at line 611 of file clGainOpt.hpp.

References m_a, m_changed, and m_trigCacheChanged.

◆ a() [3/4]

template<typename realT>
void mx::AO::analysis::clGainOpt< realT >::a ( const std::vector< realT > & newA)

Set the vector of IIR coefficients.

Parameters
[in]newAa vector of coefficients, which is copied to m_a.

Definition at line 599 of file clGainOpt.hpp.

References m_a, m_changed, and m_trigCacheChanged.

Referenced by mx::AO::analysis::clAOLinearPredictor< _realT >::_regularizeCoefficients(), mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::analyzePSDGrid(), and mx::AO::analysis::clAOLinearPredictor< _realT >::regularizeCoefficients().

◆ a() [4/4]

template<typename _realT>
realT mx::AO::analysis::clGainOpt< _realT >::a ( size_t i)
inline

Get a single IIR coefficient.

Returns
a single IIR coefficient

Definition at line 260 of file clGainOpt.hpp.

References m_a.

◆ b() [1/4]

template<typename _realT>
const std::vector< realT > & mx::AO::analysis::clGainOpt< _realT >::b ( )
inline

Get the vector of FIR coefficients.

Definition at line 239 of file clGainOpt.hpp.

References m_b.

◆ b() [2/4]

template<typename realT>
void mx::AO::analysis::clGainOpt< realT >::b ( const Eigen::Array< realT, -1, -1 > & newB)

Set the vector of FIR coefficients.

Parameters
[in]newBa column-vector Eigen::Array of coefficients, which is copied to m_b.

Definition at line 570 of file clGainOpt.hpp.

References m_b, m_changed, and m_trigCacheChanged.

◆ b() [3/4]

template<typename realT>
void mx::AO::analysis::clGainOpt< realT >::b ( const std::vector< realT > & newB)

Set the vector of FIR coefficients.

Parameters
[in]newBa vector of coefficients, which is copied to m_b.

Definition at line 558 of file clGainOpt.hpp.

References m_b, m_changed, and m_trigCacheChanged.

Referenced by mx::AO::analysis::clAOLinearPredictor< _realT >::_regularizeCoefficients(), mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::analyzePSDGrid(), and mx::AO::analysis::clAOLinearPredictor< _realT >::regularizeCoefficients().

◆ b() [4/4]

template<typename _realT>
realT mx::AO::analysis::clGainOpt< _realT >::b ( size_t i)
inline

Get a single FIR coefficient.

Returns
a single FIR coefficient
Parameters
[in]ithe index of the FIR coefficient

Definition at line 231 of file clGainOpt.hpp.

References m_b.

◆ clETF()

template<typename realT>
std::complex< realT > mx::AO::analysis::clGainOpt< realT >::clETF ( int fi,
realT g )

Return the closed loop error transfer function (ETF) at frequency f for gain g.

Returns
the closed loop ETF at f and g.
Parameters
[in]fithe index of the frequency at which to calculate the ETF
[in]gthe loop gain.

Definition at line 877 of file clGainOpt.hpp.

References m_f, and olXfer().

Referenced by mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::analyzePSDGrid().

◆ clETF2()

template<typename realT>
realT mx::AO::analysis::clGainOpt< realT >::clETF2 ( int fi,
realT g )

Return the norm of the closed loop error transfer function (ETF) at frequency f for gain g.

Returns
the norm of the closed loop ETF at f and g.
Parameters
[in]fithe index of the frequency at which to calculate the ETF.
[in]gthe loop gain.

Definition at line 905 of file clGainOpt.hpp.

References m_f, and olXfer().

Referenced by pseudoOpenLoop().

◆ clETFPhase()

template<typename realT>
realT mx::AO::analysis::clGainOpt< realT >::clETFPhase ( int fi,
realT g )

Return the closed loop error transfer function (ETF) phase at frequency f for gain g.

Returns
the phase of the closed loop ETF at f and g.
Parameters
[in]fithe index of the frequency at which to calculate the ETF
[in]gthe loop gain.

Definition at line 891 of file clGainOpt.hpp.

References m_f, and olXfer().

◆ clNTF()

template<typename realT>
std::complex< realT > mx::AO::analysis::clGainOpt< realT >::clNTF ( int fi,
realT g )

Return the closed loop noise transfer function (NTF) at frequency f for gain g.

Returns
the closed loop NTF at f and g.
Parameters
[in]fithe index of the frequency at which to calculate the NTF
[in]gthe loop gain.

Definition at line 919 of file clGainOpt.hpp.

References m_f, and olXfer().

Referenced by mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::analyzePSDGrid().

◆ clNTF2()

template<typename realT>
realT mx::AO::analysis::clGainOpt< realT >::clNTF2 ( int fi,
realT g )

Return the norm of the closed loop noise transfer function (NTF) at frequency f for gain g.

Returns
the value of the closed loop NTF at f and g.
Parameters
[in]fithe index of the frequency at which to calculate the NTF
[in]gthe loop gain.

Definition at line 937 of file clGainOpt.hpp.

References m_f, and olXfer().

◆ clTF2()

template<typename realT>
void mx::AO::analysis::clGainOpt< realT >::clTF2 ( realT & ETF,
realT & NTF,
int fi,
realT g )

Return the norm of the closed loop transfer functions at frequency f for gain g.

Calculates both the error transfer function (ETF) and the noise transfer function (NTF). This minimizes the various complex number operations, compared to calling both clETF2 and clNTF2.

Parameters
[out]ETFis set to the ETF at f and g
[out]NTFis set to the NTF at f and g
[in]fiis the index of the frequency at which to calculate the ETF
[in]gis the loop gain.

Definition at line 957 of file clGainOpt.hpp.

References m_f, and olXfer().

Referenced by mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::analyzePSDGrid(), and clVariance().

◆ clVariance() [1/2]

template<typename realT>
realT mx::AO::analysis::clGainOpt< realT >::clVariance ( const std::vector< realT > & PSDerr,
const std::vector< realT > & PSDnoise,
realT g )

Calculate the closed loop variance given open-loop PSDs and gain.

Overload of clVariance without the varErr and varNoise output parameters.

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

Returns
the total variance (error + noise) in closed loop
Parameters
[in]PSDerrthe open-loop process error PSD.
[in]PSDnoisethe open-loop measurement noise PSD.
[in]gthe gain.

Definition at line 1023 of file clGainOpt.hpp.

References clVariance().

◆ clVariance() [2/2]

template<typename realT>
realT mx::AO::analysis::clGainOpt< realT >::clVariance ( realT & varErr,
realT & varNoise,
const std::vector< realT > & PSDerr,
const std::vector< realT > & PSDnoise,
realT g )

Calculate the closed loop variance given open-loop PSDs and gain.

Calculates the following quantities.

\[\sigma_{err}^2 = \sum_i \left| ETF(f_i) \right|^2 PSD_{err}(fi) \Delta f\\ \sigma_{noise}^2 = \sum_i \left| NTF(f_i) \right|^2 PSD_{noise}(fi) \Delta f\\ \sigma^2 = \sigma_{err}^2 + \sigma_{noise}^2 \]

\( \sigma^2 \) is returned, and \( \sigma_{err}^2 \) and \( \sigma_{noise}^2 \) are available as the optional arguments varErr and varNoise.

Returns
the total variance (error + noise) in closed loop
Parameters
[out]varErrthe variance in the residual process error.
[out]varNoisethe variance in the residual measurement noise.
[in]PSDerrthe open-loop process error PSD.
[in]PSDnoisethe open-loop measurement noise PSD.
[in]gthe gain.

Definition at line 988 of file clGainOpt.hpp.

References clTF2(), and m_f.

Referenced by mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::analyzePSDGrid(), and clVariance().

◆ f() [1/3]

template<typename realT>
void mx::AO::analysis::clGainOpt< realT >::f ( const std::vector< realT > & newF)

Set the vector of frequencies.

Parameters
[in]newFa vector containing the new frequencies

Definition at line 697 of file clGainOpt.hpp.

References m_changed, m_f, and m_trigCacheChanged.

◆ f() [2/3]

template<typename realT>
void mx::AO::analysis::clGainOpt< realT >::f ( realT * newF,
size_t nF )

Set the vector of frequencies.

Parameters
[in]newFa pointer to an array containing the new frequencies
[in]nFthe number of elements of size(realT) in newF.

Definition at line 684 of file clGainOpt.hpp.

References m_changed, m_f, and m_trigCacheChanged.

Referenced by mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::analyzePSDGrid(), and pseudoOpenLoop().

◆ f() [3/3]

template<typename realT>
realT mx::AO::analysis::clGainOpt< realT >::f ( size_t i)

Get the i-th value of frequency.

No range checks are conducted.

Returns
the value of m_f[i]
Parameters
[in]ithe index of the frequency to return

Definition at line 706 of file clGainOpt.hpp.

References m_f.

◆ f_size()

template<typename _realT>
size_t mx::AO::analysis::clGainOpt< _realT >::f_size ( )
inline

Get the size of the frequency vector.

Returns
m_f.size()

Definition at line 304 of file clGainOpt.hpp.

References m_f.

◆ init()

template<typename realT>
void mx::AO::analysis::clGainOpt< realT >::init ( )

Initialize this instance.

Definition at line 482 of file clGainOpt.hpp.

References m_changed, m_maxFindMin, m_minFindBits, m_minFindMaxFact, m_minFindMaxIter, m_minFindMin, m_N, m_tau, m_Ti, m_trigCacheChanged, and setLeakyIntegrator().

Referenced by clGainOpt(), and clGainOpt().

◆ maxStableGain()

template<typename realT>
mx::error_t mx::AO::analysis::clGainOpt< realT >::maxStableGain ( realT & gain,
maxStableGainReport * report = nullptr )

◆ N() [1/2]

template<typename realT>
int mx::AO::analysis::clGainOpt< realT >::N ( )

Get the number of integrations in the (optional) moving average.

Returns
the current value of m_N.

Definition at line 503 of file clGainOpt.hpp.

References m_N.

◆ N() [2/2]

template<typename realT>
void mx::AO::analysis::clGainOpt< realT >::N ( int newN)

Set the number of integrations in the moving average.

Parameters
[in]newNthe value of m_N.

Definition at line 509 of file clGainOpt.hpp.

References m_changed, and m_N.

◆ olXfer() [1/2]

template<typename realT>
std::complex< realT > mx::AO::analysis::clGainOpt< realT >::olXfer ( int fi)

Calculate the open-loop transfer function.

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

Returns
the complex value of the open-loop transfer function at f[fi].
Parameters
[in]fithe index of the frequency

Definition at line 713 of file clGainOpt.hpp.

References olXfer().

◆ olXfer() [2/2]

template<typename realT>
std::complex< realT > mx::AO::analysis::clGainOpt< realT >::olXfer ( int fi,
complexT & H_dm,
complexT & H_del,
complexT & H_con )

Calculate the open-loop transfer function.

Returns
the complex value of the open-loop transfer function at f.
Parameters
[in]fithe index of the frequency
[out]H_dmthe transfer function of the DM
[out]H_delthe delay transfer function
[out]H_conthe controller transfer function.

Definition at line 727 of file clGainOpt.hpp.

References m_a, m_b, m_changed, m_f, m_remember, m_tau, m_Ti, m_trigCacheChanged, and mx::math::two_pi().

Referenced by clETF(), clETF2(), clETFPhase(), clNTF(), clNTF2(), clTF2(), and olXfer().

◆ optGainOpenLoop() [1/2]

template<typename realT>
mx::error_t mx::AO::analysis::clGainOpt< realT >::optGainOpenLoop ( realT & gain,
realT & var,
const std::vector< realT > & PSDerr,
const std::vector< realT > & PSDnoise,
bool gridSearch,
optGainReport * report = nullptr )

Return the optimum closed loop gain given an open loop PSD.

Determines the maximum stable gain before minimizing the variance.

Returns
error_t::noerror on convergence or a boundary-limited result, otherwise an explicit failure status.
Parameters
[out]gainoptimum gain; NaN on failure
[out]varvariance at the optimum gain; NaN on failure
[in]PSDerropen-loop error PSD
[in]PSDnoiseopen-loop measurement-noise PSD
[in]gridSearchwhether to perform a coarse initial search
[out]reportoptional search diagnostics

Definition at line 1215 of file clGainOpt.hpp.

References maxStableGain(), mx::noerror, optGainOpenLoop(), mx::AO::analysis::clGainOpt< _realT >::optGainReport::stability, stabilityFailure, and mx::AO::analysis::clGainOpt< _realT >::optGainReport::status.

Referenced by mx::AO::analysis::clAOLinearPredictor< _realT >::_regularizeCoefficients(), mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::analyzePSDGrid(), optGainOpenLoop(), and mx::AO::analysis::clAOLinearPredictor< _realT >::regularizeCoefficients().

◆ optGainOpenLoop() [2/2]

template<typename realT>
mx::error_t mx::AO::analysis::clGainOpt< realT >::optGainOpenLoop ( realT & gain,
realT & var,
const std::vector< realT > & PSDerr,
const std::vector< realT > & PSDnoise,
realT maximumGain,
bool gridSearch,
optGainReport * report = nullptr )

Return the optimum closed loop gain given an open loop PSD.

Returns
error_t::noerror on convergence or a boundary-limited result, otherwise an explicit failure status.
Parameters
[out]gainoptimum gain; best estimate on timeout
[out]varvariance at the optimum gain
[in]PSDerropen-loop error PSD
[in]PSDnoiseopen-loop measurement-noise PSD
[in]maximumGainmaximum stable gain bounding the search
[in]gridSearchwhether to perform a coarse initial search
[out]reportoptional search diagnostics

Definition at line 1249 of file clGainOpt.hpp.

References boundaryLimited, calculationFailure, converged, mx::error, mx::AO::analysis::clGainOpt< _realT >::optGainReport::evaluations, mx::AO::analysis::clGainOptOptGain_OL< realT >::evaluations, mx::AO::analysis::clGainOpt< _realT >::optGainReport::gain, mx::AO::analysis::clGainOptOptGain_OL< realT >::go, mx::invalidconfig, invalidInput, mx::math::isFinite(), iterationLimit, mx::AO::analysis::clGainOpt< _realT >::optGainReport::iterations, m_f, m_minFindBits, m_minFindMaxFact, m_minFindMaxIter, m_minFindMin, mx::AO::analysis::clGainOpt< _realT >::optGainReport::maximumEvaluatedGain, mx::AO::analysis::clGainOptOptGain_OL< realT >::maximumEvaluatedGain, mx::AO::analysis::clGainOpt< _realT >::optGainReport::minimumEvaluatedGain, mx::AO::analysis::clGainOptOptGain_OL< realT >::minimumEvaluatedGain, mx::noerror, mx::AO::analysis::clGainOptOptGain_OL< realT >::PSDerr, mx::AO::analysis::clGainOptOptGain_OL< realT >::PSDnoise, mx::AO::analysis::clGainOpt< _realT >::optGainReport::requestedMaximumGain, mx::AO::analysis::clGainOpt< _realT >::optGainReport::searchMaximumGain, mx::AO::analysis::clGainOpt< _realT >::optGainReport::searchMinimumGain, mx::sizeerr, mx::AO::analysis::clGainOpt< _realT >::optGainReport::status, mx::timeout, and mx::AO::analysis::clGainOpt< _realT >::optGainReport::variance.

◆ pseudoOpenLoop()

template<typename realT>
int mx::AO::analysis::clGainOpt< realT >::pseudoOpenLoop ( std::vector< realT > & PSD,
realT g )

Calculate the pseudo open-loop PSD given a closed loop PSD.

Returns
0 on success
Parameters
PSD[in.out] input closed loop PSD, on output contains the pseudo open loop error PSD
[in]gthe loop gain when PSD was measured.

Definition at line 1374 of file clGainOpt.hpp.

References clETF2(), f(), and m_f.

◆ remember() [1/2]

template<typename realT>
realT mx::AO::analysis::clGainOpt< realT >::remember ( )

Get the remember factor.

Definition at line 651 of file clGainOpt.hpp.

References m_remember.

◆ remember() [2/2]

template<typename realT>
void mx::AO::analysis::clGainOpt< realT >::remember ( const realT & rem)

Set the remember factor for a leaky integrator.

Definition at line 640 of file clGainOpt.hpp.

References m_changed, and m_remember.

Referenced by setLeakyIntegrator().

◆ setLeakyIntegrator()

template<typename realT>
void mx::AO::analysis::clGainOpt< realT >::setLeakyIntegrator ( realT remember)

Set the FIR and IIR coefficients so that the control law is a leaky integrator.

Set remember to 1.0 for a pure integrator control law.

Parameters
[in]remembera number usually close to 1 setting the amount "remembered" from previous iterations.

Definition at line 657 of file clGainOpt.hpp.

References m_a, m_b, m_changed, m_remember, m_trigCacheChanged, and remember().

Referenced by init().

◆ tau() [1/2]

template<typename realT>
realT mx::AO::analysis::clGainOpt< realT >::tau ( )

Get the loop delay.

Returns
the current value of m_tau.

Definition at line 540 of file clGainOpt.hpp.

References m_tau.

Referenced by clGainOpt().

◆ tau() [2/2]

template<typename realT>
void mx::AO::analysis::clGainOpt< realT >::tau ( realT newTau)

Set the loop delay.

Parameters
[in]newTauthe new value of m_tau.

Definition at line 546 of file clGainOpt.hpp.

References m_changed, and m_tau.

◆ Ti() [1/2]

template<typename realT>
realT mx::AO::analysis::clGainOpt< realT >::Ti ( )

Get the loop sampling interval.

Returns
the current value of m_Ti.

Definition at line 521 of file clGainOpt.hpp.

References m_Ti.

Referenced by clGainOpt().

◆ Ti() [2/2]

template<typename realT>
void mx::AO::analysis::clGainOpt< realT >::Ti ( realT newTi)

Set the loop sampling interval.

Parameters
[in]newTithe new value of m_Ti.

Definition at line 527 of file clGainOpt.hpp.

References m_changed, m_Ti, and m_trigCacheChanged.

Member Data Documentation

◆ m_a

template<typename _realT>
std::vector<realT> mx::AO::analysis::clGainOpt< _realT >::m_a
protected

Vector of IIR coefficients.

Definition at line 130 of file clGainOpt.hpp.

Referenced by a(), a(), a(), a(), olXfer(), and setLeakyIntegrator().

◆ m_b

template<typename _realT>
std::vector<realT> mx::AO::analysis::clGainOpt< _realT >::m_b
protected

Vector of FIR coefficients.

Definition at line 129 of file clGainOpt.hpp.

Referenced by b(), b(), b(), b(), olXfer(), and setLeakyIntegrator().

◆ m_changed

template<typename _realT>
bool mx::AO::analysis::clGainOpt< _realT >::m_changed { true }
protected

True if any of the members which make up the basic transfer functions are changed.

Definition at line 137 of file clGainOpt.hpp.

Referenced by a(), a(), b(), b(), f(), f(), init(), N(), olXfer(), remember(), setLeakyIntegrator(), tau(), and Ti().

◆ m_f

template<typename _realT>
std::vector<realT> mx::AO::analysis::clGainOpt< _realT >::m_f
protected

Vector of frequencies.

Definition at line 132 of file clGainOpt.hpp.

Referenced by clETF(), clETF2(), clETFPhase(), clNTF(), clNTF2(), clTF2(), clVariance(), f(), f(), f(), f_size(), maxStableGain(), olXfer(), optGainOpenLoop(), and pseudoOpenLoop().

◆ m_maxFindMin

template<typename _realT>
realT mx::AO::analysis::clGainOpt< _realT >::m_maxFindMin

The Minimum value for the maximum stable gain finding algorithm.

Parameters for stability analysis

Definition at line 153 of file clGainOpt.hpp.

Referenced by init(), and maxStableGain().

◆ m_minFindBits

template<typename _realT>
int mx::AO::analysis::clGainOpt< _realT >::m_minFindBits

The bits of precision to use for minimum finding. Defaults to std::numeric_limits<realT>::digits.

Definition at line 163 of file clGainOpt.hpp.

Referenced by init(), and optGainOpenLoop().

◆ m_minFindMaxFact

template<typename _realT>
realT mx::AO::analysis::clGainOpt< _realT >::m_minFindMaxFact

The maximum value, as a multiplicative factor of maximum gain.

Definition at line 162 of file clGainOpt.hpp.

Referenced by init(), and optGainOpenLoop().

◆ m_minFindMaxIter

template<typename _realT>
uintmax_t mx::AO::analysis::clGainOpt< _realT >::m_minFindMaxIter

The maximum iterations allowed for minimization.

Definition at line 165 of file clGainOpt.hpp.

Referenced by init(), and optGainOpenLoop().

◆ m_minFindMin

template<typename _realT>
realT mx::AO::analysis::clGainOpt< _realT >::m_minFindMin

The Minimum value for the minimum finding algorithm.

Parameters for minimization finding

Definition at line 161 of file clGainOpt.hpp.

Referenced by init(), and optGainOpenLoop().

◆ m_N

template<typename _realT>
int mx::AO::analysis::clGainOpt< _realT >::m_N
protected

Number of integrations in the (optional) moving average. Default is 1.

Definition at line 124 of file clGainOpt.hpp.

Referenced by init(), N(), and N().

◆ m_remember

template<typename _realT>
realT mx::AO::analysis::clGainOpt< _realT >::m_remember { 1.0 }
protected

The leaky integrator forget factor.

Definition at line 128 of file clGainOpt.hpp.

Referenced by olXfer(), remember(), remember(), and setLeakyIntegrator().

◆ m_tau

template<typename _realT>
realT mx::AO::analysis::clGainOpt< _realT >::m_tau
protected

The loop delay.

Definition at line 126 of file clGainOpt.hpp.

Referenced by clGainOpt(), init(), olXfer(), tau(), and tau().

◆ m_Ti

template<typename _realT>
realT mx::AO::analysis::clGainOpt< _realT >::m_Ti
protected

The loop sampling interval.

Definition at line 125 of file clGainOpt.hpp.

Referenced by clGainOpt(), init(), olXfer(), Ti(), and Ti().

◆ m_trigCacheChanged

template<typename _realT>
bool mx::AO::analysis::clGainOpt< _realT >::m_trigCacheChanged { true }
protected

True when frequency, sampling interval, or required controller tap count invalidates m_cs and m_ss.

Definition at line 135 of file clGainOpt.hpp.

Referenced by a(), a(), b(), b(), f(), f(), init(), olXfer(), setLeakyIntegrator(), and Ti().


The documentation for this struct was generated from the following file: