[Hackrf-dev] Parse recorded samples to Matlab

Carl Olsson carlolsson.co at gmail.com
Thu May 7 10:03:52 EDT 2015


Hi all,

I want to record data using "hackrf_transfer" but I'm having problems,
maybe someone here can supply some insight.

First I recorded samples with center freq 98MHz. If I didn't use any
amplification it looked like the received energy was to small so the
samples were only between -2 and 2. If I use these command:

"hackrf_transfer -r nameOfFile_1 -f 98000000 -s 5000000 -n 5000000 -l 16 -g
2"

I get graph 1 attached to this email. Everything looks fine I think.

However if I use the same command but now with center freq 149MHz:

"hackrf_transfer -r CF149M_SR5M_t1 -f 1490000000 -s 5000000 -n 5000000 -l
16 -g 2"

Then I get graph 2 attached.

I don't know why the recorded samples look like this. I would really
appreciate any help.

Matlab code for parsing:

%PARSE

f=fopen('nameOfFile_1');

iq=fread(f,'int8');

fclose(f)

i=iq(1:2:end);

q=iq(2:2:end);

c = i + 1j.*q;

And the left graph is the real part of a subset of all the samples.

Best Regards,
Carl

On 28 April 2015 at 00:08, William Hill <mail at wbh.org> wrote:

>
> On 27 Apr 2015, at 22:54, Carl Olsson <carlolsson.co at gmail.com> wrote:
>
> > Hi all,
> >
> > This is my first post to the mailing list so I hope I do everything
> correctly.
> > I have recorded data using
> > hackrf_transfer -r "nameOfFile" -f 149000000 -s 5000000 -n 50000000
> > And I now want to read the data into Matlab but I can't figure out how.
> I have read that the format is 8 bit signed I part followed by 8 bit signed
> Q part and so on. I looked at the octave function in gr-utils and tried to
> change the parsing from float so schar which should be 8 bit signed but it
> didn't work.
> >
> > Could someone please give me a hint on how to proceed?
>
> Hi, this is how I read a file I’d recorded:
>
> >> f=fopen(‘data.iq’);
> >> iq=fread(f,'int8’);
> >> fclose(f)
> >> i=iq(1:2:end);
> >> q=iq(2:2:end);
>
> Bill
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist9.pair.net/pipermail/hackrf-dev/attachments/20150507/4ca7523f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 98MHz.jpg
Type: image/jpeg
Size: 30732 bytes
Desc: not available
URL: <https://pairlist9.pair.net/pipermail/hackrf-dev/attachments/20150507/4ca7523f/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 149MHz.jpg
Type: image/jpeg
Size: 30976 bytes
Desc: not available
URL: <https://pairlist9.pair.net/pipermail/hackrf-dev/attachments/20150507/4ca7523f/attachment-0001.jpg>


More information about the HackRF-dev mailing list