I'm having a lot of trouble to plot the spectrum of the samples produced by the bladeRF-cli.
I'm using matlab 2015b. I used the info provided on a topic for OCTAVE, but it doesn't seem to work fine.
However, blade_rx_gui example displays the spectrum of the given bandwidth as expected.
My settings to get the samples are the following:
Code: Select all
bladeRF> set frequency rx 810M
bladeRF> set samplerate rx 40M
bladeRF> set bandwidth rx 20M
bladeRF> set lnagain 6
bladeRF> set rxvga1 10
bladeRF> set rxvga2 0
bladeRF> rx config file=test.csv format=csv n=5000
bladeRF> rx start
bladeRF> rx
I'm experiencing some high spikes on the IQ data plot and on FFT I'm getting a 0 magnitude for about 2500 samples in a row out of 5000 samples in total.
I didn't proceed to plot a proper graph of the spectrum,because I don't know if the data I'm receiving are good.
Code: Select all
function iq_spectrum_test(filename)
csv = load(filename);
signal_i = csv(:, 1);
signal_q = csv(:, 2);
signal = signal_i + signal_q*1i;
Fs=40000000;
L = 5000;
Y = fft(signal);
close all;
figure;
plot(1:L,abs(signal))
title('IQ Data Test')
xlabel('Samples')
ylabel('')
figure;
plot(1:L,abs(Y))
title('FFT Data Test')
xlabel('Samples')
ylabel('')
end
Can anyone help me out?
Thanks for your time