I got it and it is indeed very simple. Subtract a receival time "n" steps back
in time from "last" receival time, divide and accumulate this time:
dt = (tArrival(-1) - tArrival(-n))/n;
tEstimated = tEstimated + dt;
Jitter on a singel arrival time will be divided by "n" and "tEstimated" will
My knee-jerk algorithm would say subtract one average from the total of all
averages, add in the new period, and divide by the number in the average.
If programming in assembler I would go with 128 rather than 100 steps to
keep the division easy (rotate a copy of the accumulator right 7 bits).
Divi
> > Until this is solved I calculate number of periods and where phase is
> > located within period in average for all values each time. It will
> > work to calculate by using each value every time even though it use a
> > ridiculous amount of clock cycles.
>
> That's just a hardware counter ticki
> > Until this is solved I calculate number of periods and where phase is
> > located within period in average for all values each time. It will
> > work to calculate by using each value every time even though it use a
> > ridiculous amount of clock cycles.
>
> That's just a hardware counter ticki
On 11.04.16 14:52, Nicklas Karlsson wrote:
> Diluted old values may better or worse. Problem is I can't get a grip
> on howto calculate moving average arrival time within the period.
That's one of the two methods presented, isn't it?
> Until this is solved I calculate number of periods and where
> On 11 April 2016 at 13:05, Nicklas Karlsson
> wrote:
>
> > Is is rather straightforward to calculate from for example the last 100
> > arrival times but a moving average algorithm would be preferred to reduce
> > CPU load. Do anybody have any ideas?
>
> The simplest implementation of a movin
> > Is is rather straightforward to calculate from for example the last
> > 100 arrival times but a moving average algorithm would be preferred to
> > reduce CPU load. Do anybody have any ideas?
>
> If the average is over 64 or 128 samples, then the divide is reduced to
> a 6 or 7 bit rightshift.
On 11 April 2016 at 13:05, Nicklas Karlsson
wrote:
> Is is rather straightforward to calculate from for example the last 100
> arrival times but a moving average algorithm would be preferred to reduce CPU
> load. Do anybody have any ideas?
The simplest implementation of a moving-average is pro
On 11.04.16 14:05, Nicklas Karlsson wrote:
>
> Is is rather straightforward to calculate from for example the last
> 100 arrival times but a moving average algorithm would be preferred to
> reduce CPU load. Do anybody have any ideas?
If the average is over 64 or 128 samples, then the divide is re
I have made some work on a micro controller based stepper generator and steps
are now generated.
To keep stepper generator in sync with linuxcnc there is a need to calculate
average phase and period of the message arrival times. I expect the same
algorithm is rather useful to have then working
10 matches
Mail list logo