I want to know how 32-bit floating point number is converted to 16bits or from 16bits to 32bits.
Where can I find the file that performs this conversion?
We are actually working on the Receiving side.
Before we move I/Q samples from rx_buffer to USB, we want to do FFT and deliver the FFT results instead of the raw I/Q samples to the host.
For my FPGA FFT module, I use 32bits floating point numbers as input.
So I want to know how the I/Q samples are represented by 16bits so that I can convert them to 32bits.
In 32bits representation, bits 0 through 22 form the mantissa, bits 23 through 30 form the exponent, and bit 31 is the sign bit.
In 16bits, do we simply cut 16bits of the mantissa?
Then bits 0 through 6 form the mantissa, bits7 through 14 form the exponent,and bit 15 is the sign bit. Is that right?
It's better if we can have a look at the conversion file.
Thanks,
Yooxi
2011/8/15 Tom Rondeau
<address@hidden>
On Mon, Aug 15, 2011 at 12:48 AM, xi yang <
address@hidden> wrote:
> Hi, all
>
> I want to use fpga to do FFT before the data are transmitted to usb.
>
> In FFT module, I used float point numbers to be its input. According to the
> IEEE Floating-Point Standard, a float point number is represented by 32 bits
> (bits 0 through 22 form the mantissa, bits 23 through 30 form the exponent,
> and bit 31 is the sign bit). However, in GNU Radio, the UHD drive sends
> 16bits I, and 16bits Q.
>
> Are I and Q float point numbers? How do the 16bits represent a float number?
> Any suggestion about the I/Q's format is appreciated!
>
> Thanks,
> Yooxi
The interface to the USRP is defined to take floating point numbers.
It will perform the conversion to the 16-bit shorts that are sent over
the wire for you. Also remember that the output of the FFT is a
vector, so you'll want to use the gr_vector_to_stream block to convert
it back to a stream of floating point samples.
Tom