discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] data types and other questions


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] data types and other questions
Date: Tue, 31 Oct 2006 20:09:47 -0800
User-agent: Mutt/1.5.9i

On Tue, Oct 31, 2006 at 04:47:54PM -0500, address@hidden wrote:
> 
> 
> Hello all,
> 
> I've been using GNU Radio and the USRP for about a year now, and until now I
> took for granted some of the things that are going on under the hood, if you
> know what I mean.  For example, recently, I noticed that the gr_complex data
> type is simply the complex float data type in C++ (I was looking in
> gr_complex.h), which means that the data is 64bit data (32bit I and 32bit Q).
> I'm sure this is all written down somewhere, but I'm trying to make sure that
> what I've seen in correct...

Yes, you've got it correct ;)

Also, I was perusing (I think that's a word)
> through the gr-usrp/ folder and I also noticed that in usrp1_source_c.cc that
> the output seems to be of "short" data type:
> 
>  for (int i = 0; i < nitems; i++){
>     dst[2*i + 0] = host_to_usrp_short((short) real(in[i]));   // FIXME 
> saturate?
>     dst[2*i + 1] = host_to_usrp_short((short) imag(in[i]));   // FIXME 
> saturate?
>   }
> 
> does this mean that the 64-bit gr_complex float is converted to integers 
> (16bit
> I and 16bit Q) when it
> gets to the USRP?  This seems odd to me (but that could just be me not
> understanding), so I was wondering if maybe someone could help me understand.

Yes this is correct.  On the host we prefer to work with complex
numbers, and complex<float> is a lot easier to deal with than complex<short>.
However, as Matt noted, the data passed across the USB is 16-bit I & Q.

> Thanks in advance,
> David

Eric




reply via email to

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