The functions here are static because of the nature of the underlying numerical quadrature fortran code used to integrate the drbyrho function.
get the current size.
Set the x and y quantization functions. Each matrix should have dimensions (2,n) where n is the number of levels. The first row (0,...) is the (n-1) threshold levels and the second row is the n quantizations based on those thresholds. The thresholds may include a DC offset. The (0,(n-1)) element is never used and need not be set.
Set the x and y quantization levels for the case of equi-spaced levels with a possible non-zero offset. The total number of levels is given by n, which must be 3 or 9. If n is not 3 or 9, False will be returned and no quantization will have been set. For the 3- and 9- level cases a bivarate normal integral calculation will be used. That is much faster than the more general numerical integration used by setQuantization.
Get the data used in setting up the interpolation
Given a rho return the corresponding corrected r Returns 0.0 if no quantization has been set yet.
Given a measured zero-lag autocorrelation and number of levels (n>=3) return the first positive quantizer input threshold level. This can be used to set the up the matrix arguments used in setQuantization.
Predict a given zero-lag given n and a threshold. This is included here to be used as a check against the output of thresh.
Compute an approximation to the mean signal level (DC offset) and quantizer threshold setting (both in terms of the r.m.s. signal input level) given the observed positive bias (the asymptotic limit of the measured autocorrelation at large lags) and the zero-lag autocorrelation. dcoffset is the mean signal level, threshold is the quantizer setting, n is the number of levels, zerolag is the zero-lag value and bias is the asymptotic bias. Currently, this is only available for the n==3 level case, all other cases set the returned dcoffset to 0 and use thresh() to set the returned value of threshold. A return value of F indicates that the zerolag and bias values are inconsistent and the dcoffset can not be determined. In that case, the returned dcoffset is 0 and thresh() is used to set the threshold level.
The fortran numerical integration function will call this. For a given rho and quantization functions, this computes, via Price's theorem, the value dr/drho of the derivative, with respect to rho, of the expected value of the correlator output.
For a given rhoi, rhof, this produces a high-accuracy numerical approximation to the integral of drbydrho over the range rhoi to rhof. It calls the standard QUADPACK adaptive Gaussian quadrature procedure, dqags, to do the numerical integration.
initialize the interpolator
compute first threshhold for a given zerolag for n>3
compute first threshhold for a given zerolag for n==3
inverse err fn - used by invErfc
inverse complementary err fn - used by threshN3
Predict a zero-lag value given the indicated first threshold level for n>3.
Predict a zero-lag value given the indicated first threshold level for n=3.
implementation of dcoff for the 3-level case