discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Problem converting RTL 8 bit IQ samples to gnurad


From: Salvatore Sanfilippo
Subject: Re: [Discuss-gnuradio] Problem converting RTL 8 bit IQ samples to gnuradio native format.
Date: Wed, 19 Dec 2012 21:02:43 +0100

On Wed, Dec 19, 2012 at 8:48 PM, Nick Foster <address@hidden> wrote:
> I believe Salvatore's message was hung up in the listserv as I've answered
> him already on Github. ;)
>
> For posterity, modes_rx with the -F option is looking for the usual Gnuradio
> complex sample format -- 32-bit floating point I,Q,I,Q....

Hello Nick,

actually I posted here because after your reply on Github I'm now sure
that the problemi is not about modes_rx -F, but the fact I do the
conversion in the wrong way or something like that, as I believe I'm
outputting 32 bit floating point I,Q,I,Q samples.
So the Github message was to check if the format was what I believed
it was (and it is).
This message was a request for help, to understand what I'm doing wrong.

The code I posted is a trivial transposition of the Gnuradio block I
see everywhere on the internet to convert from RTL raw IQ samples to
Gnuradio format, but maybe writing the C code I did some mistake.

Regards,
Salvatore

> --n
>
>
> On 12/19/2012 11:42 AM, Salvatore Sanfilippo wrote:
>>
>> Hello, I'm using modes_rx in order to decode ADS-B messages.
>> Usually I use it with an RTL-based SDR simply as:
>>
>> modes_rx -d
>>
>> In this way it works perfectly.
>>
>> However I need to record raw IQ samples using rtl_sdr and later
>> process them with modes_rx -F option (that reads data from file, in
>> the gnuradio format).
>>
>> So I tried the following:
>>
>> rtl_sdr -f 1090000000 -s 4000000 /tmp/modes.bin
>>
>> And alter I converted modes.bin into modes.cfile using the following C
>> program:
>>
>> int main(void) {
>>      unsigned char in[2];
>>      float out[2];
>>
>>      while(fread(in,1,2,stdin) == 2) {
>>          out[0] = in[0];
>>          out[1] = in[1];
>>          out[0] = (out[0] - 127)*(1.0/128);
>>          out[1] = (out[1] - 127)*(1.0/128);
>>          fwrite(out,sizeof(float),2,stdout);
>>      }
>>      return 0;
>> }
>>
>> I'm using a little endian computer so in theory I'm converting the 8
>> bit I,Q samples into 4 byte floats I,Q samples in little endian
>> format, that should be the native format of Gnuradio from what I read
>> on the internet.
>>
>> Unfortunately after this conversion modes_rx -F does not work as
>> expected, and instead outputs garbage.
>>
>> I guess I'm doing something wrong in the recording or in the
>> conversion step, but I can't find what the problem is. If you can
>> point me to the right direction I'll appreciate your help.
>>
>> Regards,
>> Salvatore
>>
>> --
>> Salvatore 'antirez' Sanfilippo
>> open source developer - VMware
>> http://invece.org
>>
>> Beauty is more important in computing than anywhere else in technology
>> because software is so complicated. Beauty is the ultimate defence
>> against complexity.
>>         — David Gelernter
>>
>> _______________________________________________
>> Discuss-gnuradio mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>>
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio



--
Salvatore 'antirez' Sanfilippo
open source developer - VMware
http://invece.org

Beauty is more important in computing than anywhere else in technology
because software is so complicated. Beauty is the ultimate defence
against complexity.
       — David Gelernter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]