<<

E. RUBIOLA &AL.THE Ω COUNTER, A COUNTER BASED ON THE LINEAR REGRESSION JUNE 17, 2015 1 The Ω counter, a frequency counter based on the Linear Regression E. Rubiola, M. Lenczner, P.-Y. Bourgeois, and F. Vernotte

TABLE I Abstract—This article introduces the Ω counter, a frequency SOMECOMMERCIAL TDCSAND TIME INTERVAL ANALYZERS. counter — or a frequency-to-digital converter, in a different jargon — based on the Linear Regression (LR) algorithm on time stamps. Device / Brand Resolution Type Reference We discuss the noise of the . We derive the statistical Acam TDC-GPX 10 ps Chip [12] properties of the Ω counter on rigorous mathematical basis, including the weighted measure and the frequency response. We Brilliant < 1 ps PCI/PXI Card [13] describe an implementation based on a SoC, under test in our Guidetech 1 ps PCI/PXI Card [14] laboratory, and we compare the Ω counter to the traditional Π and Λ counters. K&K 50 ps Special purpose [15], [16] The LR exhibits optimum rejection of white phase noise, Keysight 53230A 20 ps Lab instrument [17] superior to that of the Π and Λ counters. White noise is the major practical problem of wideband digital electronics, both in Maxim MAX35101 20 ps Chip [18] the instrument internal circuits and in the fast processes which SPAD Lab TDC 22 ps Chip [19] we may want to measure. The Ω counter finds a natural application in the measurement Texas THS788 8 ps Chip [20] of the Parabolic Variance, described in the companion article arXiv:1506.00687 [physics.-an]. that the ‘1/n counts’ quantization uncertainty is limited by the clock frequency, instead of the arbitrary input frequency. Of I.INTRODUCTIONAND STATE OF THE ART course, the clock is set by design at the maximum frequency The frequency counter in an instrument that measure the allowed for the technology. frequency of the input versus a reference oscillator. Higher resolution is obtained by measuring fractions of the Since frequency and time intervals are the most precisely clock period with a suitable interpolator. Simple and precise measured physical quantity, and nowadays even fairly sophis- interpolators work only at fixed frequency. The most widely ticated counters fit in a small area of a chip, converting a used techniques are described underneath. Surprisingly, all physical quantity to a frequency is a preferred approach to them are rather old and feature picosecond range resolution. the design of electronic instruments. The consequence is that The progress concerns the sampling rate, from kS/s or less the counter is now such a versatile and ubiquitous instrument in the early time to a few MS/s available now. See [4] for a that it creates applications rather than being developed for review, and [2] for integrated electronics techniques. applications, just like the computer. • The Nutt Interpolator [5], [6] makes use of the linear The term ‘counter’ comes from the early instruments, where charge and discharge of a capacitor. the [1], a dedicated cold-cathode vacuum tube, • The Frequency Vernier is the electronic version of the was used to count the pulses of the input signal at in a ‘Vernier caliper’ commonly used in the machine shop. A reference time, say 0.1 s or 1 s. While the manufacturers synchronized oscillator close to the clock frequency plays of electrical instruments stick on the word ‘counter,’ the new the role of the Vernier scale [7]–[10] terms ‘Time-to-Digital Converter’ (TDC) and ‘Frequency-to- • The Thermometer Code Interpolator uses a pipeline of Digital Converter’ are generally preferred in digital electronics small delay units and D-type flip-flops or latches. To our (see for example [2], [3]. knowledge, it first appeared in the HP 5371A time interval arXiv:1506.05009v1 [physics.ins-det] 16 Jun 2015 The direct frequency counter has long time ago been re- analyzer implemented with discrete delay lines and sparse placed by the classical reciprocal frequency counter, which logic [11]. measures the average period on a suitable interval by counting Table I provide some examples of commercial products. the pulses of the reference clock. The obvious advantage is In the classical reciprocal counter, the input signal is sam- Michel Lenczner, Pierre-Yves Bourgeois and Enrico Rubiola are with pled only at the beginning and at the end of the measurement the CNRS FEMTO-ST Institute, Department of Time and Frequency, time τ. There results a uniformly weighted averaging of UBFC, UFC, UTBM, ENSMM, 26, chemin de l’Epitaphe,´ Besancon, 2 France. E-mail {michel.lenczner|pyb2|rubiola}@femto-st.fr. Enrico’s home frequency. In the presence of time jitter of variance σx (clas- page http://rubiola.org. sical variance), statistically independent a start and stop, the F. Vernotte is with UTINAM, Observatory THETA of Franche-Comte,´ fluctuation of the measured fractional frequency has variance University of Franche-Comte/UBFC/CNRS,´ 41 bis avenue de l’observatoire 2 2 2 - B.P. 1615, 25010 Besanc¸on Cedex, France (Email francois.vernotte@obs- σy = 2σx /τ . Increased resolution can be achieved with fast besancon.fr). sampling and statistics. A sampling interval τ = τ/m, m 1 0  E. RUBIOLA &AL.THE Ω COUNTER, A FREQUENCY COUNTER BASED ON THE LINEAR REGRESSION JUNE 17, 2015 2

interpolator II.INSTRUMENT ARCHITECTUREAND NOISE input t The use of time stamps for sophisticated statistics is inspired to the ‘Picket Fence’ method introduced by C. Greenhall for clock t the JPL time scale [30], [31]. Figure 1 shows a rather general block diagram. Following the signal paths, we expect that time stamp trigger all the noise originating inside the instrument contains only input binary white and flicker PM noise. The reason is that the instrument counter internal delay cannot diverge in the long run. Notice that start the divergence of the flicker is only an academic issue [32]. {xk} or {θk} interpolator Integrating over 20–40 decades of frequency, the rms delay {t } stop k

process exceeds by a mere 15–20 dB the flicker coefficient. Conversely D-type the reference oscillator, which in a strict sense are not a part register of the instrument, and the signal under test can include white FM and slower phenomena. The analysis of practical cases, binary underneath, shows that the instrument internal noise is chiefly counter clock white PM.

Fig. 1. Time-stamp counter architecture. A. Internal clock distribution The reference clock signal is distributed to the critical parts of the counters by appropriate circuits. As an example, we enables averaging on highly overlapped and statistically m evaluate the the jitter of the Cyclone III FPGA by Altera [33]. independent measures. In this way, one can expect a variance A reason is that we have studied thoroughly the noise of this 2 2 2. There results a triangle weighted averaging σy σx /mτ device [34]. Another reason is that it is representative of the of frequency.∝ These two methods are referred to as and Π class of mid sized FPGAs, and similar devices from other counters (or estimators) because of the graphical analogy Λ brands, chiefly Xilinx [35], would give similar results. of the Greek letter to the weight function [21], [22] The Π White phase noise is of the aliased ϕ-type, described by and Λ counters are related to the Allan variance AVAR [23], [24] and to the Modified Allan variance MVAR [25]–[27]. k2 Sϕ(f) = Frequency counters specialized for MVAR are available as a ν0 niche product, chiefly for research labs (for example [15]). where ν0 is the clock frequency, and k 630 µrad is an ex- Having access to fast time stamping and to sufficient com- perimental parameter of the component.≈ Since the PM noise is puting power on FPGA and SoC at low cost and acceptable sampled at the threshold crossings, i.e., at 2ν0, the bandwidth complexity, we tackle the problem of the best estimator to be 1 is equal to ν0. Converting Sϕ(f) into Sx(f) = 2 2 Sϕ(f) implemented in a frequency counter. 4π ν0 and integrating on ν0, we get The Linear Regression (LR) turns out to be the right answer k2 because it provides the lowest-energy (or lowest-power) fit x2 = 2 2 of a data set, which is the optimum approximation for white 4π ν0 noise. The LR can be interpreted as a weight function applied thus xrms = 2.8 ps at 100 MHz clock frequency. to the measured frequency fluctuations. The shape of such Flicker phase noise is of the x-type. We measured a value weight function is parabolic (Fig. 3). We call the correspond- of 22 fs/√Hz at 1 Hz, and referred to 1 Hz bandwidth. ing instrument ‘Ω counter,’ for the graphical analogy of the Integrating over 12-15 decades, we find 115–130 fs rms, which parabola with the Greek letter, and in the continuity of the Π is low as compared to white noise. and Λ counters [21], [22]. The Ω estimator is similar to the Λ estimator, but exhibits higher rejection of the instrument B. Input trigger noise, chiefly of white phase noise. This is important in the measurement of fast phenomena, where the noise bandwidth In most practical cases the noise is low enough to avoid is necessarily high, so the white phase noise is integrated over multiple bounces at the threshold crossings, as described in the bandwidth. [36] In this condition, the rms time jitter is The idea of the LR for the estimation of frequency is not V x = rms new [11], [28]. However, these articles lack rigorous statistical rms SR analysis. Another modern use of the LR has been proposed where Vrms is the rms fluctuation of the threshold, and SR is independently by Benkler et al. [29] at the IFCS, where the slew rate (slope, not accounting for noise). we gave our first presentation on the Ω counter and on our The rms voltage results from white and flicker noise. The standpoint about the Parabolic Variance PVAR. former is described as Vw = en√B, where en is the white noise in 1 Hz bandwidth, and B the noise bandwidth. The latter results from Vf = αen ln(B/A), where αen is the p E. RUBIOLA &AL.THE Ω COUNTER, A FREQUENCY COUNTER BASED ON THE LINEAR REGRESSION JUNE 17, 2015 3

flicker noise at 1 Hz and referred to 1 Hz bandwidth, and A is the low cutoff frequency. The golden rules for precision high-speed design suggest

• White noise, en = 10 nV/√Hz, including the input pro- tection circuits (without, it would be of 1–2 nV/√Hz). • Flicker noise, α = 10 ... 31.6 (20–30 dB) at most, as a conservative estimate • the noise bandwidth is related to the maximum input (toggling) frequency νmax by νmax = 0.3 B. Let us consider a realistic example where νmax = 1.2 GHz, en = 10 nV/√Hz, and α = 31.6 (30 dB). Accordingly, the input bandwidth is B = 4 GHz. In turn the integrated white noise is Vw = 632 µV rms. By contrast, flicker is Vf = 1.66 µV rms integrated over 12 decades (4 mHz to 4 GHz), and Fig. 2. Principle of the LR counter, and definition of often used variables. Vf = 1.86 µV rms integrated over 15 decades (4 µHz to 4 GHz). White noise is clearly the dominant effect. where C. Clock interpolator x(t) = ϕ(t)/2πν (3) Commercially available counters exhibit single-shot fluctu- 0 ation of 1–50 ps [Tab. I and References herein]. Since the y(t) = x˙(t). (4) interpolator is reset to its initial state after each use, it is The quantity x(t) is the time carried by the real signal, which sound to assume that the noise realizations are statistically is equal to the ideal time t plus the random fluctuation x(t). independent, which is white noise. At a closer sight some The quantities x(t) and y(t) match the phase time fluctuation memory between operations is possible, which shows up as x(t) and the fractional frequency fluctuation y(t) used in the some flicker noise. However, the same issues about bandwidth general literature [23], [24], with the choice of the font as the already discussed in this Section apply, and we expect that one and only difference. flicker is a minor noise effect as compared to white noise. Most concepts are suitable to continuous and the discrete treatise with simplified notation. For example, x = t + x maps D. Motivation for the Linear Regression into xk = tk + xk for sampled data, and into x(t) = t + x(t) The LR finds a straightforward application to the estimation in the continuous case. The notation . and (., .) stands for h i 1 of the frequency ν of a periodic phenomenon sin[φ(t)] from its the average and the scalar product, defined as x = n k xk 1 dφ h i phase φ(t) using the trite relation ν = . It is well known and (x, y) = k xkyk for time series, where n is the number 2π dt 1 P that the LR provides the best estimate νˆ in the presence of of terms in the sum, or as x = T x(t) dt and (x, y) = x(t)y(t) dt,P where T is theh integrationi time in the continuous white noise. The term ‘best’ means that the LR minimizes the R squared residuals. This property matches the need of rejecting case. The span of the sum and the integral will be made precise Rin each case of application. The norm is defined as x = the white phase noise, which is the the main concern in || || counters, as we will see underneath. (x, x). The mathematical expectation and the variance of random variables are denoted by . and . . p E V The problem of the linear regression{ } consists{ in} identifying III.THE LINEAR REGRESSION the optimum value yˆ of the slope η (dummy variable used to A real sinusoidal signal affected by noise can be written as avoid confusion with y) that minimizes the norm of the error φ x ηt. The solution is the random variable v(t) = V0 sin[ (t)] − (x x , t t ) where V0 is the amplitude, ν0 is the nominal frequency, yˆ = − h i − h i . (5) t t 2 and φ(t) is a phase that carries both the ‘ideal time’ and || − h i || randomness. The randomness in φ(t) can be interpreted as The choice of a reference system where the time sequence either a phase fluctuation or a frequency fluctuation is centered at zero, i.e., t = 0, makes the treatise simpler, without loss of generality.h i Accordingly, the estimator yˆ reads 2πν0t + ϕ(t) PM noise representation φ(t) = (x, t) (2πν0t + (∆ν)(t) dt FM noise representation yˆ = . (6) t 2 Of course φ(t) and Rϕ(t) are allowed to exceed π. || || These choice are equivalent because t = 0, so (x x , t) = We prefer to derive the properties of the LR± using the (x, t) x (1, t) = (x, t). h i − h i normalized quantities x(t) and y(t), as in Fig. 2 − h i x(t) = t + x(t) (phase time) (1) y(t) = 1 + y(t) (fractional frequency) (2) E. RUBIOLA &AL.THE Ω COUNTER, A FREQUENCY COUNTER BASED ON THE LINEAR REGRESSION JUNE 17, 2015 4

IV. BASIC STATISTICAL PROPERTIES For even m = 2p, the proof starts with tk = kτ0 for k p, ..., p , ∈ A. Unbiased estimate {− } The LR provides an unbiased estimate of the slope, i.e., p p p t 2 = t2 = τ 2 k2 = 2τ 2 k2 || || k 0 0 E yˆ = 1 (unbiased estimate), k=−p k=−p k=1 { } X X X τ 2 τ 2 even without need that the noise samples (or values) are sta- = 0 p (2p + 1) (p + 1) = 0 m (m + 2) (m + 1) tistically independent. This is seen by replacing the expression 3 12 mτ 2 of the phase for large m. ≈ 12 (x, t) (t + x, t) (x, t) y A similar calculation can be carried out for odd ˆ = 2 = 2 = 1 + 2 m = 2p + 1 t t t 1 || || || || || || with tk = (k + )τ0 for k p 1, ..., p . so 2 ∈ {− − } (E x , t) E yˆ = 1 + { } = 1. D. Continuous input signal { } t 2 || || In the case of input signal continuous over a symmetric time B. Estimator variance interval ( τ , τ ), we get − 2 2 Adding the hypothesis that samples x (or the values x(t)) 12(x, t) k yˆ = 1 + . are independent, then the estimator variance is τ 3 2 2 σx Evidently t = 0, so the first equality results from t = V yˆ = (estimator variance). 3 h i || || { } t 2 τ /12. Moreover, for a white noise x || || 2 This is seen by expanding the variance 12σx V yˆ = . { } τ 2 yˆ = (yˆ yˆ )2 V E E Indeed, replacing yˆ by its expression, { } { 2 − { } 2} = E yˆ E yˆ . { } − { } (x, t) 1 V yˆ = V 1 + = V (x, t) . But { } t 2 t 4 { }  || ||  || || 2 1 2 E (yˆ) = E (t + x, t) But E (x, t) = (E x , t) = 0, so { } t 4 { } { } { } || || 1 2 1 2 2 V yˆ = E (x, t) = E (t, t) + 2(t, t)(x, t) + (x, t) { } t 4 { } t 4 { } || || || || 1 τ/2 τ/2 1 2 x x s = 1 + E (x, t) . = 4 E (t) ( ) ts dt ds. t 4 { } t −τ/2 −τ/2 { } || || || || Z Z 2 Since the random variables xk are independent, then Since E x(t)x(s) = σx δ(t s), { } − (x, t)2 = t t x x σ2 τ/2 σ2 E k ` E k ` y x 2 x { } { } V ˆ = 4 t dt = 2 Xk,` { } t −τ/2 t 2 2 || || Z || || = tk E xk and the conclusion follows. { } k X2 2 = t σ . V. WEIGHTED AVERAGEAND FILTERING || || x We conclude We show that the Omega counter can be described as a 2 2 weighted average or as a filter. The impulse response is derived t 2 σx V yˆ = 1 + || || σx 1 = . from the weight function. { } t 4 − t 2 || || || || A. Weighted measure C. Uniformly spaced time series Let us consider an instrument that measures y(t) averaged In the case of a uniformly spaced data series with a constant on time interval of duration τ. We express the estimate yˆ(t) step τ and with τ = mτ , then for large m it holds that 0 0 available at the time t as the weighted average 12(x, t) yˆ 1 + ≈ mτ 2 yˆ(t) = y(s) w(s t) ds, (8) R − 12σ2 Z y x (7) where w(t) is a suitable weight function which we will identify V ˆ 2 . { } ≈ mτ later in this Section, ruled by w(t) = 0 for t τ, 0 (interval) 6∈ {− } w(t) dt = 1 (normalization). ZR E. RUBIOLA &AL.THE Ω COUNTER, A FREQUENCY COUNTER BASED ON THE LINEAR REGRESSION JUNE 17, 2015 5

wc(t) w(t) h (t) 3 4t2 c 3 4t2 h(t) 1 1 3/2⌧ 2⌧ ⌧ 2 3/2⌧ 2⌧ ⌧ 2  

t ⌧ t ⌧/2 ⌧/2 t t ⌧/2 ⌧/2 w(t)=wc(t + ⌧/2) h (t)=w ( t) h(t)=w( t) ⌧ c c w˜c(t) w˜(t) ˜ ˜ 2 hc(t) 12 h(t) 12 6/⌧ 2 6/⌧ 3 t 3 t ⌧ ⌧ ⌧ t t t t ⌧/2 ⌧/2 ⌧/2 ⌧/2 ⌧ 2 6/⌧ 6/⌧ 2 w˜(t)=w ˜c(t + ⌧/2) h˜ (t)=w ˜ ( t) h˜(t)=w ˜( t) c c Fig. 3. Weight functions of the Ω counter. Fig. 4. Impulse response functions of the Ω counter.

These rules expresses the fact that the integration time has B. Frequency response duration τ ending at the time t, and that the normalization yields a valid average. For the general experimentalist, the noise rejection prop- Eventually, (8) can be seen as a scalar product, or as an erties of the counter are best seen in the frequency domain. y x operator on y, or as a weighted measure as regularly used in The fluctuations (t) and (t) are described in terms of their physics and engineering, or as a measure in the mathematical single-sided power spectral densities (PSD) Sy(f) and Sx(f), measure theory. and the counter as a LTI (linear time-invariant) system which responds with its output fluctuation y . The counter output We first identify a function w˜(t) which satisfies ˆ(t) PSD is 2 yˆ(t) = x(s)w ˜(s t) ds. (9) Sy(f) = H(f) Sy(f) − ˆ | | ZR 2 Sy(f) = H˜ (f) Sx(f), Then, remembering that y(t) = x˙(t) and using the integration ˆ | | by part formula f(t)g0(t) dt = f 0(t)g(t) dt, we find where H(f) 2 and H˜ (f) 2 are the frequency response for − frequency| noise| and| phase| noise, respectively. R t R w(t) = w˜(s) ds. (10) The LTI system theory teaches us that H(f) is the Fourier − Z−∞ transform of the impulse response h(t) Since we prefer the simplified expression (6) for the LR, τ τ H˜ (f) = h˜(t)e−2iπft dt, we work in the ( 2 , 2 ) interval using the centered functions − ZR wc(t) = w(t + τ/2)w ˜c(t) =w ˜(t + τ/2). and so h˜(t) H˜ (f). Notice that↔ a time shift τ introduces a term ±iπτf Replacing with , Eq. (9) gives the estimate at the t t 2 e w˜(t) w˜c(t) → ± 2 time in the Fourier transform, which vanishes in H(f) and t + τ/2 2 | | H˜ (f) . So, we can use the centered version, hc(t) Hc(f) τ/2 and| h˜ |(t) H˜ (f), of the above functions. ↔ yˆ(τ/2) = x(t)w ˜ (t) dt. (11) c c c We start↔ from the time-domain response of the estimator, Z−τ/2 τ τ which results from the convolution integral The LR (Eq. (6)) applied over ( 2 , 2 ) gives − ˆy(t) = y(t) h(t) (x, t) 12 τ/2 ∗ yˆ(τ/2) = = x(t) t dt. (12) 2 3 = y(s) h(t s) ds. t τ −τ/2 − || || Z ZR Comparing (11) and (12), we find A direct comparison of the above to (8) gives h(t) = w( t), hence (Fig. 4) − 12 τ τ w˜c(t) = t for t ( , ), 0 elsewhere, (13) τ 3 ∈ − 2 2 3 4t2 h (t) = 1 for t ( τ , τ ), 0 elsewhere, and, using Eq. (10), c 2τ − τ 2 ∈ − 2 2   2 and 3 4t τ τ wc(t) = 1 for t ( , ), 0 elsewhere. 2τ − τ 2 ∈ − 2 2 ˜ 6i   Hc(f) = 2 2 3 (πfτ cos(πfτ) sin(πfτ)) These functions are plotted in Fig. 3. −π f τ − 36 H (f) 2 = (πfτ cos(πfτ) sin(πfτ))2 . | c | π4f 4τ 6 − e E. RUBIOLA &AL.THE Ω COUNTER, A FREQUENCY COUNTER BASED ON THE LINEAR REGRESSION JUNE 17, 2015 6

end a =ˆ⌫ ✓k stage 1 { } ✓ stage 2 h ki b

✓k

M RAM 1 M U U X RAM 2 X

Fig. 6. Hardware implementation.

consequence, the first stage is mainly devoted to the evaluation of the average and the transfer of the data stream into an external dual-port RAM, the second stage to the calculation of the LR coefficients.

First stage

2 Fig. 5. Frequency response of the Ω counter, plotted for τ = 1 s.. |Hc(f)| 1) Data transfer: The incoming data flow is transferred into ˜ 2 is the response to fractional-frequency noise Sy(f), while |Hc(f)| is the an external RAM at the interpolator sampling rate 1/τ0. In the response to phase-time noise Sx(f). presented design, 1/τ0 is the effective sample rate of the data stream. 2) Accumulation: Assuming θ where each θ is coded In the same way, comparing the convolution integral k k in M bits, the data stream is firstly{ } extended to 2M bits and ˆy(t) = x(t) h˜(t) shifted by a selected amount of gain g = log2(m). This way, ∗ when the accumulation process is done, there is no need to = x(s) h˜(t s) ds − divide the result to obtain the average, by getting rid of the ZR g lower bits. This process preserves the as the to (9) yields h˜(t) =w ˜( t). There follows (Fig. 4) gain satisfies g M. − 6 12 When the average is calculated and the first RAM full, an h˜ (t) = t for t ( τ , τ ), 0 elsewhere (14) c −τ 3 ∈ − 2 2 ‘end’ of process signal and the result are propagated into the second stage. A new process cycle starts with the next data and stream that will be stored in1 the second RAM. Such a cycle 3 lasts obviously τ = mτ0. The second stage is running at the Hc(f) = 3 3 3 (πfτ cos(πfτ) sin(πfτ)) −π f τ − same time, with the same duration τ. Apart from an initial time 2 9 2 lag τ, this mechanism enable to calculate the LR coefficients Hc(f) = 6 6 6 (πfτ cos(πfτ) sin(πfτ)) . | | π f τ − at the rate of 1/τ0 (so with no ): stage 2 is calculating The frequency transfer functions H(f) 2 and H˜ (f) 2 are on the old m data while the first calculates on the newer data. plotted in Fig. 5. | | | | Second stage VI.HARDWARE TECHNIQUES Here the averages are known and the samples collected, the We describe a hardware implementation. Dropping the calculation of the LR parameters are performed within this normalization, the LR estimates the frequency block. m−1 3) Process 1: Differences calculations. The samples are (θk θk )(tk tk ) νˆ = k=0 (15) collected from the RAM and θi θk is calculated. In parallel, m−−1 h i −2 h i −h i (tk tk ) t t are also computed, with t provided by the CPU. P k=0 − h i i − h ki h ki The calculation of ti tk is cost effective compared to the by fitting the phase dataPθk = φk/2π expressed as the fraction − h i of period. RAM resource usage. All the data are latched. It is worth mentioning that timing indexes form a series 4) Process 2: frequency estimation. This process is an asynchronous accumulation (θk θk )(tk tk ). The of known natural terms such that the pre evaluation of tk n { } slope a is obtained by dividing the− preceeding h i − result h i by the and its average tk should be considered. The result of the P average dependsh onim, the number of iterations. With m, some constant denominator term provided by the CPU and stored pre-calculated registers can be transferred into a RAM. into a register, and νˆ is latched. Then, the estimated parameters Fig. 6 shows the block diagram. The algorithm takes two are resized and propagated. steps, represented as ‘stages.’ The reason is that both average and the samples over m are needed at the same time. As a E. RUBIOLA &AL.THE Ω COUNTER, A FREQUENCY COUNTER BASED ON THE LINEAR REGRESSION JUNE 17, 2015 7

TABLE II 2) Λ counter: In the measurement time τ = mτ we take M m #RAM % #DSP48 % 0 m/2 almost-overlapped samples y measured by Π counter a 32 1024 2/140 1.4 4/220 1.8 k 32 215 64/140 45 4/220 1.8 over a time τ/2 64 215 128/140 91.4 13/220 5.9 xm/2+k xk xm/2+k xk yˆk = − = − . mτ0/2 τ/2 The variance associated to each y is Oracle k 2 2σx A testbench of the design requires different data sets to V yˆk = 2 . correctly predict its behavior. For we have implemented a C- { } mτ0 /4 based version code of the design in fixed point arithmetics, 2 (m−1)/2 The Λ estimator gives yˆ = m k=0 yk. Thus, the estima- and equivalent to the GNU-Octave LinearRegression function tor variance is or the Levenberg-Marquardt algorithm (as embedded into P 16σ2 16σ2 Gnuplot for example). y x x (17) V ˆ 3 2 = 3 . { } ≈ m τ0 νsτ A hardware implementation works at a rate of 1/τ0 = 250 MHz. 3) Ω counter: The estimator variance (7) can be rewritten The chip area occupation is only limited by the number in terms of the measurement time τ = mτ0 and the sampling of iterations m which induce high RAM usage with a linear frequency νs = 1/τ0 as follows dependence. m should be carefully chosen, depending on the 2 2 12σx 12σx required resolution/decimation rate and the design complexity. V yˆ = . (18) { } ≈ m3τ 2 ν τ 3 Excessive RAM usage may lead to long propagation time, thus 0 s to potential data corruption. 4) Comparison: Comparing the estimator variance V yˆ as { } For practical reasons, we also estimate the intercept point given by Eq. (16), (17) and (18) we notice that the Π estimator (b in Fig. 6, with b = φk a tk ) leading to a more generic features the poorest rejection to white PM noise, proportional linear regression filterh instantiation.i − h i Table II summarizes some to 1/τ 2. The white PM noise rejection follows the 1/τ 3 law implementation reports on the principal items that are BRAMs for both the Λ and Ω estimators, but the ω estimator is more and DSP48, and their respective occupation for a Zynq-based favorable by a factor of 3/4, i.e., 1.25 dB. However small, system of the Zedboard type. this benefit comes at no expense in term of the complexity of precision electronics. VII.DISCUSSION The sampling frequency νs = 1/τ0 can be equal to the input frequency ν or an integer fraction of, depending on the speed A. Noise Rejection 0 of the interpolator and on the data transfer rate. Values of 1–4 We summarize the noise response of the counters in the MHz are found in commercial equipment. presence of a data series xk uniformly spaced by τ0, or equivalently sampled at the{ frequency} . The mea- νs = 1/τ0 B. Data Decimation surement time is τ = mτ0, The noise samples xk associated We address the question of decimating a stream y (τ) of to xk are statistically independent. { k } The analysis of the Π and Λ counters provided in this contiguous data averaged over τ, in order to get a new stream y (τ) of contiguous data averaged over nτ, preserving the Section is based on [21], [22], with a notation difference { j } concerning the Λ counter. statistical properties of the estimator. In [21], [22], the measurement time spans over 2τ, and two 1) Π counter: Decimation is trivially done by averaging n contiguous measures are overlapped by τ. This choice is driven contiguous data with zero dead time − by the application to the modified Allan variance, having the 1 n 1 same response modσ2(τ) = 1 D2τ 2 to a constant drift D . yˆ(nτ) = yˆ (τ). y 2 y y n k Oppositely, in this article use the same time interval for k=0 τ X all the counters, and we leave the two sample variances to the 2) Λ counter: Decimation can be done only in power of 2 companion article [37]. (n = 2N ), provided that contiguous samples are overlapped 1) Π counter: The estimated fractional frequency is by exactly τ/2. In this case, we apply recursively the formula x − x x − x yˆ = m 1 − 0 = m 1 − 0 . 1 1 1 yˆ(2τ) = yˆ−1(τ) + yˆ0(τ) + yˆ1(τ). mτ0 τ 4 2 4 The associated variance is Notice that the measurement time 2τ is given by the overlap 2 2 between samples. 2σx 2σx V yˆ = = , (16) 3) counter: { } mτ 2 τ 2 Ω An exact decimation formula, as for the 0 Π and Λ counters, does not exist. The reason is that the independent of the sampling frequency. exact parabolic shape has constant second derivative. This is incompatible with the presence of the edges at τ/2 when more than one shifted instances of the w(t) function± are overlapped. E. RUBIOLA &AL.THE Ω COUNTER, A FREQUENCY COUNTER BASED ON THE LINEAR REGRESSION JUNE 17, 2015 8

C. Application to the two-sample variances [11] D. C. Chu, “Phase digitizing: A new method for capturing and analyzing spread-spectrum ,” Hewlett Packard J., vol. 40, no. 2, pp. 28–35, The general form of the two-sample variance reads Feb. 1989. 1 [12] ACAM, http://www.acam.de/products/time-to-digital-converters/. 2 http://www.b-i-inc.com/ V ˆy = E (ˆy1 ˆy2) (19) [13] Brilliant Instruments, . { } 2 − [14] GuideTech http://www.guidetech.com. Using a stream of ‘contiguous’n data ˆy measuredo with a Π, [15] G. Kramer and K. Klitsche, “Multi-channel synchronous digital phase { k} recorder,” in Proceedings of the 2001 IEEE International Frequency a Λ or a Ω estimator, Eq. (19), gives the AVAR, the MVAR or Control Symposium, Seattle (WA), USA, Jun. 2001, pp. 144–151. the PVAR. Notice that in the case of the MVAR, ‘contiguous’ [16] K & K Messtechnik GmbH, St.-Wendel-Str. 12, 38116 Braunschweig, means 50% overlapped. Germany. [17] Keysight Technologies, http://www.keysight.com. [18] Maxim Integrated, http://www.maximintegrated.com/. VIII.CONCLUSIONS [19] SPAD Lab, http://www.everyphotoncounts.com/index.php. [20] Texas Instruments, http://www.ti.com. The same architecture (Fig. 1) is suitable to the Π, Λ and Ω [21] E. Rubiola, “On the measurement of frequency and of its sample estimators, just by replacing the algorithm that processes the variance with high-resolution counters,” Review of Scientific Instruments, vol. 76, no. 054703, May 2005, article no. 054703. phase data. A smart design can implement the three estimators [22] S. T. Dawkins, J. J. McFerran, and A. N. Luiten, “Considerations on the with a some digital-hardware overhead. measurement of the stability of oscillators with frequency counter,” IEEE The Π estimator is the poorest, and mentioned only for Transactions on Ultrasonics, Ferroelectrics, and Frequency Control, vol. 54, no. 5, pp. 918–925, May 2007. completeness. Nonetheless, it is still on the stage when ex- [23] D. W. Allan, “Statistics of atomic frequency standards,” Proceedings of treme simplicity is required, or in niche applications like the the IEEE, vol. 54, no. 2, pp. 222–231, 1966. measurement of the Allan variance. [24] J. A. Barnes, A. R. Chi, L. S. Cutler, D. J. Healey, D. B. Leeson, T. E. McGunigal, J. A. Mullen, Jr, W. L. Smith, R. L. Sydnor, R. F. C. Vessot, In the presence of the same amount of white noise, the Ω and G. M. R. Winkler, “Characterization of frequency stability,” IEEE estimator is similar to the Λ estimator, but features smaller Transact. on Instrum. Meas., vol. 20, no. 2, pp. 105–120, May 1971. variance. The difference is a factor of 3/4 (1.25 dB). [25] J. J. Snyder, “Algorithm for fast digital analysis of interference fringes,” Applied Optics, vol. 19, no. 4, pp. 1223–1225, Apr. 1980. The Λ estimator is a good choice when a clean decimation [26] D. W. Allan and J. A. Barnes, “A modified “Allan variance” with of the output data is mandatory. By contrast, the Ω estimator increased oscillator characterization ability,” in Proc. 35 IFCS, Ft. Mon- is superior for the detection of noise phenomena [37] mouth, NJ, May 1981, pp. 470–474. [27] P. Lesage and T. Ayi, “Characterization of frequency stability: Analysis However may object that a noise reduction of 1.25 dB is of the modified Allan variance and properties of its estimate,” IEEE not a big deal, the value our analysis is in showing that there Transact. on Instrum. Meas., vol. 33, no. 4, pp. 332–336, Dec. 1984. is no room for further improvement. [28] S. Johansson, “New frequency counting principle improves resolution,” in Proc. Freq. Control Symp., Vancouver, BC, Canada, Aug. 29–31, If complexity is the major issue, the Λ estimator fits, at the 2005, pp. 628–635. cost of 1.25 dB higher noise. Oppositely, if the ultimate noise [29] E. Benkler, C. Lisdat, and U. Sterr, “On the relation between performance in the presence of wideband noise is an issue, uncertainties of weighted frequency averages and the various types of Allan deviations,” arXiv:1504.00466, April 2015. [Online]. Available: the Ω estimator is the right answer. The complexity of the LR http://arxiv.org/pdf/1504.00466v3.pdf is likely to be affordable on FPGA or SoC electronics. [30] C. A. Greenhall, “A method for using time interval counters to measure frequency stability,” IEEE Trans. Ultras. Ferroelec. Freq. Contr., vol. 36, no. 5, pp. 478–480, Sep. 1989. ACKNOWLEDGEMENTS [31] ——, “The third-difference approach to modified Allan variance,” IEEE This work is supported by the ANR Programme d’Inve- Transact. on Instrum. Meas., vol. 46, no. 3, pp. 696–703, Jun. 1997. [32] F. Vernotte and E. Lantz, “Metrology and 1/ f noise: linear stissement d’Avenir in progress at the Time and Frequency regressions and confidence intervals in flicker noise context,” Departments of FEMTO-ST Institute and UTINAM (Oscillator Metrologia, vol. 52, no. 2, pp. 222–237, 2015. [Online]. Available: IMP, First-TF and Refimeve+), and by the Region´ de Franche- http://stacks.iop.org/0026-1394/52/i=2/a=222 [33] Altera Corp., USA, http://altera.com/. Comte.´ [34] C. E. Calosso and E. Rubiola, “Phase noise and jitter in digital electronic components (invited article),” in Proc. Int’l Freq. Control Symp., Taipei, REFERENCES Taiwan, May 19–22, 2014, pp. 532–534. [35] Xilinx, http://www.xilinx.com. [1] Ericsson, “GC10B Dekatron counter tube,” The data sheet is no longer [36] E. Rubiola, A. Del Casale, and A. De Marchi, “Noise induced time available, circa 1955, See https://en.wikipedia.org/wiki/Dekatron and interval biases,” in Proc. Int’l Freq. Control Symp., Hershey, PA, USA, http://www.electricstuff.co.uk/count.html#deka. May 27–29, 1992, pp. 265–269. [2] S. Henzler, Time-to-Digital Converters. Springer, 2010. [37] F. Vernotte, M. Lenczner, P.-Y. Bourgeois, and E. Rubiola, “The [3] S. Yoder, M. Ismail, and W. Khalil, VCO-Based Quantizers Using parabolic variance (pvar), a wavelet variance based on least-square fit,” Frequency-to-Digital and Time-to-Digital Converters. Springer, 2011. arXiv:1506.00687 [physics.data-an], Jun. 1, 2015, Submitted to IEEE [4] J. Kalisz, “Review of methods for time interval measurements with Transact UFFC, Special Issue on the 50th Anniversary of the Allan picosecond resolution,” Metrologia, vol. 41, pp. 17–32, 2004. Variance. [5] R. Nutt, “Digital time intervalometer,” Rev. Sci. Instrum., vol. 39, no. 9, pp. 1342–1345, Sep. 1968. [6] R. Nutt, K. Milam, and C. W. Williams, “Digital intervalometer,” U. S. Patent no. 3,983,481, Sep. 28, 1976. [7] C. Cottini and E. Gatti, “Millimicrosecond time analyzer,” Nuovo Cimento, vol. 4, p. 1550, 1956. [8] C. Cottini, E. Gatti, and G. Giannelli, “Millimicrosecond time analyzer,” Nuovo Cimento, vol. 4, p. 156, 1956. [9] H. W. Lefevre, The Vernier Chronotron. Chicago, IL, USA: Univ. of Michigan Library, Jan. 1, 1957. [10] P. J. Kindlmann and J. Sunderland, “Phase stabilized vernier chronotron,” Rev. Sci. Instrum., vol. 37, no. 4, pp. 445–452, Apr. 1966.