def set_wave_sequence(awg_sa_cmd): """ 波形シーケンスを AWG にセットする """ # 波形の定義 samples = create_wave() wave_0 = awgsa.AwgAnyWave(samples=samples, num_cycles=4) (i_samples, q_samples) = create_iq_wave() i_wave = awgsa.AwgAnyWave(samples=i_samples, num_cycles=360) q_wave = awgsa.AwgAnyWave(samples=q_samples, num_cycles=360) wave_1 = awgsa.AwgIQWave(i_wave, q_wave) # 波形シーケンスの定義 # 波形ステップの開始から終了までの期間は, キャプチャの終了処理にかかるオーバーヘッドを考慮し, 波形出力期間 + 2000 ns を設定する. wave_sequence_0 = (awgsa.WaveSequence(DAC_FREQ, is_iq_data=False).add_step( step_id=0, wave=wave_0, post_blank=2000)) wave_sequence_1 = (awgsa.WaveSequence(DAC_FREQ, is_iq_data=True).add_step( step_id=0, wave=wave_1, post_blank=2000)) # AWG に波形シーケンスをセットする awg_sa_cmd.set_wave_sequence(awgsa.AwgId.AWG_0, wave_sequence_0, num_repeats=1) awg_sa_cmd.set_wave_sequence(awgsa.AwgId.AWG_1, wave_sequence_1, num_repeats=1) return (wave_sequence_0, wave_sequence_1)
def set_wave_sequence(awg_sa_cmd): """ 波形シーケンスを AWG にセットする """ # 波形の定義 wave_0 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SAWTOOTH, frequency=7.2, phase=0, amplitude=30000, num_cycles=NUM_CYCLES) wave_1 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SAWTOOTH, frequency=11.0, phase=0, amplitude=30000, num_cycles=NUM_CYCLES) # 波形シーケンスの定義 wave_sequence_0 = (awgsa.WaveSequence(DAC_FREQ).add_step(step_id=0, wave=wave_0, post_blank=0)) wave_sequence_1 = (awgsa.WaveSequence(DAC_FREQ).add_step(step_id=0, wave=wave_1, post_blank=0)) # AWG に波形シーケンスをセットする awg_sa_cmd.set_wave_sequence(awg_id=awg_list[0], wave_sequence=wave_sequence_0, num_repeats=1) awg_sa_cmd.set_wave_sequence(awg_id=awg_list[1], wave_sequence=wave_sequence_1, num_repeats=1) return {awg_list[0]: wave_sequence_0, awg_list[1]: wave_sequence_1}
def set_wave_sequence(awg_sa_cmd): """ 波形シーケンスを AWG にセットする """ # 波形の定義 wave_0 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SINE, frequency=10.0, phase=0, amplitude=30000, num_cycles=4) wave_1 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SAWTOOTH, frequency=10.0, phase=0, amplitude=30000, num_cycles=3, crest_pos=1.0) wave_2 = awgsa.AwgWave(wave_type=awgsa.AwgWave.GAUSSIAN, frequency=10.0, phase=0, amplitude=30000, num_cycles=4, variance=0.2, domain_begin=-1.5, domain_end=1.5) wave_3 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SQUARE, frequency=10.0, phase=0, amplitude=30000, num_cycles=4, duty_cycle=50.0) # 波形シーケンスの定義 # 波形ステップの開始から終了までの期間は, キャプチャの終了処理にかかるオーバーヘッドを考慮し, 波形出力期間 + 2000 ns を設定する. wave_sequence_0 = (awgsa.WaveSequence(DAC_FREQ).add_step( step_id=0, wave=wave_0, post_blank=2000).add_step(step_id=1, wave=wave_1, post_blank=2000)) wave_sequence_1 = (awgsa.WaveSequence(DAC_FREQ).add_step( step_id=0, wave=wave_2, post_blank=0).add_step(step_id=1, wave=wave_3, post_blank=2000)) # AWG に波形シーケンスをセットする awg_sa_cmd.set_wave_sequence(awg_id=awgsa.AwgId.AWG_0, wave_sequence=wave_sequence_0, num_repeats=1) awg_sa_cmd.set_wave_sequence(awgsa.AwgId.AWG_1, wave_sequence_1, num_repeats=1) return (wave_sequence_0, wave_sequence_1)
def set_wave_sequence(awg_sa_cmd): """ 波形シーケンスを AWG にセットする """ # 波形の定義 i_wave_0 = awgsa.AwgWave( wave_type = awgsa.AwgWave.SINE, frequency = 120.0, phase = 0, amplitude = 15000, num_cycles = 2500) q_wave_0 = awgsa.AwgWave( wave_type = awgsa.AwgWave.SQUARE, frequency = 120.0, phase = 0, amplitude = 15000, duty_cycle = 100.0, num_cycles = 2500) iq_wave_0 = awgsa.AwgIQWave(i_wave_0, q_wave_0) i_wave_1 = awgsa.AwgWave( wave_type = awgsa.AwgWave.SINE, frequency = 50.0, phase = 90.0, # cos amplitude = 15000, duty_cycle = 100.0, num_cycles = 2500) q_wave_1 = awgsa.AwgWave( wave_type = awgsa.AwgWave.SINE, frequency = 50.0, phase = 0, amplitude = 15000, num_cycles = 2500) iq_wave_1 = awgsa.AwgIQWave(i_wave_1, q_wave_1) # 波形シーケンスの作成 wave_sequence_0 = (awgsa.WaveSequence(DAC_FREQ, is_iq_data = True) .add_step(step_id = 0, wave = iq_wave_0, post_blank = 2000)) wave_sequence_1 = (awgsa.WaveSequence(DAC_FREQ, is_iq_data = True) .add_step(step_id = 0, wave = iq_wave_1, post_blank = 2000)) # AWG に波形シーケンスをセットする awg_sa_cmd.set_wave_sequence(awgsa.AwgId.AWG_0, wave_sequence_0) awg_sa_cmd.set_wave_sequence(awgsa.AwgId.AWG_1, wave_sequence_1) return (wave_sequence_0, wave_sequence_1)
def set_wave_sequence(awg_sa_cmd): """ 波形シーケンスを AWG にセットする """ awg_to_wave_sequence = {} for awg_id in awg_list: # 波形の定義 freq = awg_to_freq[awg_id] num_cycles_0 = awg_to_num_cycles[awg_id][0] num_cycles_1 = awg_to_num_cycles[awg_id][1] wave_0 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SINE, frequency=freq, num_cycles=num_cycles_0) wave_1 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SINE, frequency=freq, num_cycles=num_cycles_1) # 波形シーケンスの定義 # post_blank は, キャプチャの終了処理にかかるオーバーヘッドを考慮して設定する. wave_sequence = (awgsa.WaveSequence(DAC_FREQ).add_step( step_id=0, wave=wave_0, post_blank=POST_BLANK).add_step(step_id=1, wave=wave_1, post_blank=POST_BLANK)) # AWG に波形シーケンスをセットする awg_sa_cmd.set_wave_sequence(awg_id=awg_id, wave_sequence=wave_sequence, num_repeats=10) awg_to_wave_sequence[awg_id] = wave_sequence return awg_to_wave_sequence
def set_wave_sequence(awg_sa_cmd, cycle_multiplier): """ 波形シーケンスを AWG にセットする """ # 波形の定義 wave_0 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SINE, frequency=10.0, phase=0, amplitude=30000, num_cycles=4 * cycle_multiplier) wave_1 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SAWTOOTH, frequency=10.0, phase=0, amplitude=30000, num_cycles=3 * cycle_multiplier, crest_pos=1.0) # 波形シーケンスの定義 # 波形ステップの開始から終了までの期間は, キャプチャの終了処理にかかるオーバーヘッドを考慮し, 波形出力期間 + 2000 ns を設定する. wave_sequence_0 = (awgsa.WaveSequence(DAC_FREQ).add_step( step_id=0, wave=wave_0, post_blank=2000).add_step(step_id=1, wave=wave_1, post_blank=2000)) # AWG に波形シーケンスをセットする awg_sa_cmd.set_wave_sequence(awgsa.AwgId.AWG_0, wave_sequence_0, num_repeats=1000) return wave_sequence_0
def set_wave_sequence(awg_sa_cmd): """ 波形シーケンスを AWG にセットする """ awg_id_to_wave_sequence = {} for awg_id in awg_list: # 波形の定義 wave_0 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SINE, frequency=awg_to_freq[awg_id], phase=0, amplitude=30000, num_cycles=awg_to_cycles[awg_id]) wave_1 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SAWTOOTH, frequency=awg_to_freq[awg_id], phase=0, amplitude=30000, num_cycles=awg_to_cycles[awg_id], crest_pos=1.0) # 波形シーケンスの定義 # 波形ステップの開始から終了までの期間は, キャプチャの終了処理にかかるオーバーヘッドを考慮し, 波形出力期間 + 2000 ns を設定する. wave_sequence = (awgsa.WaveSequence(DAC_FREQ).add_step( step_id=0, wave=wave_0, post_blank=2000).add_step(step_id=1, wave=wave_1, post_blank=2000)) # AWG に波形シーケンスをセットする awg_sa_cmd.set_wave_sequence(awg_id=awg_id, wave_sequence=wave_sequence, num_repeats=1000) awg_id_to_wave_sequence[awg_id] = wave_sequence return awg_id_to_wave_sequence
def set_wave_sequence(awg_sa_cmd): """ 波形シーケンスを AWG にセットする """ awg_id_to_wave_sequence = {} for awg_id, freq in awg_to_freq.items(): wave_sequence = awgsa.WaveSequence(DAC_FREQ) for step_id, cycles in enumerate(awg_to_cycles[awg_id]): # 波形の定義 if (awg_to_trigger_mode[awg_id] == awgsa.TriggerMode.MANUAL): wave = awgsa.AwgWave( wave_type=awgsa.AwgWave.SQUARE, # トリガ波形は矩形波 frequency=freq, phase=0.0, amplitude=30000, duty_cycle=100.0, num_cycles=cycles) else: wave = awgsa.AwgWave(wave_type=awgsa.AwgWave.SINE, frequency=freq, phase=0, amplitude=30000, num_cycles=cycles) # 波形シーケンスの定義 wave_sequence.add_step(step_id, wave, post_blank=185) # AWG に波形シーケンスをセットする awg_sa_cmd.set_wave_sequence(awg_id, wave_sequence, num_repeats=1) awg_id_to_wave_sequence[awg_id] = wave_sequence return awg_id_to_wave_sequence
def set_wave_sequence(awg_sa_cmd): """ 波形シーケンスを AWG にセットする """ awg_id_to_wave_sequence = {} for awg_id in awg_list: # 波形の定義 num_cycles = int(6.0 * awg_to_freq[awg_id]) # 6.0[us] i_wave = awgsa.AwgWave( wave_type = awgsa.AwgWave.SINE, frequency = awg_to_freq[awg_id], phase = 90, # cos amplitude = 15000, num_cycles = num_cycles) q_wave = awgsa.AwgWave( wave_type = awgsa.AwgWave.SINE, frequency = awg_to_freq[awg_id], phase = 0, amplitude = 15000, num_cycles = num_cycles) iq_wave = awgsa.AwgIQWave(i_wave, q_wave) # 波形シーケンスの定義 # 波形ステップの開始から終了までの期間は, キャプチャの終了処理にかかるオーバーヘッドを考慮し, 波形出力期間 + 2000 ns を設定する. wave_sequence = (awgsa.WaveSequence(DAC_FREQ, is_iq_data = True) .add_step(step_id = 0, wave = iq_wave, post_blank = 2000)) # AWG に波形シーケンスをセットする awg_sa_cmd.set_wave_sequence(awg_id = awg_id, wave_sequence = wave_sequence, num_repeats = 1) awg_id_to_wave_sequence[awg_id] = wave_sequence return awg_id_to_wave_sequence
def set_wave_sequence(awg_sa_cmd): """ 波形シーケンスを AWG にセットする """ awg_id_to_wave_sequence = {} wave_type_list = (awgsa.AwgWave.SINE, awgsa.AwgWave.SQUARE, awgsa.AwgWave.SAWTOOTH) amp_list = (30000, -30000, 30000) for awg_id in awg_list: wave_sequence = awgsa.WaveSequence(DAC_FREQ) for step_id in range(3): # 波形の定義 wave = awgsa.AwgWave(wave_type=wave_type_list[step_id], frequency=awg_to_freq[awg_id][step_id], phase=0, amplitude=amp_list[step_id], num_cycles=awg_to_cycles[awg_id][step_id], crest_pos=0.5) # 波形シーケンスの定義 wave_sequence.add_step(step_id, wave, post_blank=0) # AWG に波形シーケンスをセットする awg_sa_cmd.set_wave_sequence(awg_id=awg_id, wave_sequence=wave_sequence, num_repeats=1) awg_id_to_wave_sequence[awg_id] = wave_sequence return awg_id_to_wave_sequence
def set_wave_sequence(awg_sa_cmd): """ 波形シーケンスを AWG にセットする """ awg_id_to_wave_sequence = {} for awg_id in awg_list: # 波形の定義 wave_0 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SINE, frequency=awg_to_freq[awg_id][0], phase=0, amplitude=30000, num_cycles=int(2.5 * awg_to_freq[awg_id][0])) #2.5us wave_1 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SINE, frequency=awg_to_freq[awg_id][1], phase=0, amplitude=30000, num_cycles=int(2.5 * awg_to_freq[awg_id][1])) #2.5us # 波形シーケンスの定義 wave_sequence = (awgsa.WaveSequence(DAC_FREQ).add_step( step_id=0, wave=wave_0, post_blank=0).add_step(step_id=1, wave=wave_1, post_blank=0)) # AWG に波形シーケンスをセットする awg_sa_cmd.set_wave_sequence(awg_id=awg_id, wave_sequence=wave_sequence, num_repeats=1000) awg_id_to_wave_sequence[awg_id] = wave_sequence return awg_id_to_wave_sequence
def set_wave_sequence(awg_sa_cmd): """ 波形シーケンスを AWG にセットする """ # 波形の定義 wave_0 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SINE, frequency=10, phase=0, amplitude=30000, num_cycles=INFINITE) wave_1 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SQUARE, frequency=10, phase=0, amplitude=30000, num_cycles=3) wave_2 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SAWTOOTH, frequency=10, phase=0, amplitude=30000, num_cycles=4) # 波形シーケンスの定義 wave_sequence_0 = (awgsa.WaveSequence(DAC_FREQ).add_step(step_id=0, wave=wave_0, post_blank=0)) wave_sequence_1 = (awgsa.WaveSequence(DAC_FREQ).add_step( step_id=0, wave=wave_1, post_blank=0).add_step(step_id=1, wave=wave_2, post_blank=POST_BLANK)) # AWG に波形シーケンスをセットする awg_sa_cmd.set_wave_sequence(awg_id=awg_list[0], wave_sequence=wave_sequence_0, num_repeats=1) awg_sa_cmd.set_wave_sequence(awg_id=awg_list[1], wave_sequence=wave_sequence_1, num_repeats=INFINITE) return {awg_list[0]: wave_sequence_0, awg_list[1]: wave_sequence_1}
def calibrate_adc(awg_sa_cmd): """ ADC をキャリブレーションする """ calib_wave = awgsa.AwgWave( wave_type = awgsa.AwgWave.SINE, frequency = 10.0, phase = 0, amplitude = 30000, num_cycles = 100000) calib_wave_sequence = (awgsa.WaveSequence(DAC_FREQ) .add_step(step_id = 0, wave = calib_wave, post_blank = 0)) awg_sa_cmd.set_wave_sequence(awgsa.AwgId.AWG_0, calib_wave_sequence, num_repeats = 1) awg_sa_cmd.start_wave_sequence() wait_for_sequence_to_finish(awg_sa_cmd)
def calibrate_adc(awg_sa_cmd): """ ADC をキャリブレーションする """ # AWG に波形シーケンスをセットする for awg_id in awg_list: calib_wave = awgsa.AwgWave( wave_type = awgsa.AwgWave.SINE, frequency = awg_to_freq[awg_id], phase = 0, amplitude = 30000, num_cycles = int(awg_to_freq[awg_id] * 1e4)) #10ms calib_wave_sequence = (awgsa.WaveSequence(DAC_FREQ) .add_step(step_id = 0, wave = calib_wave, post_blank = 0)) awg_sa_cmd.set_wave_sequence(awg_id, calib_wave_sequence, num_repeats = 1) awg_sa_cmd.start_wave_sequence() wait_for_sequence_to_finish(awg_sa_cmd, awg_list)
def set_wave_sequence(awg_sa_cmd): """ 波形シーケンスを AWG にセットする """ # 波形の定義 wave_0 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SINE, frequency=80.0, phase=0, amplitude=-30000, num_cycles=2200) # 波形シーケンスの作成 wave_sequence_0 = (awgsa.WaveSequence(DAC_FREQ).add_step(step_id=0, wave=wave_0, post_blank=2000)) # AWG に波形シーケンスをセットする awg_sa_cmd.set_wave_sequence(awgsa.AwgId.AWG_0, wave_sequence_0) return wave_sequence_0
def calibrate_adc(awg_sa_cmd): """ ADC をキャリブレーションする """ # AWG に波形シーケンスをセットする for awg_id in awg_list: calib_wave = awgsa.AwgWave(wave_type=awgsa.AwgWave.SINE, frequency=10, phase=0, amplitude=30000, num_cycles=int(1e5)) #10ms calib_wave_sequence = (awgsa.WaveSequence(DAC_FREQ).add_step( step_id=0, wave=calib_wave, post_blank=0)) awg_sa_cmd.set_wave_sequence(awg_id, calib_wave_sequence, num_repeats=1) awg_sa_cmd.start_wave_sequence() all_sequences_are_complete(awg_sa_cmd, *awg_list)
def set_wave_sequence(awg_sa_cmd): """ 波形シーケンスを AWG にセットする """ awg_id_to_wave_sequence = {} for awg_id, freq in awg_to_freq.items(): wave_sequence = awgsa.WaveSequence(DAC_FREQ) for step_id, cycles in enumerate(awg_to_cycles[awg_id]): # 波形の定義 wave = awgsa.AwgWave(wave_type=awgsa.AwgWave.SINE, frequency=freq, phase=0, amplitude=30000, num_cycles=cycles) # 波形シーケンスの定義 wave_sequence.add_step(step_id, wave, post_blank=200) # AWG に波形シーケンスをセットする awg_sa_cmd.set_wave_sequence(awg_id, wave_sequence, num_repeats=1) awg_id_to_wave_sequence[awg_id] = wave_sequence return awg_id_to_wave_sequence
def set_wave_sequence(awg_sa_cmd): """ 波形シーケンスを AWG にセットする """ wave_0 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SINE, frequency=10.0, phase=0, amplitude=20000, num_cycles=3) wave_1 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SAWTOOTH, frequency=15.0, phase=0.0, amplitude=10000, offset=0, crest_pos=0.5, num_cycles=3) wave_2 = awgsa.AwgWave(wave_type=awgsa.AwgWave.SQUARE, frequency=10.0, phase=0.0, amplitude=10000, offset=0, duty_cycle=50.0, num_cycles=3) wave_3 = awgsa.AwgWave(wave_type=awgsa.AwgWave.GAUSSIAN, frequency=10.0, phase=0.0, amplitude=8000, offset=0, domain_begin=-4.0, domain_end=4.0, variance=0.2, num_cycles=2) wave_4 = awgsa.AwgIQWave(wave_0, wave_1) wave_5 = awgsa.AwgIQWave(wave_1, wave_2) wave_6 = awgsa.AwgIQWave(wave_2, wave_0) wave_sequence_0 = (awgsa.WaveSequence(DAC_FREQ).add_step( step_id=0, wave=wave_0, post_blank=2000).add_step( step_id=1, wave=wave_1, post_blank=1500).add_step(step_id=2, wave=wave_2, post_blank=0).add_step(step_id=3, wave=wave_3, post_blank=3000)) wave_sequence_1 = (awgsa.WaveSequence(DAC_FREQ, is_iq_data=True).add_step( step_id=0, wave=wave_4, post_blank=1000).add_step(step_id=1, wave=wave_5, post_blank=2000).add_step(step_id=2, wave=wave_6, post_blank=1500)) awg_sa_cmd.set_wave_sequence(awgsa.AwgId.AWG_0, wave_sequence_0, num_repeats=1) awg_sa_cmd.set_wave_sequence(awgsa.AwgId.AWG_1, wave_sequence_1, num_repeats=1) return (wave_sequence_0, wave_sequence_1)