[wxqc] Text to Degrees

Steve Dimse steve at dimse.com
Sun Apr 8 14:47:45 CDT 2007


On Apr 8, 2007, at 3:17 PM, Victor Engel wrote:

>> That is one way to do it. I use something I find simpler to prevent
>> the 360 problem. With each incoming value, I vector add the new value
>> with a weight of 1/n. The first reading starts the average, the
>> second moves the average 1/2 of the way towards the new reading, the
>> third reading moved the average 1/3 of the way towards that new
>> reading, the fourth moves the average 1/4 of the way to that new
>> reading, and so on. In this way there is only one accumulated vector
>> and it is always ready for output, nice when running the averaging
>> and output routines as separate processes.
>
> That would work if you're computing the average since a constant time
> (like since midnight maybe?) but it wouldn't work for a running
> average, like average over the last hour.

For moving averages it would work the same way the other must, which  
is to keep a list of all the readings. You then either recompute the  
average from the full list, or remove the oldest and add the newest  
(both with a weight of 1/n) to the running total. You can't do a  
moving average without keeping all the individual readings.

Steve K4HG


More information about the wxqc mailing list