Quadrature detection (source code)

= Quadrature detection

\b[Quadrature detection] measures a signal against two reference oscillations separated by a quarter cycle. The resulting in-phase and quadrature components retain both <amplitude> and relative <phase>; a single component can vanish merely because the signal and reference are out of phase. A two-channel <lock-in amplifier> is a concrete implementation.<About Lock-In Amplifiers by Stanford Research Systems>[pp.1–2: multiplication, low-pass filtering and two reference phases]{ref}

For a signal $s(t)=A\cos(\omega t+\phi)$ with constant $A$ and $\phi$, choose the normalized references $2\cos(\omega t)$ and $-2\sin(\omega t)$. Multiplication followed by a <low-pass filter> that removes terms at $2\omega$ gives
$$
I=A\cos\phi,\qquad Q=A\sin\phi.
$$
Thus $A=\sqrt{I^2+Q^2}$, while the pair $(I,Q)$ specifies <phase> including its quadrant. For $\phi=\pi/2$, the in-phase reading is zero but the quadrature reading is $A$: the signal has not disappeared. The sign of $Q$ depends on the chosen reference convention.

In an actual detector, finite filter <bandwidth> admits nearby <frequencies> and <noise>. Synchronization does not reject an unwanted signal at exactly the same reference <frequency>. If the reference is detuned, the output components rotate at the difference <frequency> rather than remaining constant.<About Lock-In Amplifiers by Stanford Research Systems>[pp.1–2: sum/difference frequencies and narrow-band detection]{ref}