At the risk of talking to myself (first sign of madness)....
I now have the 'framework' of code needed to detect when a frequency is stable- happy.
What I've got issues with is my raw (frequency) input data being a bit 'jittery'. By this I mean if I dial in 100Hz on my sig gen, for every 0.5sec I get readings like this
50 49 50 50 51 50 51 50 49 50 50 50 51 51 50 50 (it should be a steady reading of 50)
....& so on.
Now for a reasding of 50, a plus or minus variance of 1 either side equates to jitter 'error' of 4% ....and this is for digital?!!!
So my approach must be bad! (ok, so the title of the thread is rough 'n ready frequency extrcaction - but a 4% jitter erroris just too rough!)
Now for the life of me I can't figure out why a stable clean sine wave into this chain should cause jitter ...
Sig gen Sine Wave (ie clean & steady as a rock) ->PIC comparator->PIC comparator generates an interrupt->comparator generated interrupts are counted->tmr1 overflows & comparator interrupt 'total count' is stored
Now I can average it out (but this will incur delay in detecting steady frequency - which is my goal) , but I'd rather get to the root of the jitter in the first place!
Bookmarks