Python: Phasemeter (streaming)
-
Moku:Go
Moku:Go Arbitrary Waveform Generator Moku:Go Data Logger Moku:Go Frequency Response Analyzer Moku:Go Logic Analyzer & Pattern Generator Moku:Go Oscilloscope & Voltmeter Moku:Go PID Controller Moku:Go Spectrum Analyzer Moku:Go Waveform Generator Moku:Go Power Supplies Moku:Go Digital Filter Box Moku:Go FIR Filter Builder Moku:Go Lock-in Amplifier Moku:Go General Moku:Go Logic Analyzer/Pattern Generator Moku:Go Time & Frequency Analyzer Moku:Go Laser Lock Box Moku:Go Phasemeter
-
Moku:Lab
Moku:Lab General Moku:Lab Arbitrary Waveform Generator Moku:Lab Data Logger Moku:Lab Digital Filter Box Moku:Lab FIR Filter Builder Moku:Lab Frequency Response Analyzer Moku:Lab Laser Lock Box Moku:Lab Lock-in Amplifier Moku:Lab Oscilloscope Moku:Lab Phasemeter Moku:Lab PID Controller Moku:Lab Spectrum Analyzer Moku:Lab Waveform Generator Moku:Lab Time & Frequency Analyzer Moku:Lab Logic Analyzer/Pattern Generator
-
Moku:Pro
Moku:Pro Arbitrary Waveform Generator Moku:Pro Data Logger Moku:Pro Frequency Response Analyzer Moku:Pro Oscilloscope Moku:Pro PID Controller Moku:Pro Spectrum Analyzer Moku:Pro Waveform Generator Moku:Pro Lock-in Amplifier Moku:Pro Digital Filter Box Moku:Pro FIR Filter Builder Moku:Pro Phasemeter Moku:Pro Multi-instrument Mode Moku:Pro General Moku:Pro Logic Analyzer/Pattern Generator Moku:Pro Time & Frequency Analyzer
- Python API
- MATLAB API
- Arbitrary Waveform Generator
- Data Logger
- Digital Filter Box
- FIR Filter Builder
- Frequency Response Analyzer
- Laser Lock Box
- Lock-in Amplifier
- Oscilloscope
- Phasemeter
- PID Controller
- Spectrum Analyzer
- Time & Frequency Analyzer
- Waveform Generator
- Logic Analyzer & Pattern Generator
- Multi Instrument Mode
- Moku Cloud Compile
- Moku general
- LabVIEW
Example Python script to implement the Phasemeter (streaming).
# Moku example: Phasemeter networking streaming # # This example starts a 10-second network stream of Channel 1 Phasemeter data # and processes it live. The contents of each data sample are printed out, # along with the signal amplitude which may be calculated as A = sqrt(I^2 + Q^2). # # (c) 2023 Liquid Instruments Pty. Ltd. # from moku.instruments import Phasemeter import numpy as np import matplotlib.pyplot as plt # Launch Phasemeter and connect to your device via IP i = Phasemeter('192.168.###.###', force_connect=False) try: # Set samplerate to 150 Hz/s i.set_acquisition_speed(speed='150Hz') # Set channel 1 to DC coupled, 1 MOhm impedance, and 4Vpp range i.set_frontend(1, coupling='DC', impedance='1MOhm', range='4Vpp') # Get auto acquired frequency for channel 1 i.get_auto_acquired_frequency(channel=1) # Stop and existing streaming session and start a new one for 10s i.stop_streaming() i.start_streaming(duration=10) # This loop continuously updates the plot with new data while True: # Get stream data data = i.get_stream_data() # Process the received data # Here we just print the contents of Channel 1 data # Along with signal amplitude (I^2 + Q^2) print(f"Ch1 - fs: {np.array2string(np.array(data['ch1_set_frequency']))}\nf: {np.array2string(np.array(data['ch1_frequency']))}\nphase: {np.array2string(np.array(data['ch1_phase']))}\namplitude: {np.array2string(np.sqrt(np.array(data['ch1_i'])**2+np.array(data['ch1_q'])**2))}\n") except Exception as e: print(f'Exception Occured: {e}') finally: # Close the connection to the Moku device # This ensures network resources are released correctly i.stop_streaming() i.relinquish_ownership()