Category: Software
Product Number: CN0540 + DE10Nano
Software Version: EVAL-CN0540-ARDZ
Hi all,
I'm trying to capture a long sample from the CN0540 but when I get above 1s the system freezes.
The same behaviour occurs when using the onboard oscilloscope.
Is there anyway of increasing the timeout value so I can get a longer sample?
The code bellow works fine with a "rx_buffer_size = 2**17" but fails with "rx_buffer_size = 2**18"
import adi import numpy import time import matplotlib.pyplot as plt plt.ioff() uri = "ip:10.10.0.128" xl = adi.cn0532(uri) xl.sample_rate = 128000 #256000 print(xl.sample_rate) for x in range(10): xl = adi.cn0532(uri) # Set number of samples to capture xl.rx_buffer_size = 2**18 # 2**17 # Pull rx_buffer_size samples back from the device data = xl.rx() numpy.savetxt(".\Data\data.csv", data, delimiter=",") datafft = numpy.fft.fft(data) numpy.savetxt(".\Data\datafft.csv", datafft, delimiter=",") n = data.size timestep = 0.1 datafftfreq = numpy.fft.fftfreq(n, d=timestep) numpy.savetxt(".\Data\datafftfreq.csv", datafftfreq, delimiter=",") datahfft = numpy.fft.hfft(data) numpy.savetxt(".\Data\datahfft.csv", datahfft, delimiter=",") print(x) plt.plot(data) plt.show() time.sleep(1) print("End")
Thanks