Re: [time-nuts] PLL Math Question

2014-03-14 Thread Dan Kemppainen
Bob, Just been reading along, enjoying the conversation... I've written a lot of hand coded assembly. Some of it very similar to what you are doing here now. (Although, a different processor family) I really didn't want to switch to C for anything, since code generated is 'bloated'. That being s

Re: [time-nuts] PLL Math Question

2014-03-14 Thread Magnus Danielson
On 14/03/14 00:39, Bob Camp wrote: Hi Either grab a math pack (there are several for the PIC) or go to C. Timing at the Time Nuts level is about precision. We need *lots* of digits past the binary point :) Indeed. Throwing bits at the problems is relatively cheap today. Besides, you don't p

Re: [time-nuts] PLL Math Question

2014-03-14 Thread Magnus Danielson
On 13/03/14 13:57, Jim Lux wrote: On 3/12/14 10:06 PM, Chris Albertson wrote: On Wed, Mar 12, 2014 at 9:13 PM, Daniel Mendes wrote: This is a FIR x IIR question... moving average = FIR filter with all N coeficients equalling 1/N exponential average = using a simple rule to make an IIR filter

Re: [time-nuts] PLL Math Question

2014-03-14 Thread Magnus Danielson
On 13/03/14 07:35, Daniel Mendes wrote: Em 13/03/2014 01:35, Bob Stewart escreveu: Hi Daniel, re: FIR vs IIR I'm not a DSP professional, though I do have an old Smiths, and I've read some of it. So, could you give me some idea what the FIR vs IIR question means on a practical level for this

Re: [time-nuts] PLL Math Question

2014-03-14 Thread Magnus Danielson
Hi Bob, On 12/03/14 23:16, Bob Stewart wrote: "x_avg = x_avg + (x - x_avg) * a_avg;" Hi again Magnus, In fact, I just post-processed some data using that formula in perl. It looks great, and will indeed save me code and memory space. And, it can be a user variable, rather than hard-coded.

Re: [time-nuts] PLL Math Question

2014-03-14 Thread Magnus Danielson
On 12/03/14 20:25, Hal Murray wrote: mag...@rubidium.dyndns.org said: Exponential averger takes much less memory. Consider this code: x_avg = x_avg + (x - x_avg) * a_avg; Where a_avg is the time-constant control parameter. Also note that if a_avg is a power of 2, you can do it all with shifts

Re: [time-nuts] PLL Math Question

2014-03-14 Thread Magnus Danielson
Hi Bob, On 12/03/14 19:26, Bob Stewart wrote: Hi Magnus, Thanks very much for this response! It will be very easy to add the exponential averager to my code and do a comparison to the moving average. I have no experience with PI/PID. I'll have to look over the literature I have on them an

Re: [time-nuts] PLL Math Question

2014-03-13 Thread Hal Murray
li...@rtty.us said: > Timing at the Time Nuts level is about precision. What's the term for a time-nut that's trying to be not-very-nutty? -- b...@evoria.net said: > includes a 10-bit PWM dithered to 14 bits When you get it all working, that's going to be one of the weak links, at lea

Re: [time-nuts] PLL Math Question

2014-03-13 Thread Bob Camp
ost informative and certainly gives me more options. > > Bob > > > > > >> >> From: Chris Albertson >> To: Bob Stewart ; Discussion of precise time and frequency >> measurement >> Sent: Thursday, March 1

Re: [time-nuts] PLL Math Question

