The convention in the UHD and GnuRadio universe is that floats are scaled into
{-1.0,+1.0}.
If you setup your streamer to use complex float CPU format and sc16 wire format
you just need to scale your complex floats appropriately.
Sent from my iPhone
> On Jul 2, 2022, at 10:22 AM, Nikos Balkanas <[email protected]> wrote:
>
> Hi,
>
> I don't know volk_32fc_convert_16 ic. Dunno if it converts between big
> and little indians:(
> When converting a float to int, you always have to ceil or floor the float.
> Ceil sounds as good as any. You can easily change that to floor if you
> run into problems.
> Since clibs le32to* take ints as arguments, I would first convert
> float32 to int32 from gnuradio save to file, and then worry about
> the indians when importing to uhd...
>
> HTH
> Nikos
>
>> On Fri, Jul 1, 2022 at 8:42 AM sp h <[email protected]> wrote:
>>
>> I recorded a complex signal file, I did it with HackRFONE, For sending on
>> USRP I want to use the int16 option as input, My question is how can convert
>> a complex float 32 signal to complex int 16 for USRP?
>> what's the relation between complex float 32 and complex int 32 in USRP?
>> I know that in USRP numbers are in format complex int 16 and big-endian and
>> in Gnuradio numbers in format complex float 32 and little-endian...
>> https://files.ettus.com/manual/page_converters.html
>> I used volk lib but the float that I entered as input, is ceiled to bigger
>> integers. Is this a method valid for converting signals...?Or my data will
>> be corrupt!!!
>> Thanks in advance.
>>
>>
>>> lv_16sc_t* outputVector;
>>>
>>> lv_32fc_t* inputVector;
>>>
>>> inputVector->real(25.55);
>>>
>>> inputVector->imag(45);
>>>
>>> volk_32fc_convert_16ic(outputVector,inputVector,32);
>>>
>>> qDebug()<<outputVector->real()<<"-----";
>>
>>
>> The output:
>>>
>>> 26 -----
>>
>> _______________________________________________
>> USRP-users mailing list -- [email protected]
>> To unsubscribe send an email to [email protected]
> _______________________________________________
> USRP-users mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
_______________________________________________
USRP-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]