Lock-In Amplifier: Why multiplication with Cos and Sin?
Trig theory to extract the phase &amp;  magnitude. 

If you only care about phase...

Say you have a signal \$Acos(\omega t + \phi)\$ and you want to extract \$\phi\$. You can use an oscillator of the same frequency to extract this info BUT the issue is the phase. 

\$V_{sig} = Acos(\omega t + \phi)\$ 

\$V_{osc} = cos(\omega t)\$

\$V_{sig}V_{osc} = Acos(\omega t + \phi) Cos(\omega t)\$

By the double angle identity: 

\$ = \frac{1}{2}Acos(\phi) + \frac{1}{2}ACos(2 \omega t + \phi)\$

a DC term relating to the phase can be realised as well as a component at twice teh freqency of the carrier. The phase can then be extracted by a moving average filter at the carrier frequency of a simple low pass filter.

\$V_{sig}V_{osc}Filt = \frac{1}{2}Acos(\phi)\$



If you care about phase and magnitude 

To clearly extract the phase and magnitude then two oscillators, in quadrature, are required. 

\$V_{sig} = Asin(\omega t +\phi)\$

\$V_{osc0} = Xsin(\omega t)\$

\$V_{osc90} = Xcos(\omega t)\$

\$V_0 = Xsin(\omega t)Asin(\omega t +\phi) = \frac{XA}{2}(cos(\phi) - cos(2\omega t + \phi))\$
\$V_{90} = Xcos(\omega t)Asin(\omega t +\phi) = \frac{XA}{2}(sin(\phi) + sin(2\omega t + \phi))\$

Filter these signals to remove the twice carrier component

\$V_{0f} = \frac{XA}{2}(cos(\phi) ) \$

\$V_{90f} = \frac{XA}{2}(sin(\phi) ) \$

via trig:

\$\phi = atan( \frac{V_{90f}}{V_{0f}} )\$
\$A = \frac{2}{X}\sqrt{V_{0f}^2 + V_{90f}^2 }  \$