2014-03-13 Thread Bob Stewart
y 256. This has been most informative and certainly gives me more options. Bob > > From: Chris Albertson >To: Bob Stewart ; Discussion of precise time and frequency >measurement >Sent: Thursday, March 13, 2014 5:42 PM >Subject: Re: [time-

Re: [time-nuts] PLL Math Question

2014-03-13 Thread Chris Albertson
; > > > > > > > From: Dennis Ferguson > >To: Discussion of precise time and frequency measurement < > time-nuts@febo.com> > >Cc: Hal Murray > >Sent: Thursday, March 13, 2014 1:58 PM > >Subject: Re: [time-nuts

Re: [time-nuts] PLL Math Question

2014-03-13 Thread Bob Stewart
Bob > > From: Dennis Ferguson >To: Discussion of precise time and frequency measurement >Cc: Hal Murray >Sent: Thursday, March 13, 2014 1:58 PM >Subject: Re: [time-nuts] PLL Math Question > > >Note that you can't do fixed-point computations exactly the same way &g

Re: [time-nuts] PLL Math Question

2014-03-13 Thread Dennis Ferguson
On 12 Mar, 2014, at 23:08 , Hal Murray wrote: > b...@evoria.net said: >> In the moving averages I'm doing, I'm saving the last bit to be shifted out >> and if it's a 1 (i.e. 0.5) I increase the result by 1. > > That's just rounding up at an important place. It's probably a good idea, > but do

Re: [time-nuts] PLL Math Question

2014-03-13 Thread Bob Stewart
oating point operations in 8-bit unsigned characters on someone else's control code on this PIC if I can get it to work properly my way. Bob > > From: Jim Lux >To: time-nuts@febo.com >Sent: Thursday, March 13, 2014 7:57 AM >Subject: Re: [ti

Re: [time-nuts] PLL Math Question

2014-03-13 Thread Jim Lux
On 3/12/14 10:06 PM, Chris Albertson wrote: On Wed, Mar 12, 2014 at 9:13 PM, Daniel Mendes wrote: This is a FIR x IIR question... moving average = FIR filter with all N coeficients equalling 1/N exponential average = using a simple rule to make an IIR filter Isn't his "moving average" just a

Re: [time-nuts] PLL Math Question

2014-03-13 Thread Hal Murray
albertson.ch...@gmail.com said: > We have to define "best". I'd define it as "the error integrated over time > is minimum". I think PiD gets you that and it is also easy to program and > uses very little memory. Just three values (1) the error, (2) the total of > all errors you've seen (in a pe

Re: [time-nuts] PLL Math Question

2014-03-12 Thread Daniel Mendes
Em 13/03/2014 01:35, Bob Stewart escreveu: Hi Daniel, re: FIR vs IIR I'm not a DSP professional, though I do have an old Smiths, and I've read some of it. So, could you give me some idea what the FIR vs IIR question means on a practical level for this application? I can see that the MA is

Re: [time-nuts] PLL Math Question

2014-03-12 Thread Chris Albertson
On Wed, Mar 12, 2014 at 9:13 PM, Daniel Mendes wrote: > This is a FIR x IIR question... > > moving average = FIR filter with all N coeficients equalling 1/N > exponential average = using a simple rule to make an IIR filter Isn't his "moving average" just a convolution of the data with a box car f

Re: [time-nuts] PLL Math Question

2014-03-12 Thread Bob Stewart
m: Daniel Mendes >To: Discussion of precise time and frequency measurement >Sent: Wednesday, March 12, 2014 11:13 PM >Subject: Re: [time-nuts] PLL Math Question > > >This is a FIR x IIR question... > >moving average = FIR filter with all N coeficients equalling 1/N >e

Re: [time-nuts] PLL Math Question

2014-03-12 Thread Daniel Mendes
ot, maybe there will be a good gain value that will be convenient to code the exponential average. Thanks for the help, Bob From: Hal Murray To: Bob Stewart ; Discussion of precise time and frequency measurement Cc: hmur...@megapathdsl.net Sent: Wednesday, Ma

Re: [time-nuts] PLL Math Question

2014-03-12 Thread Bob Stewart
scussion of precise time and frequency >measurement >Cc: hmur...@megapathdsl.net >Sent: Wednesday, March 12, 2014 10:08 PM >Subject: Re: [time-nuts] PLL Math Question > > > >b...@evoria.net said: >> In the moving averages I'm doing, I'm saving the last bit to

Re: [time-nuts] PLL Math Question

2014-03-12 Thread Hal Murray
b...@evoria.net said: > In the moving averages I'm doing, I'm saving the last bit to be shifted out > and if it's a 1 (i.e. 0.5) I increase the result by 1. That's just rounding up at an important place. It's probably a good idea, but doesn't cover the area I was trying to point out. Let me t

Re: [time-nuts] PLL Math Question

2014-03-12 Thread Bob Stewart
s up! Bob > > From: Magnus Danielson >To: time-nuts@febo.com >Sent: Wednesday, March 12, 2014 12:51 PM >Subject: Re: [time-nuts] PLL Math Question > > >Bob, > > > >Exponential averger takes much less memory. Consider this code: > >x_

Re: [time-nuts] PLL Math Question

2014-03-12 Thread Bob Stewart
Cc: hmur...@megapathdsl.net >Sent: Wednesday, March 12, 2014 2:25 PM >Subject: Re: [time-nuts] PLL Math Question > > > >mag...@rubidium.dyndns.org said: >> Exponential averger takes much less memory. Consider this code: >> x_avg = x_avg + (x - x_avg) * a_avg; >> Wh

Re: [time-nuts] PLL Math Question

2014-03-12 Thread Hal Murray
mag...@rubidium.dyndns.org said: > Exponential averger takes much less memory. Consider this code: > x_avg = x_avg + (x - x_avg) * a_avg; > Where a_avg is the time-constant control parameter. Also note that if a_avg is a power of 2, you can do it all with shifts rather than multiplies. Note th

Re: [time-nuts] PLL Math Question

2014-03-12 Thread Bob Stewart
.com >Sent: Wednesday, March 12, 2014 12:51 PM >Subject: Re: [time-nuts] PLL Math Question > > >Bob, > >On 12/03/14 18:24, Bob Stewart wrote: >> Now that I've got the TIC going, I'm working on the PLL math >> for my GPSDO.  My question is about moving

Re: [time-nuts] PLL Math Question

2014-03-12 Thread Magnus Danielson
Bob, On 12/03/14 18:24, Bob Stewart wrote: Now that I've got the TIC going, I'm working on the PLL math for my GPSDO. My question is about moving averages. I've put in a moving average for the TIC. From that, I've calculated the slope, and have put a moving average on the slope to settle it d

[time-nuts] PLL Math Question

2014-03-12 Thread Bob Stewart
Now that I've got the TIC going, I'm working on the PLL math for my GPSDO.  My question is about moving averages.  I've put in a moving average for the TIC.  From that, I've calculated the slope, and have put a moving average on the slope to settle it down.  I think this boils down to a moving a