Complex relative gain error (source code)

= Complex relative gain error
{title2=$|H/H_{\mathrm{ref}}-1|$}

For a nonzero reference <transfer function> $H_{\rm ref}$, the complex relative gain error is the <relative error>
$$
E=\left|\frac{H-H_{\rm ref}}{H_{\rm ref}}\right|=\left|\frac H{H_{\rm ref}}-1\right|.
$$
It measures the distance from the complex ratio to one, so it responds to both <amplitude> error and <phase> error. A vector <vector network analyzer> measures both quantities; replacing its complex result by a magnitude discards part of the measured information.<Vector Network Analyzer Basics by Anritsu>[S-Parameters discussion: magnitude and phase displays]{ref}

Write $H/H_{\rm ref}=ae^{i\phi}$, where $a\geq0$ and $\phi$ is the <phase> difference. Multiplying by the <complex conjugate> gives
$$
E^2=a^2+1-2a\cos\phi=(a-1)^2+4a\sin^2(\phi/2).
$$
Thus a pure five-degree <phase> error has $E=2\sin(2.5\pi/180)\approx0.08724$, about $8.72\%$, even though the magnitude ratio is exactly one. For small $\delta=a-1$ and small $\phi$ measured in <radians>, $E\approx\sqrt{\delta^2+\phi^2}$. Adding the two unsigned errors is generally not the same operation.

The metric also controls signals. Suppose two <linear time-invariant systems> have <frequency responses> $H,H_{\rm ref}$ and act on the same input in <L2 space>. On its frequency support assume $H_{\rm ref}\ne0$ almost everywhere and $|H/H_{\rm ref}-1|\leq\varepsilon$ almost everywhere. Applying the <norm bound for a Fourier multiplier on L2> to the reference output yields
$$
\|y-y_{\rm ref}\|_2\leq\varepsilon\|y_{\rm ref}\|_2.
$$
This is an output-relative bound, so input frequencies suppressed by a zero of $H_{\rm ref}$ require separate treatment. Near a reference zero, a small <absolute error> can produce an enormous complex <relative error>; an absolute or explicitly fixed-scale tolerance is then more informative.