I am trying to make a signal processing block that uses an array of
complex numbers at its input. I was just wondering whether
&input_items can support this.
I was told that the &input_items are simply “plain old data.” So if I
cannot pass an array of complex numbers as an input argument, is there
a way to process my input so that I can still get a stream of complex
numbers as input?
Thanks!
If my message isn’t clear, here’s a snippet of code to clarify things.
// In the “main” function
complex ARRAY[10]; // 10 items of complex type
work(noutput_items, ARRAY, output_items); // would this be ILLEGAL?
// Inside the signal processing block
work(int noutput_items, gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
Then you will understand what “input_items” is… it’s not what you were
told Whatever “plain old data” might actually be.
The quick answer is that it’s a stream of arrays, where there can be a
single stream which is what you want (a single array). But read the
guide to completely understand it.
Aside from that, you don’t typically call the work() function yourself.
You connect the blocks and as data is streamed through your flow
graph, the work() function is called on that stream. Read the guide and
you will understand this.
Custom GNU Radio input and output streams can be any form of data the
user wishes, as long as it has a fixed length in memory (itemsize) and
meets the requirements described in the article.
GNU Radio itself only enforces that two signal processing blocks
expect the same itemsize, but otherwise doesn’t care.