discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Number of samples in a Sync block - clarification


From: Martin Braun
Subject: Re: [Discuss-gnuradio] Number of samples in a Sync block - clarification
Date: Thu, 10 Sep 2015 09:37:53 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0

On 10.09.2015 07:25, Nicolas Cuervo Benavides wrote:
> 1. Where does the 4096 comes from? it is 2¹², which I don't recall being
> 12 the size of one datatype that is involved in my function. It is
> directly a value from scheduler and always the same?

This value is pretty much random; 4096 works well with pages, but it
could be any other value. noutput_items is how much valid items you have
in your buffer. On the *first run*, all other values will be zero (but
after that, they may contain old samples).

> 2. If it is not always the same value, how I am indirectly fixing that
> amount of samples? I would like, if possible, to save more samples as it
> would reduce the variance of the calculations.

You need to construct your block to handle *any* number of samples,
unless you constrain it e.g. with set_output_multiple(). Your variance
can be calculated over several work() calls, until you've read enough
samples.

Your code may have some other issues, but it's hard to say without
seeing the rest of the work function.

M



reply via email to

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