# Doubt about forecast function usage

**URL:** <https://www.ruby-forum.com/t/doubt-about-forecast-function-usage/235032>\
**Category:** GNU Radio\
**Created:** [May 27, 2013, 12:15pm UTC](https://www.ruby-forum.com/t/doubt-about-forecast-function-usage/235032 "2013-05-27T12:15:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [May 27, 2013, 12:15pm UTC](https://www.ruby-forum.com/t/doubt-about-forecast-function-usage/235032/1 "2013-05-27T12:15:53Z")

</div>

In which way should I use forecast function if the number of output  
items  
isn’t anyhow related to the number of input items. The relationship is  
more  
qualitative than quantitative. For example number of output elements  
depends on whether there is certain power inside the input strea, or  
similar.

Best

---

<div class="post-metadata">

**Author:** ![Nemanja\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@Nemanja\_S](https://www.ruby-forum.com/u/Nemanja_S)\
**Post date:** [May 27, 2013, 1:49pm UTC](https://www.ruby-forum.com/t/doubt-about-forecast-function-usage/235032/2 "2013-05-27T13:49:21Z")

</div>

On Mon, May 27, 2013 at 12:14:11PM +0200, Nemanja S. wrote:

> In which way should I use forecast function if the number of output items isn’t  
> anyhow related to the number of input items. The relationship is more  
> qualitative than quantitative. For example number of output elements depends on  
> whether there is certain power inside the input strea, or similar.

It doesn’t really matter, because you’re using a gr::block and  
therefore, you can always check both ninputitems and noutputitems.

If you have a certain ratio when outputting, use that. At least, that  
will ensure enough space in the output buffer when you actually do have  
something going through the block.

MB

–  
Karlsruhe Institute of Technology (KIT)  
Communications Engineering Lab (CEL)

Dipl.-Ing. Martin B.  
Research Associate

Kaiserstraße 12  
Building 05.01  
76131 Karlsruhe

Phone: +49 721 608-43790  
Fax: +49 721 608-46071  
www.cel.kit.edu

KIT – University of the State of Baden-Württemberg and  
National Laboratory of the Helmholtz Association

---

<div class="post-metadata">

**Author:** ![Nemanja\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@Nemanja\_S](https://www.ruby-forum.com/u/Nemanja_S)\
**Post date:** [May 27, 2013, 4:08pm UTC](https://www.ruby-forum.com/t/doubt-about-forecast-function-usage/235032/3 "2013-05-27T16:08:27Z")

</div>

Thanks.
