[Top][All Lists]

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

Re: [Discuss-gnuradio] gr_io_signature question

From: Michael Dickens
Subject: Re: [Discuss-gnuradio] gr_io_signature question
Date: Wed, 3 May 2006 09:09:45 -0400

What size (in Bytes) is a single Item on the input stream? Float == 4 Bytes? So long as the Item size can be expressed in terms of Bytes, then using the io_signature is pretty straight forward.

You might also need to change the "forecast()" method depending on how many input Items (per stream) are created for each output Item (or vice versa). The default is 1:1.

However the aloumoti needs these 2 streams in combination to create the output streams, how (in c) do I specify that there are 2 inputs and then proceed to access those inputs in the C system?  I’m already aware it will in some way involve the min_in, min_out, etc. variables and their use in generating an IO signature.

The number of input streams is set by either (1) the number provided by the previous connect() block, or (2) the number specified by "set_input_signature()" if using an exact setting.

* To specify exactly 2 input streams, you'd use:

set_input_signature (gr_make_io_signature (2, 2, <size_of_input_stream_item>));

* If you know that the number of input streams is either 1, 2, or 3, then you could use:

set_input_signature (gr_make_io_signature (1, 3, <size_of_input_stream_item>));

and then in "work()" you'd have to make sure to process "input_items.size()" number of input streams.

* If you don't know the number of input streams, and there might not be any, you can specify an unknown number of streams from (0 to any):

set_input_signature (gr_make_io_signature (0, -1, <size_of_input_stream_item>));

[but I've never tried it].

Specifically do I use something akin to:

const float *in0= (const float *) input_items[0];

const float *in1= (const float *) input_items[1];

Yes, that looks correct; if you use the exact "set_input_signature()" above, you're guaranteed to have 2 input streams and then what you wrote would always work.

And you'd do the same thing for "output_items[]" to access those streams.

Hope this answers your questions. - MLD

reply via email to

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