I'm really sick of buggy publications.
So be very careful if you are going to use some example codes or information resources from the internet publications.This is a good source for digital Lock-in Amplifier:
On Wikipedia, it is simply wrong for Y-component. The negative sign for Y is missing there, which is very important for correct phase calculations.
see https://en.wikipedia.org/wiki/Lock-in_amplifier

Same applies to Goertzel algorithms.

On wikipedia, the scaling by 1/N (normalisation) is missing. Most implementations don't decode in complex form (I/Q with real/imag components). So they aren't interested in phase information. We are interested on both (magnitude and phase).
If you take care of all the details, there is no difference in making either FFT, Lock-in Amplifier or Goertzel decoding.
All three methods deliver same complex results within the numerical accuracy.
- FFT does require more DSP horse power and pre-calculated sine/cosine tables (slow and requires more memory).
- Lock-in amp does require pre-calculated reference sine/cosine tables for each frequency of interest if you take the internal reference base (fast, requires more memory and therefore not optimal for embedded projects).
If you have an external reference signal, you have to generate a 90 ° phase shifted signal of the external reference signal.
- Goertzel does only require one pair of sine/cosine value for each frequency of interest (low memory required, very fast and ideal for embedded projects).
My new USB Sound Blaster G3 will arrive today!
Cheers,
Aziz
?

Leave a comment: