discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Vector inputs/outputs with GRExtras block interfa


From: Josh Blum
Subject: Re: [Discuss-gnuradio] Vector inputs/outputs with GRExtras block interface
Date: Tue, 13 Nov 2012 14:41:37 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2


On 11/13/2012 02:35 PM, Roy Thompson wrote:
> Is it possible to use a vector input or output with a block that uses
> the GRExtras interface?  All of the examples for specifying the I/O
> signature for a Python block only show using a numpy type to specify
> the data width.
> 

Actually the neat thing with the python blocks is the items can be any
thing you can represent with numpy dtypes. So vectors, vectors of
vectors with arbitrary sizes, structures. And when work gets called, you
get the inputs and outputs as arrays of these types.

> I also tried creating a C++ block and setting the sizeof_stream_item
> parameter of the gr_make_io_signature() to the total vector size as
> has been done in standard blocks that support vectors, but it doesn't
> appear to be working properly either.  For example, I tried setting
> the size to 4096 bytes (vector of 1024 floats), but each time my work
> function gets called, input_items.size() is only returning 8, where I
> would have expected it to only be called when there was a full vector
> of data available?
> 

input_items is an array of arrays, where each element represents an
input port. If input_items.size() == 8, then you must have a block w/ 8
inputs?

-josh



reply via email to

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