Hi,
I am trying to continuously transmit known number of IQ samples and then receive them, the transmission works fine I've checked that on a oscilloscope as well as a spectrum analyzer, the reception seems to be working fine when we continuously plot the received data, but when we try to store the buffers into a array and then plot it, we get to see a very interesting behaviour that is the first 4 buffers that we store are stored correctly without any issue, but from the fifth buffer the signals start to overlap may be because of overflow of buffers so I reduced the sampling rate from 60MSPS to 30 MSPS and the bandwidth from 30MHz to 10MHz, but still experiencing the same issue I tried plotting single buffers too but in that too from the 5th buffer the signal being plotted changes.
Is this related to the stock setting that the pluto uses 4 buffers?
And even after generating a wave from -1 to +1 and using a loop back to receive the signals, teh amplitude of the received signals is reduced, I hev not changed teh filter setting or anything, and even tried changing the firmware.
For some reason I was not able to insert the code in the field for it.
Below is the code to store the buffers,
import time
import adi
import numpy as np
import matplotlib.pyplot as plt
file_path = 'pylfm.iq'
bin_data = np.fromfile(file_path, dtype=np.complex64)
bin_data *= 2**14
# Create radio
sdr = adi.Pluto(uri="ip:192.168.2.1")
# Define waveform properties
sample_rate = int(60e6)
bandwidth = int(30e6)
# Configure properties
sdr.sample_rate = sample_rate
sdr.tx_rf_bandwidth = bandwidth
sdr.tx_lo = int(435e6)
sdr._tx_buffer_size = int(len(bin_data))
sdr.gain_control_mode_chan0 = "manual"
sdr.tx_hardwaregain_chan0 = 0.0 # The range is -90 to 0 dB
# Configure RX properties
sdr.gain_control_mode_chan0 = 'manual'
sdr.rx_hardwaregain_chan0 = 0.0 # dB, allowable range is 0 to 74.5 dB
sdr.rx_lo = int(435e6)
sdr.rx_rf_bandwidth = bandwidth # Filter width, set to the same as sample rate for now
sdr.rx_buffer_size = int(len(bin_data))
print('len of a single buffer',int(len(bin_data)))
# Configuration data channels
sdr.tx_enabled_channels = [0]
sdr.rx_enabled_channels = [0]
sdr.tx_cyclic_buffer = True # Enable cyclic buffers
sdr.tx(bin_data)
# Array to store buffers
buffers = np.array([], dtype=np.complex64)
count = 0
# Collect buffers
for i in range(10):
rx_samples = sdr.rx()
buffers = np.concatenate((buffers, rx_samples))
print(len(rx_samples))
count = count + 1
plt.figure()
plt.plot(np.real(rx_samples), label='Real part')
# plt.plot(np.imag(rx_samples), label='Imaginary part')
plt.xlabel('Sample')
plt.ylabel('Amplitude')
plt.title(f'Time Domain Plot - Buffer {i+1}')
plt.legend()
plt.grid(True)
plt.show()
print(buffers)
print(type(buffers))
plt.figure()
plt.plot(buffers)
plt.title("Time Domain Signal")
plt.xlabel("Sample")
plt.ylabel("Amplitude")
plt.show()
Below is the result of storing 10 buffers together
Below is the result for storing 4 buffers together
Removed code for generation of bin file
[edited by: Rajpatil at 9:46 AM (GMT -4) on 5 Aug 2024]