0
$\begingroup$

I am implementing a Lock-In-Amplifier in Python with scipy for measurements with light with a decimation afterwards. Right now, this is implemented with an average. This works fine, but I am trying to replace the average with a properly low pass (Butterworth) and decimation afterwards like here described:

https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.decimate.html

I am quite unsure how to choose the cut off frequency of the low pass for the lock-in amplifier. Is there a rule of thumb what's the best frequency for lock-in low pass? In theory, it should be by 0 Hz which is in reality of course not.

$\endgroup$
6
  • 1
    $\begingroup$ Butterworth is probably not the filter type you want here, but if you don't care about delay it's probably OK. $\endgroup$ Commented Apr 29, 2022 at 17:43
  • 1
    $\begingroup$ Well, the choice of bandwidth of the filter depends on the bandwidth of the observed signal, there's no general rule because it really depends. $\endgroup$ Commented Apr 29, 2022 at 17:44
  • 1
    $\begingroup$ An adaptive moving average might be your best bet; or a simple moving average, if the tracked frequency is fixed. A Butterworth is only good because it's flat in the passband, but its attenuation is not that good, and its step response has overshoots. $\endgroup$ Commented Apr 29, 2022 at 17:53
  • $\begingroup$ Thank you for the explanation! But why would be a (moving) average a good choice? I thought its frequency behaviour would make it a bad choice. $\endgroup$
    – bilaljo
    Commented Apr 29, 2022 at 19:53
  • 1
    $\begingroup$ A Butterworth is likely not the best choice. A moving average is your best choice for estimating the mean WHEN the noise is AWGN. For other cases (if you have any spectral content as an interference, this would be the worst choice). To answer your question we would need the following details: What is the bandwidth of your signal of interest (what is the highest frequency you want to observe)? What is your input sampling rate? What is your objective use of the resulting signal (This may help illuminate other requirements of interest). What does the spectrum look like if you didn't filter at all $\endgroup$ Commented Apr 30, 2022 at 3:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.