{'fraction_non_alphanumeric': 0.038492537728245464, 'fraction_numerical': 0.011033601067229927, 'mean_word_length': 4.351279000594884, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Dynamic Signal Measurements Based on Quantized Data

The estimation of the parameters of a dynamic signal, such as a sine wave, based on quantized data is customarily performed using the least-square estimator (LSE), such as the sine fit. However, the characteristics of the experiments and the measurement setup hardly satisfy the requirements ensuring the LSE to be optimal in the minimum mean-square-error sense. This occurs if the input signal is characterized by a large signal-to-noise ratio resulting in the deterministic component of the quantization error dominating the random error component and when the ADC transition levels are not uniformly distributed over the quantizer input range. In this paper, it is first shown that the LSE applied to quantized data does not perform as expected when the quantizer is not uniform. Then, an estimator is introduced that overcomes these limitations. It uses the values of the transition levels so that a prior quantizer calibration phase is necessary. The estimator properties are analyzed and both numerical and experimental results are described to illustrate its performance. It is shown that the described estimator outperforms the LSE and it also provides an estimate of the probability distribution function of the noise before quantization.


I. INTRODUCTION
When measuring the parameters of a noisy signal using quantized data, often the least-square estimator (LSE) is used. Accordingly, the parameters of the input signal are estimated by choosing those values minimizing the squared error between the input and quantizer output signals. This is the case, for instance, when an analog-to-digital converter (ADC) or a waveform digitizer is tested using the procedures described in [1], [2]. The LSE is known to be optimal under Gaussian experimental conditions. However, this is rarely the case when data are quantized by a memoryless ADC, unless the input signal is characterized by a low signal-to-noise ratio (SNR).
Moreover, even if the transition levels in the used quantizer are uniformly distributed over the ADC input range, the LSE is known to be biased [3], [4], [5] and sensitive to influence factors such as harmonic distortion and noise [6]. Modifications of the original algorithm that overcome some of these limitations were proposed in [7]. In practice, however, transition levels are not uniformly distributed in an ADC and the LSE or its modified versions produce suboptimal results.
If the values of the ADC transition levels are known, the input signal parameters can be estimated with better accuracy than the LSE. This knowledge is used for instance by maximum-likelihood estimators applied to quantized data [8], whose main limitation is the 'curse of dimensionality' [9]. Moreover, they rely on numerical calculations that may result in suboptimal estimates due to local minima in the cost function. Alternative estimators based on sine wave test signals were recently published in [10] to measure specifically the SNR in an ADC, showing the ongoing interest of the instrumentation and measurement community to this topic.
Several results are published about estimators using categorical data as those output by ADCs. A general discussion within a statistical framework can be found in [11], where the usage of link functions applied to ordinal data is described. References [12], [13] contain an extensive description of estimators applied to quantized data and of their asymptotic properties, mainly in the context of system identification and control. In [14], a maximum-likelihood estimator is proposed for static testing of ADCs using link functions.
By extending the results presented in [15] this paper introduces an estimator of the parameters of a signal quantized by a noisy ADC denominated Quantile-Based-Estimator (QBE). The main idea is that an ADC can first be calibrated by measuring its transition levels and then used to measure the input signal and noise parameters.
When compared to the LSE that is customarily used for the estimation of sine wave parameters based on quantized data, it offers several advantages: a reduced bias when the signal-tonoise ratio is large and a reduced mean-square-error (MSE) when the ADC is not uniform. Moreover, it also provides an estimate of the input noise standard deviation and of its cumulative (CDF) and probability density functions (PDF). Estimates are obtained by matrix operations so that the curse of dimensionality issue is avoided. The QBE operates both when the input signal frequency is known or unknown and with or without synchronization between signal and sampling frequencies. Thus, it advances results presented in [15], where a similar estimator was applied only in the case of known synchronized signal and sampling frequencies. While results can be used in the context of ADC testing the estimator is applicable whenever parametric signal identification based on quantized data is needed. At first, a motivating example is illustrated. Then, the estimator is described and its properties analyzed through both simulation and experimental results.

II. RESEARCH MOTIVATION
Processing of samples converted using non-uniform quantizers requires usage of suitable procedures to extract the maximum possible information from quantized data, as illustrated in the following subsections.  Fig. 2. Magnitude of the relative error in the estimation of the amplitude of a cosinusoidal sequence, based on a LSE following the signal chain described in Fig. 1, when the quantizer is both uniform (filled circles) and non-uniform (squares). The inset shows the ratio between the magnitudes of the mean estimation errors.
A. An example To show the effect of a non-uniform distribution of transition levels in an ADC when estimating the amplitude A of a cosine signal by means of the LSE, consider the sequence x n = A cos (2πλ n ) λ n = 10 n N , n = 0, . . . , N −1 (1) where 0 < A ≤ 1 and N is the number of collected samples. Further, assume that the sequence is affected by zero-mean additive Gaussian noise with standard deviation σ = 0.3∆, where ∆ = 2 /2 b and b is the number of quantizer bits. By processing the noisy data sequence after the application of a rounding b-bit quantizer, A is estimated through an LSE when the quantizer is both uniform and non-uniform. In this latter case, transition levels are assumed displaced by their nominal position, each by a random variable uniformly distributed in [−0.45∆, 0.45∆] to introduce integral nonlinearity (INL) while maintaining monotonicity of the input/output characteristic. Both signal chains are shown in Fig. 1. The relative absolute errors e U and e N in the uniform and non-uniform cases, respectively, are considered as estimation quality criteria. Results obtained by simulating the signal chains shown in Fig. 1 with A = 2 b−2 ∆ + ∆ /2 and by collecting 100 records of N = 10 4 samples each, are shown in Fig. 2 using a semilogarithmic scale. The inset shows the ratio between the magnitudes of the estimation errors in the nonuniform and uniform case, respectively. Observe that the INL always results in worse performance and in a ratio between the magnitudes of the mean errors as large as 29. This is not surprising, as INL destroys the otherwise periodic behavior of the quantization error input-output characteristic and because its effects are only marginally attenuated by the addition of noise.
B. An improved approach The loss in estimation performance highlighted in Fig. 2 arises because the LSE processes the quantizer output codes corresponding to a specific quantization bin. However, while the bin width is constant in a uniform quantizer, it changes from bin to bin in a non-uniform quantizer, resulting in the socalled differential nonlinearity (DNL). Processing data in the code domain does not acknowledge this difference, as codes already embed the associated errors. Consequently, information loss is expected. As an alternative, data can be processed in the amplitude domain so to avoid usage of quantizer codes. This approach is feasible if the values of the transition levels in the used quantizer are known or, equivalently, are measured before ADC usage. Observe that knowledge of transition levels allows usage of maximum-likelihood estimators as in [8]. However, this may result in a high computational load and in the need to neglect suboptimal solutions, when numerically maximizing the likelihood function. Instead, the described technique is based on matrix computation and does not require iterated numerical evaluations, when the input signal frequency is known. By using results published in [16] it will be shown that this procedure also provides an estimate of the input noise standard deviation and of its CDF.

III. QUANTILE-BASED ESTIMATION
The main idea of quantile-based estimation was described in [15] and it is here exemplified to ease interpretation of mathematical derivations.

A. The estimator working principle
Assume that the measurement problem consists in the estimation of an unknown constant value µ, affected by zeromean additive Gaussian noise with known standard deviation σ. Consider also the case in which the noisy input is quantized repeatedly by a comparator with known threshold T 0 that outputs 0 and 1, if the input is below or above T 0 , respectively. By repeating the experiment several times, the probability of collecting samples with amplitude lower than the threshold can be estimated by the percentage countp 0 of the number of times 0 is observed. This probability can be written as: where Φ(·) is the CDF of a standard Gaussian random variable. Thus, by inverting (2) and substitutingp 0 for p 0 , we obtain the estimateμ of µ aŝ where all the rightmost terms are known. Similar arguments can be invoked to solve estimation problems when the quantizer is multi-bit, when the input sequence is time-varying, it is synchronously or asynchronously sampled and when removing the hypotheses about knowledge of the noise standard deviation.
To illustrate the estimation of the amplitude of a timevarying signal based on noisy quantized samples, consider the periodic signal shown in Fig. 3. Synchronous sampling of  Fig. 4. Here, for every k and every threshold T k , 7 such probabilities can, in principle, be estimated. this signal provides the periodic sequence graphed in Fig. 3 using dots. By suitably selecting samples within this sequence, data can be thought as if they were obtained through the sampling of 7 constant values, graphed in Fig. 3 using dashed lines. The amplitude of the original signal affects the relative distance among these constant values. Then, a mathematical model, similar to (2), is used to relate the unknown signal amplitude to the values taken by the sampled data. Once code occurrence probabilities are estimated using the quantizer output sequence, knowledge of this model and its inversion, result in the estimation of the amplitudes of the constant sequences shown in Fig. 3 and of the overall signal, as in (3). In the following subsections this procedure will be explained in more depth. Accordingly, the next section introduces the signal and system models used in the estimation procedure.

B. Signals and Systems
For n = 0, . . . , N − 1 we assume: where x[n] is a discrete-time sequence obtained by sampling a periodic continuous-time signal, S[n] represents a vector of known discrete-time values s 0 [n], . . . , s M −1 [n], and η[·] is a sequence of independent and identically distributed zero-mean Gaussian random variables, having standard deviation σ. In (4), Θ represents the vector of unknown parameters, Q(·) represents the quantization operation and e[·] the associated quantization error sequence. Quantization results in x q [n] taking one of the K possible ordered quantization codes Q k−1 , k ∈ K = {1, . . . , K}, if the quantizer input belongs to the interval [T k−1 , T k ), where T k represents the k-th quantizer transition level. In practice, x[n] is measured in volt, while x q [n] is coded by the ADC, according to the choice made by the producer (e.g. binary, decimal).
To exemplify the use of the signal model (4), consider the case described in subsection A. Accordingly, M = 1, s 0 [n] ≡ 1, the output of the comparator Q(·) can be either 0 or 1, based on the value of the unique threshold level T 0 and N still represents the number of observed and processed samples. Similarly, (4) models (1) by assuming M = 1, θ 0 = A and S[n] = s 0 [n] = cos 2π · 10 n N , obtained by sampling synchronously the signal cos (2πf t), where f is the signal frequency.
Finally, the case shown in Fig. 3 is modeled by assuming M = 2 and the sampled sequence x[n] = θ 0 s 0 [n] + θ 1 s 1 [n], n = 0, . . . , 23, where θ 0 , θ 1 represent the two unknown amplitudes to be estimated and two known sequences, with x representing the fractional part of x.
Observe that, in general, x[n] is itself a periodic sequence if sampling is done synchronously, that is the ratio between the signal frequency and sampling rate is a rational number, and aperiodic otherwise.

C. Extension to multi-bit quantizers
The approach described in subsection A, based on a single threshold T 0 , can be extended to comprehend both the multithreshold case that applies when using multi-bit quantizers and the case when the input signal is time-varying. The first example in subsection III-A was related to a constant input signal resulting in a constant probability to be estimated, as shown by (2). When the input signal is time-dependent the probabilities to be estimated are no longer constant, but timedependent as well. This is indicated in the following by using the symbol p k [n] = P (x q [n] ≤ Q k−1 ). Then, for k ∈ K and n = 0, . . . , N − 1 one can write is available, such that 0 < p k [n] < 1, (6) can be inverted according to whether σ is known or unknown. If σ is known, from (6) we have: that is, for k ∈ K and n = 0, . . . , N − 1 If σ is unknown, it must be estimated using the quantized data, so that from (7) we have: that, for k ∈ K and n = 0, . . . , N − 1 results in Fig. 4. Estimation of the probabilities p k [m]: for a given subset of indices {n−1, n}, x[n] takes the same value x n−1 = xn and the shaded probability can be estimated by counting the number of times the code is less than or equal to Q k and dividing by 2. Observe that in this very simple case the only possibility for p k [m] not to be equal to 0 or 1, is when the number of counts is equal to 1. The other two cases would be discarded by the algorithm as Notice that if an estimateΘ U of Θ U is available, the scalar parameters θ 0 , . . . , θ M can be recovered by means of simple transformations of the elements inΘ U . The noise standard deviation σ = θ M can be estimated by inverting the rightmost element inΘ U and by changing its sign. Estimates of θ 0 , . . . , θ M −1 are obtained by multiplying the M leftmost elements inΘ U by the obtained value of θ M .

D. The derivation of the proposed estimator
Expressions (8) and (10) show a linear relationship between the vector of unknown parameters and the estimated probabilityp k [n], suitably transformed by the so-called link function Φ −1 (·) [11], [12]. Observe that, in principle, K · N such relationships are available. In practice, however, the number is much lower for two reasons: 1) the application of the link function requires the inversion of Φ(p k [n]) that is unfeasible if the estimated probability is equal to 0 or 1. When this occurs, data are discarded; 2) for a given T k , the estimation of a probability requires a percentage count of the codes that result in the noisy input signal being below or equal to T k . This would require the input signal x[n] to remain constant over n, while several such codes are collected. Since this is unfeasible when the signal is time-varying unless the input sequence is largely oversampled, there is the need to identify subsets of time indices n approximately providing the same value of x[n]. Accordingly, the N time indices are partitioned into subsets associated with values of x[n] having close magnitude. Consequently, the estimation of a single probability requires usage of several input samples resulting in a number of estimates that for a given k ∈ K is lower than N . The partitioning mechanism will be presented in the next subsection.

