JenetAnderson98A5.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2006 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Util/genutil/JenetAnderson98A5.h
10 
11 #ifndef __Jenet_Anderson_98_A5
12 #define __Jenet_Anderson_98_A5
13 
14 #include "JenetAnderson98.h"
15 
21 
22  public:
23 
25  void set_nsamp (unsigned nsamp);
26 
28  unsigned get_nsamp () const { return losq.size(); }
29 
31  template<typename T>
32  void set_A6 (const std::vector<T>& prob)
33  {
34  double sum = 0.0;
35  for (unsigned i=0; i<prob.size(); i++)
36  sum += prob[i];
37 
38  prob_Phi.resize( prob.size() );
39  for (unsigned i=0; i<prob.size(); i++)
40  prob_Phi[i] = prob[i] / sum;
41 
42  set_nsamp( prob.size() );
43  }
44 
46  double evaluate (double mean_Phi);
47 
49  double invert (double sigma_hat);
50 
51  private:
52 
53  std::vector<double> losq;
54  std::vector<double> hisq;
55  std::vector<double> fact;
56  double dA5_dmean_Phi;
57 
58  std::vector<double> prob_Phi;
59 
60 };
61 
62 #endif
void set_Phi(double Phi)
Set the fraction of samples in the low voltage state.
Definition: JenetAnderson98.C:43
void set_A6(const std::vector< T > &prob)
Set the discrete probability distribution; used instead of A6.
Definition: JenetAnderson98A5.h:37
A convenient exception handling class.
Definition: Error.h:54
double invert(double sigma_hat)
Return the mean value of Phi, given the digitized power.
Definition: JenetAnderson98A5.C:97
double get_hi() const
Get the optimal high voltage output levels, JA98 Eq.40.
Definition: JenetAnderson98.h:60
Statistics of two-bit quantization and artifact correction parameters.
Definition: JenetAnderson98.h:38
void set_nsamp(unsigned nsamp)
Set the number of samples used to estimate the undigitized power.
Definition: JenetAnderson98A5.C:14
unsigned get_nsamp() const
Get the number of samples used to estimate the undigitized power.
Definition: JenetAnderson98A5.h:33
Manages Reference::To references to the instance.
Definition: ReferenceAble.h:40
double evaluate(double mean_Phi)
Return the digitized power, given <Phi>
Definition: JenetAnderson98A5.C:41
double get_lo() const
Get the optimal low voltage output levels, JA98 Eq.41.
Definition: JenetAnderson98.h:63
Definition: JenetAnderson98A5.h:20

Generated using doxygen 1.8.17