I am trying to measure the relative phase of a sine wave fixed at a particular frequency in a noisy environment. My initial approach is to simply collect $N$ samples, take an FFT, and then just extract the phase at the operating frequency (which I know apriori).
When reading about methods to extract signals from noisy environments, I came across the lock-in amplifier. However, I am confused about whether I should have any reason to expect it to perform better than the FFT (ignoring run time, just looking at ability to extract my phase).
Specifically, imagine that I implement the lock-in amplifier digitally. I would then numerically calculate the following two integrals (source):
\begin{align} X_{LI} &= \frac{1}{T}\int\limits^{T}_{0} U_{\rm in}(s) \cos(2\pi f s) \,ds\\ Y_{LI} &= \frac{1}{T}\int\limits^{T}_{0} U_{\rm in}(s) \sin(2\pi f s) \,ds \end{align}
and then I would get my phase using:
$$ \theta_{LI} = \tan^{-1}\left(\frac{Y_{LI}}{X_{LI}}\right) $$
However, if I were to use an FFT, the FFT would evaluate
\begin{align} X_{FFT}(f) + iY_{FFT}(f) &= \int\limits_0^T U_{\rm in}(s)e^{-2\pi i s f}\,ds\\ &=\int\limits_0^T U_{\rm in}(s)\cos(2\pi f s)\,ds + i \int\limits_0^T U_{\rm in}(s)\sin(2\pi f s)\,ds \end{align}
Which seems to imply that just as with the lock-in amplifier, I would get
\begin{align} X_{FFT} &= \int^{T}_{0} U_{\rm in}(s) \cos(2\pi f s)\,ds = \frac{1}{T}X_{LI}\\ Y_{FFT} &= \int^{T}_{0} U_{\rm in}(s) \sin(2\pi f s)\,ds = \frac{1}{T}Y_{LI}\\ \theta_{FFT} &= \tan^{-1}\left(\frac{Y_{FFT}}{X_{FFT}}\right) = \tan^{-1}\left(\frac{Y_{LI}}{X_{LI}}\right) = \theta_{LI} \end{align}
- So does this mean that I would always get the same result whether I use a digital lock-in amplifier, or a digital FFT on the same data set?
- What is the benefit of using a lock-in amplifier?
- Is there no advantage to the lock-in amp in my application?
- What is then an example of an application that the lock-in amplifier is best suited for?