E. Estimation of probabilities p k [n]
The determination and inversion of the measurement model as in (3) and in (10) require knowledge of probabilities p k [n], as defined in (3). In general, if x[n] is obtained by sampling a periodic signal x P (t) with period T , one obtains x[n] = x P (nT s ) = x P nT S T T . Synchronous sampling applies if T S /T is a rational number resulting in a periodic sequence x[n]. When T S /T is irrational, sampling is asynchronous and x[n] is no longer a periodic sequence. The two cases are treated separately in the following.
1) Synchronous sampling (rational Ts /T ): T , results, where mod is the remainder operator. It is of interest to analyze the image of the map I L = (nL mod N ) when n = 0, . . . , N − 1. By the theorem 2.5 in [17], this image consists of the N /d integers where d is the greatest common divider of L and N . By this argument, x[n] can only take the values which may not be all unique, and x[n] becomes a periodic sequence with period given by Then, for any given k identifying the selected threshold and for every m = 0, . . . , |P| − 1, where |P| represents the cardinality of the partition, the samples belonging to each subset P m in the partition P describe the same event and a counter can be updated with 1 or 0 according to whether or not the quantizer output is less than or equal to Q k , as defined in (6). Thus, for a given and known threshold T k , p k [m], m = 0, . . . , |P| − 1 can be estimated by the percentage count accumulated over those indices in P m providing the same quantizer input x[n]. Even though the exact value of x[n] is not known by the user, as it depends on the unknown parameter values, if the same argument t of x P (t) repeats over time, so does its sampled version x[n]. Thus, by matching the time instants corresponding to the same value of x P (t), an estimate p k [m] can be obtained for every k. This is exemplified in Fig. 4, where a sinusoidal signal x P (t) is assumed and the probability to be estimated is shaded. In this figure, the values of 3 transition levels are shown using dashed lines and the corresponding quantizer codes are indicated as Q k−1 , Q k and Q k+1 . Results on the application of synchronous sampling to the estimation of the parameters of a sinusoidal function are published in [15].
2) Asynchronous sampling (irrational Ts /T ): In practice, synchronization requires the careful setup of the experiments since disturbing mechanisms may occur. For instance, basic bench top equipment used to generate signals is affected by frequency drifts over time that can not easily be compensated for. Similarly, the used ADC may sample inputs with a sampling period that may vary over time and that may not be controlled directly by the user or disciplined by external stable sources such as cesium or rubidium frequency standards. As a consequence, the ratio between sampling and signal periods is more properly assumed as where λ is an irrational number and becomes an aperiodic sequence. This case is graphed in Fig. 5, where 3 periods of an asynchronously sampled periodic signal x P (t) are shown, when N = 24 and λ = 0.1245 · · · . Reference dashed lines show the progressive deviations from synchronicity when the time index increases. Contrary to the rational case, since the map I λ = nλ has no periodic orbits, when n = 0, . . . , N − 1, no two equal values of the argument of x P (t) in (14) can be found.
Remind that probabilities p k [m] can be estimated only when the same value of x[n] is input to the ADC. However, when λ is irrational, x[n] provides only approximately equal values for selected indices n. Accordingly, by choosing a small value > 0, the image of I λ can be explored to find those indices n for which I λ returns values that differ at most by . If the sequences in S[n] have bounded derivatives, small deviations in their arguments will result in bounded variations of their amplitudes and the estimation will occur as if synchronous sampling was adopted. The main idea is that by selecting arguments for x P (t) in (14) that are close to each other, x P (t) will result in samples with similar values, at the same time. Thus, the estimation procedure can be described by the following steps: 1) the interval [0, 1) is partitioned into adjacent subintervals, each of length > 0; 2) each subinterval is associated with that particular set of indices n for which I λ returns values belonging to that interval. The collection of these sets represents a partition P of the whole set of integers n = 0, . . . , N −1; 3) for every subset P m in this partition, a new vector  (8) and (10). Corresponding estimates of p k [m] are obtained by accumulating counts when these indices occur. The asynchronous case is exemplified in Fig. 5. Assuming N = 24 and λ = 0.1245 · · · , the sampled sequence can be modeled as: x[n] = θ 0 arccos (cos (2π nλ )) +θ 1 sin (4π nλ ) , Using the notation defined in (4) is estimated using the data, as shown above. Once all indices (k, m) in S are considered, the linear system results. Observe that, by construction, the number of rows in H and Y is a random variable as S contains a random number of entries. Then, if the number of rows in H is not lower than the number of unknown parameters, an estimate of Θ can be obtained by applying a least-square estimator as follows: Similarly when σ is unknown, for each couple of indices (k, m) in S • a matrix H U can be constructed by adding entries containing the vector S[m] − T k or S[m] − T k , in the case of synchronous or asynchronous sampling respectively; • a column vector Y U is created, whose entries are the corresponding values −Φ −1 (p k [m]).

