Forum: GNU Radio two inputs/outputs of different data types

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Dc48f9c00e3e6de9640898a531c26d89?d=identicon&s=25 Charles Swiger (Guest)
on 2006-04-26 17:51
(Received via mailing list)
How do you declare two inputs of different data types?

Several atsc blocks pass a stream of 'float' and also 'syminfo'
(a struct of 4 ints).

>From what I can tell, gr_sync_block allows many inputs and outputs,
but only of the same type(?).

gr_block::gr_block (const std::string &name,
                    gr_io_signature_sptr input_signature,
                    gr_io_signature_sptr output_signature)

where

gr_io_signature (int min_streams, int max_streams, size_t
sizeof_stream_item)



tia
--Chuck
745d8202ef5a58c1058d0e5395a78f9c?d=identicon&s=25 Eric Blossom (Guest)
on 2006-04-26 18:41
(Received via mailing list)
On Wed, Apr 26, 2006 at 11:50:39AM -0400, Chuck Swiger wrote:
>                     gr_io_signature_sptr output_signature)
>
> where
>
> gr_io_signature (int min_streams, int max_streams, size_t
> sizeof_stream_item)
>
> tia
> --Chuck

Hi Chuck,

You're right.  FWIW, the underlying representation is designed to
support different types on each input or output stream, but the top
level constructor, gr_io_signature, doesn't implement an interface to
it.

I'm pretty sure that sizeof(atsc::syminfo) is 4, which is the same as
sizeof(float).  This is true because the total width of the integer
bit fields in atsc::syminfo is <= 32.


Add

  assert(sizeof(float) == sizeof(atsc::syminfo));

somewhere in work, and then cast away.  We lose clarity in the i/o
signature, but I'm pretty sure it'll work.  [ It worked before ;) ]


E.g.,

   int
   foo::work(...)
   {
     const float *in_sample = (const float *) input_items[0];
     const atsc::syminfo *in_tag = (const atsc::syminfo *)
input_items[1];

     assert(sizeof(float) == sizeof(atsc::syminfo));

     ...
   }

Eric
2674f74ca51ec584477bd0179b968bef?d=identicon&s=25 irene159 (Guest)
on 2008-07-03 10:13
(Received via mailing list)
Hi,

I was just asking myself the same question but I'm not sure I understood
your answer.

Is it possible to have two output streams of different data types? I
want
one to be unsignad char and the other one float or double. How is it to
be
coded?

...: gr_sync_block (...,
                          gr_make_io_signature (1, 1, size_of (...))
                          gr_make_io_signature (1, 12, size_of (?????)))

Regards,
Irene






Eric Blossom wrote:
>> gr_block::gr_block (const std::string &name,
>
>
>    int
> Eric
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>

--
View this message in context:
http://www.nabble.com/two-inputs-outputs-of-differ...
Sent from the GnuRadio mailing list archive at Nabble.com.
745d8202ef5a58c1058d0e5395a78f9c?d=identicon&s=25 Eric Blossom (Guest)
on 2008-07-03 15:30
(Received via mailing list)
On Thu, Jul 03, 2008 at 01:11:47AM -0700, irene159 wrote:
> ...: gr_sync_block (...,
>                           gr_make_io_signature (1, 1, size_of (...))
>                           gr_make_io_signature (1, 12, size_of (?????)))
>
> Regards,
> Irene

Hi Irene,

Take a look at gr_io_signature.h.   The general case is
gr_make_io_signaturev.

Eric
This topic is locked and can not be replied to.