Help on matlab and IQ samples FFT processing

Discussions related to modulation techniques, filtering, error correction and detection, wireless link layer implementations, etc

Moderator: robert.ghilduta

Post Reply
Posts: 3
Joined: Mon Jan 08, 2018 4:32 am

Help on matlab and IQ samples FFT processing

Post by Geo89 » Thu Mar 08, 2018 3:12 am


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
Here's my code:
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;

L = 5000;       
Y = fft(signal);

close all;

title('IQ Data Test')

title('FFT Data Test')

I know that I'm doing something wrong, but I don't know where to start.

Can anyone help me out?

Thanks for your time

Post Reply