Correlated threshold and amplitude errors in RC timing (source code)

= Correlated threshold and amplitude errors in RC timing
{title2=$u_t^2\approx J\Sigma J^{\mathsf T}$}

<Correlated threshold and amplitude errors in RC timing> must be propagated together. An input level and a comparator threshold can share a reference, so treating their <measurement uncertainties> as independent can overestimate or underestimate the uncertainty of the <RC threshold-crossing time>. The correct cancellation depends on which levels share an error, including the initial baseline.

First hold the <time constant> $\tau$ fixed and take a known zero initial output. Write $H>0$ for the step's high level and $0<\theta<H$ for the threshold. The <RC threshold-crossing time> and its two sensitivity coefficients are
$$
t=\tau\log\frac{H}{H-\theta},\qquad
c_\theta=\frac{\tau}{H-\theta},\qquad
c_H=-\frac{\tau\theta}{H(H-\theta)}=-a c_\theta,\quad a=\theta/H.
$$
The first-order <law of propagation of uncertainty> retains the <covariance> term. If the two input <standard uncertainties> are $u_\theta,u_H$, and their <correlation coefficient> is $\rho$, then
$$
\boxed{u_t^2\approx\left(\frac{\tau}{H-\theta}\right)^2
\left(u_\theta^2+a^2u_H^2-2a\rho u_\theta u_H\right).}
$$
The negative cross term follows from the opposite signs of the two sensitivities: raising the threshold delays a crossing, whereas raising the input makes it earlier. Setting <covariance> to zero is an assumption about the measurement process.<Guidelines for Evaluating and Expressing the Uncertainty of NIST Measurement Results by Barry N. Taylor and Chris E. Kuyatt>[Appendix A.3, equation A-3, first-order propagation including estimated covariances]{ref}

For an original example, let $H=1\,\mathrm V$, $\theta=0.50\,\mathrm V$, $\tau=1\,\mathrm{\mu s}$, $u_H=20\,\mathrm{mV}$ and $u_\theta=10\,\mathrm{mV}$. The nominal crossing is $0.69315\,\mathrm{\mu s}$, and
$$
u_t\approx28.284\sqrt{1-\rho}\,\mathrm{ns}.
$$
If the two errors are <independent random variables>, the result is $28.28\,\mathrm{ns}$; $\rho=0.9$ gives $8.94\,\mathrm{ns}$; perfect anticorrelation gives $40.00\,\mathrm{ns}$. These are <standard uncertainties> from a local approximation, not automatically coverage intervals.

There is an exact cancellation under a more specific model. With zero baseline, if $H=GH_0$ and $\theta=G\theta_0$ with the same positive gain $G$, the ratio $a$ is fixed and
$$
\boxed{t=\tau\log\frac{GH_0}{G(H_0-\theta_0)}
=\tau\log\frac{H_0}{H_0-\theta_0}.}
$$
This <ratiometric cancellation of RC timing gain errors> is a <ratiometric measurement> principle. With $u_\theta=a u_H$, the zero at $\rho=1$ reflects exact common scaling, rather than a claim that every source of timing uncertainty has vanished. Uncertainty in $\tau$, for example, still gives $u_t/t\approx u_\tau/\tau$.

A <common offset in RC timing> needs the baseline to be specified. If the initial output remains fixed at zero while only $H$ and $\theta$ receive the same offset $B$, then
$$
t(B)=\tau\log\frac{H_0+B}{H_0-\theta_0},\qquad
\left.\frac{dt}{dB}\right|_{B=0}=\frac{\tau}{H_0}.
$$
In the numerical example, a small shared offset with <standard uncertainty> $10\,\mathrm{mV}$ gives about $10\,\mathrm{ns}$ of timing uncertainty. Perfect positive <correlation> between these two levels alone does not ensure cancellation.

If the baseline shares the offset too, it must be included. The nonzero-baseline model from <residual baseline in RC pulse-width discrimination> is
$$
t(H,\theta,V_b)=\tau\log\frac{H-V_b}{H-\theta}.
$$
Adding $B$ to \i[all three] levels leaves both differences, and hence the time, unchanged. This is a change of common zero reference. Holding the baseline fixed while shifting only the two other levels is a different experiment. The extra sensitivity is $c_b=-\tau/(H-V_b)$; at $V_b=0$, the three voltage sensitivities sum to zero, as required by the exact common-offset invariance.

\Image[/rc-timing-error-correlation.png]
{title=<Covariance> changes RC timing uncertainty, while gain and offset cancellation depend on the full measurement model}
{description=Original calculation for a 1 V high level, 0.5 V threshold and 1 µs time constant. Exact four-state bounded-error checks are compared with first-order propagation. The right panel distinguishes common gain, a two-level offset with fixed baseline, and a common offset of all three levels. Its common perturbation $\epsilon$ sets gain $G=1+\epsilon$ or offset $B=\epsilon H_0$. No measured uncertainty data are used.}

An exact numerical check can use <bounded errors with prescribed correlation>. Take two <independent random variables> $Z,W$ with the <Rademacher distribution> and set
$$
\delta H=u_HZ,\qquad
\delta\theta=u_\theta\left(\rho Z+\sqrt{1-\rho^2}W\right).
$$
The four equally likely states have the specified <variances> and <covariance>. At the chosen error scales, all states retain $0<\theta<H$, so the exact logarithmic crossing exists in every state. Evaluating those four times checks the local approximation without silently assigning a crossing to an invalid input pair. Near a threshold or pulse-duration boundary, missing crossings and nonlinear effects require separate treatment.

For a full <measurement uncertainty> calculation, include the baseline and <time constant> when their uncertainties matter. With input vector $(\theta,H,V_b,\tau)$, <Jacobian matrix> $J$ and <covariance matrix> $\Sigma$, the first-order result is $u_t^2\approx J\Sigma J^{\mathsf T}$. The measurement model must represent significant corrections and uncertainty sources, rather than only a physical law.<Guidelines for Evaluating and Expressing the Uncertainty of NIST Measurement Results by Barry N. Taylor and Chris E. Kuyatt>[Appendix A.1 and A.3]{ref} A bench check can vary a common amplitude reference and then an independent threshold offset while recording actual levels and crossings on an <oscilloscope>; the baseline should be recorded in both tests.