from ldk.drivers import Oscillo host = os.getenv('HOST','192.168.1.100') client = connect(host, name='oscillo') driver = Oscillo(client) current = 30 #mA freq = 1 mod_amp = 0.2 # Modulate with a triangle waveform of period 8192 x 8 ns n = driver.wfm_size driver.dac[1,:] = mod_amp * signal.sawtooth(2 * np.pi * freq / n * np.arange(n), width=0.5) driver.set_dac() driver.start_laser() driver.set_averaging(True) driver.set_laser_current(current) time.sleep(0.1) plt.ylim([-2*np.pi, 2*np.pi]) plt.ion() plt.show() phase_previous_pos = 0 phase_previous_neg = 0 temperature = 20 # degrees Celsius data = np.zeros((1000,2)) + temperature # Hanning FFT Window window = 0.5 * (1-np.cos(2 * np.pi * np.arange(4095) / 4095))
import initExample import os import time import numpy as np import matplotlib.pyplot as plt from utilities import load_instrument from ldk.drivers import Oscillo host = os.getenv('HOST','192.168.1.100') client = load_instrument(host, instrument='oscillo') driver = Oscillo(client) # Enable laser driver.start_laser() # Set laser current current = 30 # mA driver.set_laser_current(current) # Modulation on DAC amp_mod = 0.2 freq_mod = 1e6 driver.dac[1, :] = amp_mod*np.sin(2 * np.pi * freq_mod * driver.sampling.t) driver.set_dac() # Signal on ADC driver.get_adc() signal = driver.adc[0, :]