discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] I & Q channels in source module


From: mleech
Subject: Re: [Discuss-gnuradio] I & Q channels in source module
Date: Thu, 23 Apr 2015 15:30:09 -0400
User-agent: Roundcube Webmail/1.0.2

In general, radios that use complex-baseband format interleave I/Q in the way you're apparently using here.  That's very conventional.

It's very usual for the interface to "present" complex-float to Gnu Radio as the default format, since the vast majority of DSP blocks operate on complex-float or float.  Not a show-stopper, since blocks exist to convert from signed-short formats into complex-float, but it's a nice convenience for users.

 

 

 

 

 

On 2015-04-23 15:09, Yile Ku wrote:

I am writing a source module/block and I generate 16 bit signed I and Q values.  There is first a 16 bit I value then a 16 bit Q value repeated 1024 times. 

In my source module I have:

    usbradio_impl::usbradio_impl()
      : gr::sync_block("usbradio",
              gr::io_signature::make(1, 1, sizeof(short)),
              gr::io_signature::make(1, 1, sizeof(short)))
    {
               state = 0;
               cnt = 0;
               set_max_noutput_items(1);
               set_max_output_buffer(2);
    }

    /*
     * Our virtual destructor.
     */
    usbradio_impl::~usbradio_impl()
    {
    }

    int
    usbradio_impl::work(int noutput_items,
                          gr_vector_const_void_star &input_items,
                          gr_vector_void_star &output_items)
    {
        short  *out = (short *) output_items[0];

        // Do <+signal processing+>
        stuff_output(out);

        // Tell runtime system how many output items we produced.
        return 1024;
    }

The stuff_output(out) function will stuff an I value then a Q value 512 times.  

Is that the correct way to present I & Q values?

Thx,
Y-

_______________________________________________
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]