discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Confusion over data formatting for a waveform in


From: Ian Buckley
Subject: Re: [Discuss-gnuradio] Confusion over data formatting for a waveform in QT GUI Time Sink, File Sink, and RFNoC noc_block_moving_avg
Date: Thu, 19 May 2016 00:18:59 -0700

Craig,
If what you are trying to do is build a verilog test bench and use this data as stimulus then stay within GR, multiply your float data by 2^16 and then convert it to short integer before passing to file sink(s).
That will give you two's complement signed integer signal data.

Assemble your packet level tdata[63:0] from file data as follows (where I1/Q1 follows I0/Q0 in time):

[63:56] I0 MSB
[55:48] I0 LSB
[47:40] Q0 MSB
[39:32] Q0 LSB
[31:24] I1 MSB
[23:16] I1 LSB
[15:8] Q1 MSB
[7:0] Q1 LSB

If this block is expecting packetized data, rather than a simple sample stream then assume you already understand the packet header format you need to add also?

My tip for the day, especially since right now you are just building a loop back to bring up your test bench is generate simple waveforms entirely within your test bench. A saw tooth or triangle wave is incredibly easy to generate by incrementing a signed integer type, and visually easy to check in a waveform viewer.

In terms of number format, try to think of the integer data as Q1.15, not Q16. In otherwords 0x8000 represents -1.0 and 0x7fff represents 0.99999....when you actually analyze your DSP architecture it makes it easier to keep track of word growth knowing that 1.15+1.15 = 2.15 and 1.15*1.15 = 2.30
-Ian

On Wed, May 18, 2016 at 1:52 PM, Martin Braun <address@hidden> wrote:
On 05/18/2016 12:56 PM, Swanson, Craig wrote:
> gnuradio-companion.  Here are my steps and questions:

Craig,

short answer: What Ian said, and also:

>  8. Once I can agree that my 32 bit real and imaginary numbers are
>     making sense in QT GUI Time Sink and File Sink, then I have to
>     convert that 32 bit hex value into Q16 format which RFNoC
>     noc_block_moving_avg is expecting to be sent to i_tdata (64 bits=two
>     sets of real and imag) and then m_axis_data_tdata(32 bits=one set of
>     real and imag, sent twice=64 bits)?
>  9. How do I convert the 32 bit IEEE 754 data (gnuradio) into Q16 (RFNoC)?

You do *not* have to convert anything. UHD does that for you. You feed
it fc32 data (std::complex<float>) and tell the streamer to convert it
to sc16. Which is the default.

M


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


reply via email to

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