a digital phase locked loop receives an input signal s ( t ). the input signal is the sum of a source signal s ideal and a noise term n ( t ) which corrupts the source signal . the source signal is a function of a source frequency ω s and a source phase φ s . therefore the input signal s ( t ) can be expressed as : s ( t )= s ideal ( ω s , φ s , t )+ n ( t ). the noise term n ( t ) is assumed to be a single humped distribution with a maximum at zero . standard random variable analysis can therefore be applied to develop maximum likelihood estimations { circumflex over ( ω )} and { circumflex over ( φ )} of the angular frequency and phase , respectively , of input signal s ( t ). n samples of the input signal are taken at times t i , resulting in n values s i . the samples are indexed such that −( n − 1 )≦ i ≦ 0 . the sample s 0 at time t 0 is the most recent . from these samples an error function err 1 is constructed that depends on an assumed frequency and phase , ω and φ , of the input signal : err 1  ( ω , φ ) = ∑ i = - ( n - 1 ) 0  ( s i - s ideal  ( ω , φ , t ) ) 2 ( 1 ) because noise term n ( t ) is single humped , the values of ω and φ that minimize error function err 1 ( ω , φ ) are the desired maximum likelihood values { circumflex over ( ω )} and { circumflex over ( φ )}. when the source frequency and phase do not vary with time , minimizing error function err 1 is the ideal way to find { circumflex over ( ω )} and { circumflex over ( φ )}, given the assumption about the noise . when ω s and φ s vary slowly with time , eq . ( 1 ) should be modified to include a coefficient in the error function that is a function of time or of sample number so that old samples contribute less to the error function than newer samples . for example , a forgetting factor α , where 0 & lt ; α & lt ; 1 , can be used to construct a new error function err 2 : err 2  ( ω , φ ) = ∑ i = - ( n - 1 ) 0  a - i  ( s i - s ideal  ( ω , φ , t ) ) 2 ( 2 ) when the newer samples close to index zero were generated by a new frequency and phase , and the older samples were generated by a different frequency and phase , the estimates generated from eq . ( 2 ) are closer to the new frequency and phase . the present method uses a digital attribute of input signal s ( t ). the source signal s ideal is characterized by a set of periodic times , called transition times t i . given a digital source , the transition times could be the low to high transitions that occur every period . given a periodic analog signal , the transition times could be the times of upward zero crossings . in any case , the transition times are ideally regular : here t ideal is the period of the source , t ideal = 2π / ω s , and t φ ideal is a time delay corresponding to the phase of the source , t φ ideal = t ideal ( φ s / 2π ). although t φ ideal is a time and not an angle , t φ ideal is sometimes referred to as a phase , since t φ ideal is proportional to the phase of the source signal . the signal detected is not ideal , but is corrupted by noise that shifts the transition times forward and backward : the phase locked loop according to the present invention determines maximum likelihood estimates { circumflex over ( t )} and { circumflex over ( t )} φ of the period t ideal and time delay t φ ideal of the source . the estimates { circumflex over ( t )} and { circumflex over ( t )} φ are found by constructing an error function err 3 using n transition times t i and assumed values t and t φ of the period and time delay of the input signal : err 3  ( t , t φ ) = ∑ i = - ( n - 1 ) 0  a - i  γ i  ( t i - ( it + t φ ) ) 2 ( 3 ) the function err 3 gives a weight α − i γ i to the i th transition time . as before , the term α − i is a power of the forgetting factor αthat reduces the importance of samples that occurred in the distant past . the weight of the i th sample also contains a weighting factor γ i which can vary from sample to sample . weighting factor γ i is a relative importance of a particular sample . the weighting factors are particularly useful when receiving a signal with absent transitions . for example , the phase locked loop may be reconstructing a carrier wave , from a data signal which has transitions that occur irregularly , but always occur within regularly spaced windows . if the i th transition does not take place within a particular window , a weighting factor γ i = 0 is assigned to transition time t i . the zero weighting factor prevents a missed transition from spoiling the error function , allowing good estimates of { circumflex over ( t )} and { circumflex over ( t )} φ to be maintained . the values of t and t φ that minimize err 3 are the desired maximum likelihood estimates { circumflex over ( t )} and { circumflex over ( t )} φ . at the minimum of err 3 ,  ∂ ∂ t φ  err 3  ( t , t φ )   t ^ , t ^ φ = 0   and   ∂ ∂ t  err 3  ( t , t φ )  t ^ , t ^ φ = 0 . evaluating these expressions gives ∑ i = - ( n - 1 ) 0  a - i  γ i  ( t i - ( i  t ^ + t ^ φ ) ) = 0   and   ∑ i = - ( n - 1 ) 0  a - i  γ i  ( t i - ( i  t ^ + t ^ φ ) )  i = 0 . ( 4 ) five sums are defined as follows : s n ( 0 ) = ∑ i = - ( n - 1 ) 0  a - i  γ i , ( 5 ) s n ( 1 ) = ∑ i = - ( n - 1 ) 0  ia - i  γ i , ( 6 ) s n ( 2 ) = ∑ i = - ( n - 1 ) 0  i 2  a - i  γ i , ( 7 ) s nt ( 0 ) = ∑ i = - ( n - 1 ) 0  a - i  γ i  t i , ( 8 ) s nt ( 1 ) = ∑ i = - ( n - 1 ) 0  ia - i  γ i  t i . ( 9 ) eqs . ( 4 ) can be solved in terms of these sums : t ^ = s n ( 1 )  s nt ( 0 ) - s n ( 0 )  s nt ( 1 ) ( s n ( 1 ) ) 2 - s n ( 0 )  s n ( 2 )   and   t ^ φ = s n ( 2 )  s nt ( 0 ) - s n ( 1 )  s nt ( 1 ) ( s n ( 1 ) ) 2 - s n ( 0 )  s n ( 2 ) . ( 10 ) while it is possible to use eqs . ( 10 ) to determine { circumflex over ( t )} and { circumflex over ( t )} φ , the phase locked loop of the present invention uses previous estimates of the period and time delay , as well as previous values of the sums of eqs . ( 5 )-( 9 ). before the arrival of the n th transition time t 0 , n − 1 transition times { tilde over ( t )} i were received , for i =−( n − 2 ) to 0 . each transition time { circumflex over ( t )} i had weight α − i { tilde over ( γ )} i , and ( n − 1 ) th estimates { tilde over ( t )} and { tilde over ( t )} φ of the period and the time delay of the input signal were calculated using previous values of the sums of eqs . ( 5 )-( 9 ). specifically , s n - 1 ( n ) = ∑ i = - ( n - 2 ) 0  i n  a - i  γ ~ i for n = 0 , 1 , and 2 ; and s ( n - 1 )  t ( n ) = ∑ i = - ( n - 2 ) 0  i n  a - i  γ ~ i  t ~ i for n = 0 and 1 . then the old estimates { tilde over ( t )} and { tilde over ( t )} φ are given by the analogue of eqs . ( 10 ): t ~ = s n - 1 ( 1 )  s ( n - 1 )  t ( 0 ) - s n - 1 ( 0 )  s ( n - 1 )  t ( 1 ) ( s n - 1 ( 1 ) ) 2 - s n - 1 ( 0 )  s n - 1 ( 2 )   and    t ~ φ = s n - 1 ( 2 )  s ( n - 1 )  t ( 0 ) - s n - 1 ( 1 )  s ( n - 1 )  t ( 1 ) ( s n - 1 ( 1 ) ) 2 - s n - 1 ( 0 )  s n - 1 ( 2 ) . ( 11 ) eqs . ( 10 ) can be reworked so that { circumflex over ( t )} and { circumflex over ( t )} φ can be calculated in an incremental fashion as new transition times are received , to avoid having to re - evaluate all sums in their entirety just to incorporate the effect of one new transition time . the most recent transition time is t 0 , and transition time t i − 1 is older than transition time t i . to incorporate a new transition time , the transition times that were indexed i =−( n − 2 ) through i = 0 are shifted to indices i =−( n − 1 ) through i =− 1 to make room for the new transition time t 0 . the transformation between old transition times { tilde over ( t )} i and new transition times t i is : t i − 1 ={ tilde over ( t )} i −{ tilde over ( t )}−{ tilde over ( t )} φ ( 12 ) this transformation causes the expectation value , or average value , of t 0 to be zero : the arbitrary weighting factors γ i remain associated with the transition time to which they were first assigned . therefore the relationship between the old weighting factors { tilde over ( γ )} i and the new weighting factors γ i is : eq . ( 5 ) can be transformed into a recursive relationship by breaking out the first element of the sum , reindexing the remaining sum , then using eq . ( 13 ): s n ( 0 ) = γ 0 + ∑ i = - ( n - 1 ) - 1  a - i  γ i = γ 0 + ∑ i = - ( n - 2 ) 0  a - ( i - 1 )  γ i - 1 = γ 0 + a  ∑ i = - ( n - 2 ) 0  a - i  γ ~ i . similar mathematical manipulations give recursive equations for sums s n ( 1 ) and s n ( 2 ) : s n ( 2 ) = α ( s n − 1 ( 2 ) − 2 s n − 1 ( 1 ) − s n − 1 ( 0 ) ). ( 16 ) recursive relations for s nt ( n ) can also be derived using eqs . ( 12 ) and ( 13 ): s nt ( 0 ) = γ 0 t 0 + αs ( n − 1 ) t ( 0 ) − αs n − 1 ( 0 ) ( { tilde over ( t )}+{ tilde over ( t )} φ ), ( 17 ) s nt ( 1 ) = αs ( n − 1 ) t ( 1 ) − αs ( n − 1 ) t ( 0 ) − αs n − 1 ( 1 ) ( { circumflex over ( t )}+{ tilde over ( t )} φ )+ α s n − 1 ( 0 ) ( { tilde over ( t )}+{ tilde over ( t )} φ ) ( 18 ) now , using eqs . ( 11 ) and ( 14 - 18 ), eqs . ( 10 ) can be transformed to the following expressions : t ^ = t ~ + ( s n - 1 ( 0 ) - s n - 1 ( 1 ) )  γ 0 a  ( s n - 1 ( 0 )  s n - 1 ( 2 ) - ( s n - 1 ( 1 ) ) 2 ) + ( s n - 1 ( 2 ) - 2  s n - 1 ( 1 ) + s n - 1 ( 0 ) )  γ 0  t 0 ( 19 ) t ^ φ = - ( s n - 1 ( 2 ) - 2  s n - 1 ( 1 ) + s n - 1 ( 0 ) )  γ 0 a  ( s n - 1 ( 0 )  s n - 1 ( 2 ) - ( s n - 1 ( 1 ) ) 2 ) + ( s n - 1 ( 2 ) - 2  s n - 1 ( 1 ) + s n - 1 ( 0 ) )  γ 0  t 0 ( 20 ) notice that the sums s ( n − 1 ) t ( n ) do not appear in eqs . ( 19 ) and ( 20 ). equations ( 14 )-( 16 ) and ( 19 )-( 20 ) are the cornerstones of the present method of implementing a phase locked loop . a computing device maintains the internal variables s n − 1 ( 0 ) , s n − 1 ( 1 ) , s n − 1 ( 2 ) , { tilde over ( t )} and { tilde over ( t )} φ . the debice then identifies transition time t 0 of the input signal , and determines the value of weighting factor γ 0 . the device calculates new maximum likelihood estimates { circumflex over ( t )} and { circumflex over ( t )} φ using eqs . ( 19 ) and ( 20 ), then updates the sums according to eqs . ( 14 )-( 16 ). preferably , the device creates an output signal based on the estimates { circumflex over ( t )} and { circumflex over ( t )} φ . the process is repeated for each transition time received . as will be clear to one skilled in the art , the device will operate faster if parts of eqs . ( 19 ) and ( 20 ) are calculated in advance , before the arrival of transition time t 0 . for example , in some embodiments , the coefficient of t 0 appearing in eq . ( 20 ) is calculated in advance , assuming γ 0 = 1 . when transition time to arrives , weighting factor γ 0 is determined . if γ 0 = 1 , the pre - calculated coefficient is multiplied by transition time t 0 to obtain { circumflex over ( t )} φ . if γ 0 = 0 , { circumflex over ( t )} φ = 0 . in general , the weighting factors γ i are not determined ahead of time . however , some simplification of the method occurs if all the weighting factors are identically equal to , one : γ i = 1 . the sums s n − 1 ( n ) can then be evaluated analytically , with the following results : t ^ = t ~ + [ ( n - 1 )  a n + 2 - ( 3  n - 2 )  a n + 1 + ( 3  n - 1 )  a n + a 2 - 2  a + 1 a 2  n - n 2  a n + 1 + 2  ( n 2 - 1 )  a n - n 2  a n - 1 + 1 ]  t 0 , ( 21 ) t ^ φ = [ - ( n - 1 ) 2  a n + 2 + ( 3  n - 4 )  na n + 1 - ( 3  n + 1 )  ( n - 1 )  a n + n 2  a n - 1 + a 2 - 1 a 2  n - n 2  a n + 1 + 2  ( n 2 - 1 )  a n - n 2  a n - 1 + 1 ]  t 0 . ( 22 ) still further simplification occurs in at least two different limits . in the first limit , the number of samples n is taken to be very large : n →∞. in this case , eqs . ( 21 ) and ( 22 ) reduce to : { circumflex over ( t )} φ =−( 1 − α 2 ) t 0 . ( 24 ) in the second limit , n is finite , and the forgetting factor α approaches unity : α → 1 . in this limit , eqs . ( 21 ) and ( 22 ) become : t ^ = t ~ + 6 n  ( n + 1 )  t 0 , ( 25 ) t ^ φ = - 2  ( 2  n - 1 ) n  ( n + 1 )  t 0 . ( 26 ) fig1 is a diagram of a circuit 100 of a digital phase locked loop according to the preferred embodiment of the invention . a receiver 10 receives the input signal and sends the input signal to a comparator 12 . the comparator identifies transition time t 0 and delivers an electrical signal corresponding to transition time t 0 to circuit elements 14 and 16 . preferably , comparator 12 compares transition time t 0 to an expected time t ′, and determines the value of weighting factor γ 0 based upon the proximity of t 0 to t ′. for example , in one embodiment , γ 0 = 1 if | t 0 − t ′|≦ w for some preselected value of w , and γ 0 = 0 if | t 0 − t ′|& gt ; w . many other methods for choosing the value of γ 0 will be apparent to one skilled in the art , and could be used by comparator 12 . in the preferred embodiment , the times t 0 and t ′ are normalized so that t ′= 0 . in other words , transition time t 0 is the time of a transition of the input signal , measured relative to the expected time t ′ of the transition . circuit element 14 computes the maximum likelihood estimate of the time delay , { circumflex over ( t )} φ , according to eq . ( 20 ). circuit element 16 computes the value of { circumflex over ( t )} according to eq . ( 19 ). the period and time delay estimates { circumflex over ( t )} and { circumflex over ( t )} φ are output from circuit elements 16 and 14 to a signal generator 18 that generates an output signal having a period and a time delay equal to { circumflex over ( t )} and { circumflex over ( t )} φ , respectively . the output signal is sent to comparator 12 , so that the comparator may determine the expected time t ′. the output signal is also sent to an electrical output 20 that transmits the output signal to other devices as needed . weighting factor γ 0 is output from comparator 12 to an adder 22 whose result is the value of s n ( 0 ) according to eq . ( 14 ). the value of s n − 1 ( 0 ) is stored in delay element 24 , and is sent to circuit elements 14 and 16 to calculate and { circumflex over ( t )} φ and { circumflex over ( t )}. s n − 1 ( 0 ) is also multiplied by forgetting factor α and is input into adder 22 to compute s n ( 0 ) . the value of s n ( 0 ) that is output from adder 22 is subsequently stored in delay element 24 in preparation for the arrival of the next transition time . similarly , adders 26 and 28 output s n ( 1 ) and s n ( 2 ) , respectively . fig2 is a diagram of a circuit 200 of a digital phase locked loop according to a second embodiment of the invention . in this embodiment , all weighting factors γ i = 1 . a comparator 30 determines the transition time t 0 of the input signal received by receiver 10 . as before , transition time t 0 is measured relative to the expected time t ′ of the transition . expected time t ′ is obtained from signal generator 18 . transition time t 0 is sent to circuit elements 32 and 34 that compute { circumflex over ( t )} and { circumflex over ( t )} φ according to eqs . ( 21 ) and ( 22 ), respectively . in an alternative embodiment , circuit elements 32 and 34 compute { circumflex over ( t )} and { circumflex over ( t )} φ according to eqs . ( 23 ) and ( 24 ), respectively . in another alternative embodiment , circuit elements 32 and 34 compute { circumflex over ( t )} and { circumflex over ( t )} φ according to eqs . ( 25 ) and ( 26 ), respectively . the quality of the synchronization of the phase locked loop can be determined by considering the noise in { circumflex over ( t )} and { circumflex over ( t )} φ to be generated by the sequence of independent identically distributed random variables n i . transition times t i are given by if the incoming period t ideal and phase t φ ideal are stable , taking on constant values for all time , then the variation in the estimates { circumflex over ( t )} and { circumflex over ( t )} φ is due to the added noise . through eqs . ( 10 ) the variance of { circumflex over ( t )} and { circumflex over ( t )} φ can be expressed in terms of the mean & lt ; n & gt ; and variance & lt ; n 2 & gt ;−& lt ; n & gt ; 2 of each of the n i ′ s . therefore , given the parameters α , n , and the γ i ′ s , the accuracy with which the phase locked loop is estimating and locking onto the input signal can be determined . the user can alter the parameters , making trade - offs between locking accuracy , tracking of source variations , and locking speed . the noise is assumed to have the following characteristics : & lt ; n i & gt ;= 0 for every i , and & lt ; n i n j & gt ;= 0 when i ≠ j . furthermore , the value of & lt ; n i 2 & gt ; is the same for every i : & lt ; n i 2 & gt ;≡& lt ; n 2 & gt ;. from these assumptions , the variance of { circumflex over ( t )} and { circumflex over ( t )} φ can be derived from eqs . ( 10 ): 〈 t ^ 2 〉 - 〈 t ^ 〉 2 = 1 ( ( s n ( 1 ) ) 2 - s n ( 0 )  s n ( 2 ) ) 2  { ( s n ( 1 ) ) 2  ∑ i = - ( n - 1 ) 0  a - 2  i  γ i 2 - 2  s n ( 0 )  s n ( 1 )  ∑ i = - ( n - 1 ) 0  ia - 2  i  γ i 2 + ( s n ( 0 ) ) 2  ∑ i = - ( n - 1 ) 0  i 2  a - 2  i  γ i 2 }  〈 n 2 〉 ( 27 ) 〈 t ^ φ 2 〉 - 〈 t ^ φ 〉 2 = 1 ( ( s n ( 1 ) ) 2 - s n ( 0 )  s n ( 2 ) ) 2  { ( s n ( 2 ) ) 2  ∑ i = - ( n - 1 ) 0  a - 2  i  γ i 2 - 2  s n ( 1 )  s n ( 2 )  ∑ i = - ( n - 1 ) 0  ia - 2  i  γ i 2 + ( s n ( 1 ) ) 2  ∑ i = - ( n - 1 ) 0  i 2  a - 2  i  γ i 2 }  〈 n 2 〉 ( 28 ) eqs . ( 27 ) and ( 28 ) give the variance of the maximum likelihood estimates of the period and time delay for any n , α , and an arbitrary set of weighting factors γ i . a better understanding of the variances of { circumflex over ( t )} and { circumflex over ( t )} φ can be obtained by considering the case when γ i = 1 for all i . two limits of this case are especially informative . in the first limit , the forgetting factor α → 1 . in this limit , 〈 t ^ 2 〉 - 〈 t ^ 〉 2 = 12 n  ( n 2 - 1 )  〈 n 2 〉 , ( 29 ) 〈 t ^ φ 2 〉 - 〈 t ^ φ 〉 2 = 2  ( 2  n - 1 ) n  ( n + 1 )  〈 n 2 〉 . ( 30 ) fig3 shows a graph of the variance of the estimated period , normalized by the variance of the noise , versus n . that is , fig3 is a graph of (& lt ;{ circumflex over ( t )} 2 & gt ;−& lt ;{ circumflex over ( t )}& gt ; 2 )/& lt ; n 2 & gt ; versus n , as given by eq . ( 29 ). fig4 is a graph of the normalized variance of the time delay vs . n , as given by eq . ( 30 ). in the second limit , n →∞ and α remains arbitrary . in this limit , 〈 t ^ 2 〉 - 〈 t ^ 〉 2 = 2  ( 1 - a 3 ) ( 1 + a ) 3  〈 n 2 〉 , ( 31 ) 〈 t ^ φ 2 〉 - 〈 t ^ φ 〉 2 = 1 + 3  a + a 2 - 5  a 3 ( 1 + a ) 3  〈 n 2 〉 . ( 32 ) fig5 is a graph of the variance of { circumflex over ( t )} vs . α according to eq . ( 31 ). fig6 is a plot of the variance of { circumflex over ( t )} φ vs . α according to eq . ( 32 ). in fig5 and 6 , as in fig3 and 4 , the variances are normalized by the variance of the noise , & lt ; n 2 & gt ;. as fig3 - 6 show , the variance of both the period and the time delay decrease as n increases and as α increases . the variances of the period and the time delay approach zero as α → 1 and n →∞. this indicates that given an infinite number of transition times all evenly weighted , the phase locked loop would produce a perfect estimate of the period and the time delay of the input signal . in more realistic situations , eqs . ( 27 ) and ( 28 ) must be used to determine the values of α and n that give characteristics that will satisfy the needs of the desired application of the phase locked loop . a larger value of α may be traded off for a larger value of n for a given variance of the period or time delay . a larger value of α slows the response to a variation in either the period t ideal or phase t φ ideal of the source . a larger value of n means a larger number of samples are needed to reach a locked state . fig7 is a contour plot of the normalized variance of { circumflex over ( t )} φ vs . α and n . along a contour c 9 , the normalized variance of { circumflex over ( t )} φ is equal to 0 . 9 . along a contour c 1 , the normalized variance is 0 . 1 . intermediate contours are shown in increments of 0 . 1 . for example , along a contour c 6 , (& lt ;{ circumflex over ( t )} φ 2 & gt ;−& lt ;{ circumflex over ( t )} φ & gt ; 2 )/& lt ; n 2 & gt ;= 0 . 6 . fig7 can be used to determine the optimum value of α needed for a given application . in fig3 - 7 , it is assumed that all of the weighting factors are equal to one . it will be apparent to one skilled in the art that many variations of the above method and apparatus are possible . therefore , the scope of the invention should be determined by the following claims and their legal equivalents .