US English (US)
JP Japanese
CN Chinese
KR Korean

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Knowledge Base Home
  • Contact Us
Chinese
US English (US)
JP Japanese
CN Chinese
KR Korean
  • Home
  • Python API

如何改变Moku锁相放大器中解调信号的相位

了解如何调整Moku锁相放大器中解调信号的相位,以优化信号处理并实现更精确的测量。

Written by Paul Cracknell

Updated at April 7th, 2025

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Moku:Lab
    Moku:Lab逻辑分析仪/码型发生器 Moku:Lab时间间隔与频率分析仪 Moku:Lab频谱分析仪 Moku:Lab PID 控制器 Moku:Lab示波器 Moku:Lab激光锁频/稳频器 Moku:Lab相位表 Moku:Lab数字滤波器 Moku:Lab任意波形发生器 Moku:Lab波形发生器 Moku:Lab频率响应分析仪 Moku:Lab FIR 滤波器生成器 Moku:Lab锁相放大器 Moku:Lab常见问题解答 Moku:Lab数据记录器
  • Moku:Go
    Moku:Go锁相放大器 Moku:Go逻辑分析仪和码型发生器 Moku:Go示波器和电压表 Moku:Go频谱分析仪 Moku:Go波形发生器 Moku:Go时间间隔与频率分析仪 Moku:Go数字滤波器 Moku:Go FIR 滤波器生成器 Moku:Go激光锁频/稳频器 Moku:Go任意波形发生器 Moku:Go频率响应分析仪 Moku:Go数据记录器 Moku:Go常见问题解答 Moku:Go相位表 Moku:Go电源 Moku:Go PID 控制器
  • Moku:Pro
    Moku:Pro波形发生器 Moku:Pro时间间隔与频率分析仪 Moku:Pro逻辑分析仪/码型发生器 Moku:Pro激光锁频/稳频器 Moku:Pro锁相放大器 Moku:Pro频谱分析仪 Moku:Pro数据记录器 Moku:Pro任意波形发生器 Moku:Pro多仪器并行模式 Moku:Pro相位表 Moku:Pro FIR 滤波器生成器 Moku:Pro PID 控制器 Moku:Pro示波器 Moku:Pro频率响应分析仪 Moku:Pro常见问题解答 Moku:Pro数字滤波器
  • Python API
  • MATLAB API
  • 任意波形发生器
  • 数据记录器
  • 数字滤波器
  • FIR滤波器生成器
  • 频率响应分析仪
  • 激光锁频/稳频器
  • 锁相放大器
  • 示波器
  • 相位表
  • PID 控制器
  • 频谱分析仪
  • 时间间隔与频率分析仪
  • 波形发生器
  • 逻辑分析仪/码型发生器
  • 多仪器并行模式
  • Moku云编译
  • Moku常见问题解答
  • LabVIEW API
+ More

Moku锁相放大器使用双相解调来确定信号的 X 和 Y 分量。通过调整解调信号属性,可以在 Python 中移动解调信号的相位。

此示例演示了如何调整解调信号相位。

#
# Moku example: Phase change in Moku Lock-In Amplifier
#
# This example demonstrates how you can shift the phase of the demodulation signal
# in the Lock-In Amplifier instrument
#
# (c) 2024 Liquid Pty. Ltd.
#
# This is configured for Moku:Lab and is compatible with Moku:Go and Moku:Pro
#
# Setup : loopback Moku output 2 to input 1 with a BNC cable.
#
# The phase of the demodulation signal is then swept
# a full 360 degrees and the resulting LIA output DC signal 
# reflects the phase offset between the PLL and input 1.
#
from moku.instruments import LockInAmp
import statistics
import matplotlib.pyplot as plt

# Launch Lock In Amplifier and connect to your device via IP
i = LockInAmp('192.168.2.74', force_connect=True)
try:
   # Configure analog input port 1 as 50 Ohm and 0 dB attenuation
   i.set_frontend(1, coupling='DC', impedance='50Ohm', attenuation='0dB')   
   # Output a 1MHz sine wave and demodulate at same
   i.set_demodulation(mode='Internal', frequency=1e6)
   i.set_filter(corner_frequency=1e1, slope="Slope6dB")
   # Output the 'X' (I) signal and the local-oscillator sine wave on the two
   # DAC channels. 
   i.set_aux_output(frequency=1e6, amplitude=1)
   i.set_outputs(main='X', aux='Aux', main_offset=0, aux_offset=0)
   
   i.use_pid("Off")
   i.set_gain(main=0, aux=0)
   # Monitor the I and Q signals from the mixer, before filtering
   i.set_monitor(1, 'Input1')
   i.set_monitor(2, 'MainOutput')
   # Trigger on Monitor 'B' ('I' signal), rising edge, 0V with 0.1V hysteresis
   i.set_trigger(source='ProbeB', edge='Rising', hysteresis=0.1)
   # View +- 0.1 second, ie trigger in the centre
   i.set_timebase(-2e-6, 2e-6)
   
   # Set up the plotting parameters
   plt.figure(num="Moku Lock-in Amplifier")
   plt.ylabel("Voltage (V)")
   plt.xlabel("Time [s]")

   line1, = plt.plot([], label='Input 1')
   line2, = plt.plot([], label='LIA X out')

   # Configure labels for axes
   ax = plt.gca()
   plt.pause(1)
   # This loops through a phase range of 0 to 350 degrees with a step size of 10
   for a in range(0, 351, 10):
       # Set a demodulation phase
       i.set_demodulation(mode='Internal', phase=a)
       data = i.get_data(wait_complete=True, wait_reacquire=True)
       dc2 = data['ch2']
       # Print out the demodulation phase and mean value of the output
       print(f'New Phase: {a}')
       print(f'Mean: {statistics.mean(dc2)}')
       # Update the Plotting
       line1.set_ydata(data['ch1'])
       line1.set_xdata(data['time'])
       
       line2.set_ydata(data['ch2'])
       line2.set_xdata(data['time'])
       
       plt.pause(0.1)
       plt.legend(loc='upper left')
       # Ensure frequency axis is a tight fit
       ax.relim()
       ax.autoscale_view()
finally:
   # Close the connection to the Moku device
   # This ensures network resources and released correctly
   i.relinquish_ownership()

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Python 频谱分析仪‘最大保持’功能
  • 使用 Python 生成任意波形并观察输出信号
  • 采用深存储模式进行数据采集
  • 修复“没有名为 pkg_resources 的模块”错误
  • 检查 Python 安装和Moku包

Sitemap

  • Moku:Lab
  • Instruments
  • Software
  • Company
  • Support
  • Store
  • Terms & Conditions
  • Privacy Policy

Offices

United States
+1 (619) 332-6230
12526 High Bluff Dr
Suite 150
San Diego, CA 92130

Australia
+61 2 6171 9730
243 Northbourne Avenue
Suite 2
Lyneham, ACT 2602

Australia
+61 03 7073 3594
700 Swanston Street
Suite 5E, Level 5
Carlton, VIC 3053

Follow us

Youtube LinkedIn

官方微信

Contact us
© 2025 Liquid Instruments. All rights reserved.

Knowledge Base Software powered by Helpjuice

Definition by Author

0
0
Expand