Thursday, May 11, 2017

[Discuss-gnuradio] OOT: Output does not update fast. Buffer size?

Hi to all,

I created my own OOT block. It has 6 inputs and 2 outputs and all are type of float. I am using Signal Source block and sending constant signals with different amplitudes at each input port.

When I run, the the GRC file and change the one of the inputs, outputs changes after some time(~5 seconds). To examine the problem, I am printing the following variables on the screen: 

noutput_items, input1[1], input1[noutput_items], output1[1], output1[noutput_items] 

...
8192, 44, 44, 1, 1   >>> Input1 is 44 and outputs are 1
8192, 44, 44, 1, 1   >>> Input 1 is still 44

8192, 44, 26, 1, 1   >>> I changed the input1 to 26. Note that input[1] is still 44. input[noutput_items] is 26 but output[noutput_items] is also 1!

8192, 26, 26, 1, 1   >>> The content of input1 is all 26, but the output is still 1!
8192, 26, 26, 1, 1   >>> The output is still 1!
8192, 26, 26, 2, 2   >>> Now the correct output is found!
.... 

First of all, why the dimension of input and output is 8192(sometimes 8191)? 

samp_rate defined for Signal Source block is smaller than 8192. I am using 1, 100 or 1000. But as you can see noutput_items is 8192. How there can be 8192 inputs if the sample rate is for example 10?

My module content is like the following:

------------------------------------
int myfunction_impl::general_work(...)
{
const float *input1 = ..
..

for (int i=; i<noutput_items; i++)
{
my_function(input1[i],...,&output1[i],&output2[i])
}

consume_each(noutput_items);
return noutput_items;
}
--------------------------------------

In short, I want that one input comes per second(sampling rate 1) and one output is out and displayed. 

Regards,
Ali

No comments:

Post a Comment