discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Moving average


From: Cinaed Simson
Subject: Re: [Discuss-gnuradio] Moving average
Date: Mon, 21 Jan 2019 21:47:04 -0800
User-agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

1/5 is zero using integer division in python.

Try using float division

 1/4000.
 1/5.

-- Cinaed


On 1/21/19 4:41 PM, david vanhorn wrote:
> The docs say that I need to set Scale to the inverse of the Length.
> Ok, I interpret that as Length = 4000 and Scale = 1/4000
> The docs here:
> https://www.gnuradio.org/doc/doxygen/classgr_1_1blocks_1_1moving__average__ff.html
> says that Scale is a float.
> 
> The discussion here clearly shows Scale working for values <1 and >0
> https://lists.gnu.org/archive/html/discuss-gnuradio/2016-01/msg00084.html
> 
> If I enter a scale value by hand, like 0.2, then I see 200m which is
> what I expect.
> If I enter a scale value as (1/5) then I see 0.
> If I set a variable called "Scale" = (1/) and enter "Scale" in the Scale
> field of the moving average, it evaluates to 0.
> 
> 
> When I enter the values in the block, it looks like scale is an int,
> which makes 1/4000 or indeed 1/(>1) problematic in that it always
> evaluates to zero, which kinda breaks things.
> When I enter 1/2 I get "0"
> 
> When I hover over the field to enter Scale, I get Type Real.
> 
> I have the input and output of my integrator connected to a QT GUI Time
> Sink, and while the input waveform is what I expect, if I have any <1
> Scale parameter, the output is 0.
> 
> 
> Is something broken here, or is it me?
> I've not had any problems using simple math in any of the other fields
> where appropriate.
> 
> 
> -- 
> K1FZY (WA4TPW) SKĀ  9/29/37-4/13/15
> 
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 




reply via email to

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