The linear system
results, where H U and Y U have again a random number of rows. Finally, Θ U can be recovered by a least-square approach as follows: Observe that several techniques can be applied to find an estimator of Θ and Θ U , starting from (18) and (20), respectively. As an example, by estimating the covariance matrix associated with available data, a weighted least-square estimator can be applied, as done in [15]. In this paper, the simplest possible approach based on the application of the least-square solution is taken. Finally, observe that the procedure described in this subsection can be applied irrespective of the rationality or irrationality of the ratio Ts /T . In the former case and for sufficiently small values of , it will provide the same set of indices that the user would select by following the indications in section III-E1.

IV. A NEW Sine Fit PROCEDURE
Fitting the parameters of a sine wave to a sequence of quantized data is a common problem when testing systems, e.g. ADCs or other nonlinear and linear systems. The LSE is the technique adopted in this case. However, this estimator is known: • to be a biased, not necessarily asymptotically unbiased, estimator [3]; • to perform poorly when the resolution of the quantizer is low, e.g. 4-5 bits, and the added noise has a small standard deviation so that the ADC can hardly be considered as a linear system adding white Gaussian noise.
It will be shown in this section how to use the QBE to obtain an alternative estimator that outperforms the LSE with respect to both bias and MSE and both when the sine wave frequency is known and unknown. The general case of an irrational value of λ = Ts T is treated in the following since it also includes the case when Ts T is rational. The further general assumption of σ unknown is considered. Two further cases apply: when λ is known or unknown to the user, so that an equivalent formulation of the 3or 4-parameter sine fit is obtained, respectively [1].

