discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] two inputs/outputs of different data types


From: irene159
Subject: Re: [Discuss-gnuradio] two inputs/outputs of different data types
Date: Thu, 3 Jul 2008 01:11:47 -0700 (PDT)

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:
> 
> On Wed, Apr 26, 2006 at 11:50:39AM -0400, Chuck Swiger wrote:
>> 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
> 
> 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
> 
> 
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 
> 

-- 
View this message in context: 
http://www.nabble.com/two-inputs-outputs-of-different-data-types-tp4104088p18253966.html
Sent from the GnuRadio mailing list archive at Nabble.com.





reply via email to

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