discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Converting complex-short to complex-float with UH


From: Josh Blum
Subject: Re: [Discuss-gnuradio] Converting complex-short to complex-float with UHD
Date: Mon, 12 Sep 2011 10:18:42 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13


On 09/12/2011 10:00 AM, Almohanad Fayez wrote:
> 
> I can't seem to find a direct way of typcasting COMPLEX_INT16 using
> gr-uhd as complex_float.  It seems that gnuradio assumes that a
> complex type is composed of floats by default which causes issues
> when I'm using gr-uhd, is there a direct way to do complex_short to
> complex_float conversion or should I just make a custom block for
> that?  thanks.
> 

The output signature for COMPLEX_INT16 is a vector of shorts length 2.
You can covert this to complex float with a vector_to_stream block, and
then a ishort_to_complex block.

BTW, if you want complex floats, it makes way more sense to just use
COMPLEX_FLOAT32. The real use of COMPLEX_INT16 is if you have a block
that produces or consumes complex shorts. Otherwise its just extra overhead.

-josh




reply via email to

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