A. Known Frequency Ratio λ
This is the case when the input signal can be modeled as: and the scalar −Φ (p k [m]) is added to the column vector Y U . In (23), N m represents the cardinality of P m . Once all couples in (k, m) are considered, an estimate of Θ U is found through (21), from which estimates of θ i , i = 0, . . . , 3 can straightforwardly be derived.

B. Unknown Frequency Ratio λ
Often, the user is unaware of the exact value of the ratio between signal frequency and sampling rate. When this occurs, an iterative approach applies [1]: • λ is initially guessed, e.g. using the procedure described in [18], [19]; • using this value of λ, Θ U is estimated following the procedure described in section III and the MSE is evaluated; • the frequency estimate is updated, e.g. by following the golden section search algorithm, with the MSE as the goodness-of-fit criterion [20]; • the magnitude of the deviation in the frequency values from one update to the following is chosen as the stopping rule: if it is below a user given value γ, the procedure is stopped. As it happens when the LSE is applied iteratively, this procedure converges if the initial frequency guess is within a given frequency capture range. The initial guess provided by the discrete-Fourier-transform of quantized data, as suggested in [18], [19], proved to be sufficiently accurate in the cases illustrated in the following sections.

V. PRACTICAL IMPLEMENTATION ISSUES
The practical implementation of the QBE algorithm shows that setting parameters and interpreting results require some caution. In fact: based on a percentage of the total number of samples satisfying a given rule, is an unbiased estimator of the underlying unknown probability [22], the application of the nonlinear function results in a biased but asymptotically unbiased estimator. Three approaches are possible: a lower bound is set to discard estimates based on small size samples; the bias can be estimated and partially corrected for, e.g., by expanding the nonlinear function using a Taylor series about the expected value p k [m] of p k [m]; the bias magnitude can be bounded. In this latter case, the bias can be expected to be more severe when p k [m] is close to 0 and 1, that is where Φ −1 (·) has two vertical asymptotes and exhibits a strong nonlinear behavior. Thus, to reduce the bias in estimating Φ −1 (p k [m]), guard intervals can be set, so that data are processed by the algorithm only if, e.g. 0.05 <p k [m] < 0.95.

