def test_adrv9009_zu11eg_buffer_size(iio_uri, rx_buffer_size, rx_enabled_channels): dev = adi.adrv9009_zu11eg(iio_uri) dev.rx_buffer_size = rx_buffer_size dev.rx_enabled_channels = rx_enabled_channels data = dev.rx() if len(rx_enabled_channels) == 1: assert len(data) == rx_buffer_size else: for chan in data: assert len(chan) == rx_buffer_size
import matplotlib.pyplot as plt import numpy as np from scipy import signal def measure_phase(chan0, chan1): errorV = np.angle(chan0 * np.conj(chan1)) * 180 / np.pi error = np.mean(errorV) return error # Plot config plot_time_domain = False # Create radio sdr = adi.adrv9009_zu11eg(uri="ip:192.168.86.57") sdr._rxadc.set_kernel_buffers_count(1) # Configure properties sdr.rx_enabled_channels = [0, 1, 2, 3] sdr.tx_enabled_channels = [0, 1] sdr.trx_lo = 2000000000 sdr.trx_lo_chip_b = 2000000000 sdr.tx_hardwaregain_chan0 = -10 sdr.tx_hardwaregain_chan1 = -10 sdr.tx_hardwaregain_chan0_chip_b = -10 sdr.tx_hardwaregain_chan1_chip_b = -10 sdr.gain_control_mode_chan0 = "slow_attack" sdr.gain_control_mode_chan1 = "slow_attack" sdr.gain_control_mode_chan0_chip_b = "slow_attack" sdr.gain_control_mode_chan1_chip_b = "slow_attack"
import time import adi import matplotlib.pyplot as plt import numpy as np from scipy import signal def measure_phase(chan0, chan1): errorV = np.angle(chan0 * np.conj(chan1)) * 180 / np.pi error = np.mean(errorV) return error # Create radio sdr = adi.adrv9009_zu11eg() # Configure properties sdr.rx_enabled_channels = [0, 1, 2, 3] sdr.tx_enabled_channels = [0, 1] sdr.trx_lo = 2000000000 sdr.trx_lo_chip_b = 2000000000 sdr.tx_hardwaregain_chan0 = -10 sdr.tx_hardwaregain_chan1 = -10 sdr.tx_hardwaregain_chan0_chip_b = -10 sdr.tx_hardwaregain_chan1_chip_b = -10 sdr.gain_control_mode_chan0 = "slow_attack" sdr.gain_control_mode_chan1 = "slow_attack" sdr.gain_control_mode_chan0_chip_b = "slow_attack" sdr.gain_control_mode_chan1_chip_b = "slow_attack" sdr.rx_buffer_size = 2**17