Jump to content
  • 0

Lock-in Amplifier/ Phase shift


Nurseda

Question

Hi,

in order to realise a lock-in amplifier I need to capture the Output of my amplifier stage, the generated Input sine wave and a 90 degree phase shifted version of it. Is it possible to realise the phase shift of the input signal in the Scope window?

Thanks in advance :)

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

Hi @Nurseda

You could use the Math/Filter/Custom to shift.

In this example:
Channel 1 = output AWG 1
Channel 2 = input DUT 
Math 1= custom filter with one 1 and 49 zeros shifts with 25 samples, 1MHz signal sampled at100MHz will be shifted with 90*
Math 2 = C1 x C2
Math 3 = M1 x C2

image.thumb.png.c78011ed976d7bd75e89a644748d644e.png

Link to comment
Share on other sites

Hi @attila ,

thank you so much. But I didn't understand why this "Math 1= custom filter with one 1 and 49 zeros shifts with 25 samples, 1MHz signal sampled at100MHz will be shifted with 90*" causes a 90 degree shift. Would be pleased if you can explain. Thanks in advance

Link to comment
Share on other sites

Hi @Nurseda

The Math/Filter/Custom is intended for "sliding window", like to apply a gaussian window on 50 samples, from N-25,N-24....N+24
If you enter for 1 for N-25 and 0 for the other 49 up to N+24, the result will be shifted by 25 samples, which is 90* for 100 sample signal period, like 1MHz signal sampled at 100MHz
I think at the moment there is no other way to shift the data...
 

Link to comment
Share on other sites

Hi @attila

now I understand, thank you very much! Currently I have problems with saving the window coefficients. When I reopen my saved workspace I have to set them every time by hand, so I'd like to set them in my script. But I don't know how to do that. Currently I can just set the Filter type= Custom (2). Would pe pleased If you can help me, thanks in advance!

 

Link to comment
Share on other sites

Hi @Nurseda

The filter can be set programmatically using the Scope#.Math#.customFilter property.

This Logging/Script adjusts the filter based on frequency:

image.thumb.png.cc76d5648ed66dc2bb40660d22ba6d0c.png

var hzSig = Scope.Channel1.measure("Frequency")
var hzRate = Scope.Time.Rate.value
var cFilter = round(hzRate/hzSig/2)
if(cFilter>200) cFilter = 0

var rg = [1]
for(var i = 0; i < cFilter; i++) rg.push(0)
Scope.Math1.customFilter = rg

 

In Script tool use Scope1 to identify the scope window.

image.png.e169e0521e7a293ca6fcb59a33233689.png

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...