VI. VALIDATING THE ASSUMPTION ON THE NOISE PDF
The QBE is based on the assumption that the noise CDF is known, as the inverse of this function represents the link function needed to apply the main estimator equation (7). This assumption can be tested by estimating the input noise CDF and PDF by following the procedure described in [16]. Accordingly, if the transition levels in the ADC, are known, as well as the input sequence x[n], a pointwise estimate of the noise CDF for any available estimatep k [m], is provided by: In addition, normalization by the estimated standard deviation σ, provides an estimate of the CDF of the normalized random variable η = η /σ.
To validate the initial assumption about the noise CDF, estimates provided by (25) or (26) can be interpolated and compared to the assumed noise CDF, e.g. Φ(·). Then, the corresponding PDF can be estimated by differentiation. Observe that the LSE provides an error sequence obtained as the difference between the estimated signal at the ADC input and the measured signal at the ADC output. However, the histogram of such error samples would not estimate the PDF of the noise at the quantizer input, since the error sequence also contains the error contributions due to quantization. This is not the case with the estimator (25) that is only marginally affected by signal quantization.

VII. SIMULATION RESULTS
The QBE estimator was coded in C and simulated on a personal computer using the Monte Carlo approach. The practical case of estimating the parameters of a sine wave was considered after modeling the signal as in (22). Results obtained using the QBE under the assumption of known and unknown signal frequencies and known uniformly and nonuniformly distributed transition levels are compared in the following with results obtained using the sine fit estimation method based on the LSE [1]. In all cases the noise standard deviation was assumed unknown, λ was set to 0.1155545 · · · and = 0.0011 was assumed. As a performance criterion, the root-mean-square error (RMSE) based on R records of N samples was considered. This was defined as: where e DC and e AC represent the errors in estimating the DC and AC signal components with respect to the known simulated values.

