I'm working on a gas emission sensing project in the lab which requires the extraction of a signal in a really noisy environment. The features of interests of my signal are much smaller than the noise components. Literature shows experimental setups for similar purposes using lock-in amplifiers to extract the signal. I have never heard of lock-in amplifiers before and my electronics skills are fairly limited. After a quick search on the Internet, I have realized that lock-in amplifiers might be too bulky for my experimental setup and I was wondering if I could emulate the effect of such amplifiers with a programming script.
Let's say I have a noisy sin signal with know parameters:
- Amplitude: 1 V
- Offset: 3 V
- Frequency: 4 Hz
- For this example, noise is generated in the script
Based on what I have read about lock-in amplifiers, I would first have to multiply it by a reference signal of the same frequency to eliminate the effect of everything at a frequency other than 4 Hz. Let's say I take a sin wave, with an amplitude of 1V and a frequency of 4 Hz. The result is the following signal:
The average of the signal array would be 0.5; this value might change slightly depending on the noise. Now if I give any frequency other than 4 Hz to my reference signal, this average would be around 0 which seems to validate the theory.
Then, based on my understanding, the signal would go through a low-pass filter. I have programmed a butterworth filter of 6th order, with a sample rate of 30 Hz and a cutoff frequency of 3 Hz. Please note that I am not sure on how these numbers should be changed based on what I am trying to accomplish.
Does this make any sense at all in terms of emulating the effect of a lock-in?
Another question I have is with regards to my feature of interests. Let's say the features of interest I am looking to extract, in a perfectly clean signal would look something like this:
Now let's say this signal is completely buried in noise. What would be the best way to extract it and have it as clean as possible? Would a lock-in amplifier do the job?