I know that data in USRP on FPGA is in format big-endian sint16, but in Gnuradio data is in format complex float 32... I found these links The conversion encompasses several elements. The most obvious is that of the data type: Most FPGAs use integer data types, the most common being complex 16-bit integers (16 bit for I and Q, respectively). If the user wants his data in float, the converter casts the data type and also scales the data, typically such that the full dynamic range of the 16-Bit integers is mapped onto the float range of -1 to 1. The converter also handles the endianness: On the network, data is usually stored as big-endian, whereas most platforms store data internally as little-endian.
https://files.ettus.com/manual/classuhd_1_1convert_1_1converter.html#a371906249b8bd546b98bd0a867e70c88 https://files.ettus.com/manual/page_converters.html According to them, I want to use the Convert class to convert complex float 32 to sint16.... But my program is can not run successfully, Anyone can guide me on How should I use the Converter class...!!! Thanks in advance #include <uhd/convert.hpp> > > > int main() > > { > > int16_t *in_p; > > float *out_p; > > *in_p=1234; > > uhd::convert::converter::input_type in(in_p); > > uhd::convert::converter::output_type out(out_p); > > uhd::convert::converter::sptr convert; > > convert->conv(in,out,1); > > std::cout<<*out_p; > > } > >
_______________________________________________ USRP-users mailing list -- usrp-users@lists.ettus.com To unsubscribe send an email to usrp-users-le...@lists.ettus.com