A. Known Frequency Ratio λ
If both the sine wave frequency and the ADC sampling rate are known, so is the ratio Ts T and both QBE and the 3parameter sine fit, can be applied as described. Accordingly, simulations were done assuming an 8-bit ADC, R = 100  Fig. 6(a) refer to the case of a uniform ADC, graphs in Fig. 6(b) are associated with a non-uniform ADC, based on a resistor ladder [21]. Distribution of resistance values following a Gaussian distribution resulted in a maximum absolute INL of 0.215∆. It can be observed that: • for a given value of σ, when N increases, the RMSE shows an overall decrease, as expected; • when σ/∆ is small, the RMSE associated with the LSE is dominated by the estimator bias, rather than by its variance: in fact, by increasing N , the corresponding RMSE does not change in the left part of the graph (solid lines). This means that the contribution of the estimation variance to the RMSE, that depends on N , is negligible with respect to the bias and that the bias does not vanish when N increases, as expected [3]; • the RMSE associated with QBE is largely independent of the ADC being uniform or non-uniform since it only uses information about threshold levels, irrespective of their distribution over the input range. Conversely, since the LSE processes code values, departure from uniformity in the distribution of the transition levels results in an overall worse performance, as shown by comparing data in Fig. 6(a) to data in Fig. 6(b). This latter figure shows that the RMSE in the case of the LSE (solid lines), is dominated by estimation bias rather than estimation variance, since all curves collapse, irrespective of the number of processed samples. The QBE relies on the knowledge of the ADC transition levels that are known, in practice, only through measurement results affected by uncertainty. To show the robustness of the QBE with respect to this aspect, a simulation was done by assuming the transition levels known up to a random deviation uniformly distributed in the interval [−0.2∆, 0.2∆]. The same data used to produce graphs in Fig. 6(b) was used under the same simulated conditions. Results are shown in Fig. 6(c), which displays an increase of the RMSE evident for small values of σ, but also that the QBE still outperforms the LSE when INL affects the quantizer.

B. Unknown Frequency Ratio λ
If either or both signal frequency and sampling rate are unknown, so is the ratio Ts T . In this case, the procedure described in subsection IV-B applies. After a rough estimation of λ based on the discrete Fourier transform of the simulated data, the estimation procedure is applied iteratively to find the minimum of the experimental mean-square-error, defined as: through the golden section search algorithm [20]. Here θ 0 , θ 1 , and θ 2 represent the sine, cosine and dc components, respectively, as defined in (22), while θ 3 represents the unknown noise standard deviation. The resulting RMSE is shown in Fig. 7(a) and (b) in the case of a uniform and non-uniform ADC, respectively. Same simulated conditions as in subsection VII-A were applied in this case, but with R = 30. Although the frequency was not assumed as being known in advance, results shown in Fig. 7 are comparable to those graphed in Fig. 6.

VIII. EXPERIMENTAL RESULTS
The measurement setup shown in Fig. 8 was used to first measure the ADC transition levels and then to perform measurements to estimate the sine wave parameters, the noise standard deviation and its CDF. It included a rubidium frequency standard used to control a waveform synthesizer. The generated signal was acquired both by a USB connected 16-bit DAQ (U2351) by Keysight Technologies and by a 6 1 /2 digit DMM, whose results were taken as reference values. The voltage divider was used to reduce the range of values generated by the waveform synthesizer by a factor approximately equal to 30. The exact attenuation factor was not needed because all voltages were also measured by the reference instrument.
The DAQ transition levels were first measured in the code interval [−100, 100], using a software implementation of the servo-loop technique [1]. Measured values were fitted using linear interpolation to remove gain and offset errors and to obtain the integral nonlinearity shown in Fig. 9, after normalization to the DAQ quantization step ∆ = 20 /2 16 V. The synthesizer was programmed to generate a sine wave with nominal frequency 500 Hz, sampled by the DAQ at 500 kSample/s in the [−10, 10] V input range. The procedure processed 10 sine wave amplitudes in the range [1.042∆, 64.803∆]. For each amplitude, N = 1.5 · 10 5 samples were collected and processed by QBE and LSE iteratively. The DMM was programmed to measure each time the AC and DC signal components in average mode. These values were taken as the true values of the sine wave parameters and (27) was then applied to evaluate the RMSE. This figure is graphed in Fig. 10 for both estimator, as a function of the AC signal component. Data show that QBE outperforms the LSE. In fact, contrary to QBE, the solution provided by LSE ignores the effect of INL on measured data.
QBE also provided an estimate of the noise standard deviation and of the noise CDF. Estimates of the noise standard deviation were obtained for each one of the 10 datasets collected by varying the sine wave amplitude. The estimated mean value and standard deviation of these 10 estimates were 0.800∆ and about 0.004∆, respectively. Thus, stable and repeatable results were obtained.
The estimated CDF associated with the noise sequence normalized to the standard deviation is plotted in Fig. 11 along with a fitted CDF of the standard Gaussian CDF. The good match between the points and the fitted curve validates both the assumption of the noise distribution and the correctness of the adopted approach. Notice that the choice of the guard intervals [0, 0.05] and [0.95, 1] used for discarding selected data, resulted in an estimate of the noise CDF that is truncated in the bottom and upper parts of the graph.   provide new ADC architectures exhibiting increasing performance, devices are not characterized by uniformly distributed transition levels. If not compensated, this non-ideal behavior results in biases and distortions in the estimated quantities.

IX. CONCLUSION
In this paper, we proposed a new estimator that uses information about the values of the ADC transition levels to improve the performance of conventional estimators. The estimator is based on the knowledge of the ADC transition levels, so that an initial calibration phase is necessary before actual parameter estimation. Theoretical, simulated and experimental results show that the proposed technique outperforms typically used estimators such as the sine fit, both when the input signal frequency is known and unknown. As an additional benefit, also the ADC input noise standard deviation and the noise cumulative distribution function are estimated. Finally, while results are presented mainly in the context of the estimation of the parameters of a sine wave, this procedure can be applied whenever a bounded periodic signal is acquired and processed.