CORRECTION OF STATIC ERRORS IN AN A/D-CONVERTER

Abstract: An analog-to-digital converter (ADC) has a histogram based correction of static errors. In a control and calculating unit (23) of the converter thus the counts of uncorrected digital output codes are stored in a memory (51). From the stored counts a model distribution is determined in a calculation unit, e.g. by estimating an expected gaussian distribution. The model distribution is compared to the measured counts and relative errors of the counts are calculated, the relative errors indicating errors in coarse reference levels. The errors are used for calculating correction terms (L(A)) stored in a correction table (47). The correction terms are used by an output calculating unit (43') to calculate corrected, more accurate output codes. For a parallel ADC device having several cells, the histograms in the cells can be used to correct for gain and offset errors. Also, the histogram can be used in a built-in self test. A reference level generator can be only partially common to the cells in a parallel ADC providing accurate coarse levels without cross-talk.

Description: CORRECTION OF STATIC ERRORS IN AN A/D-CONVERTER TECHNICAL FIELD The present invention relates to correction of static errors in analog-to-digital converters using successive approximation procedures and to analog-to-digital converters, in particular to 5 analog-to-digital converters having built-in error correction. BACKGROUND AND STATE OF THE ART In wireless communication equipment incoming signals often have to be converted to a digital shape. Also, digital signals to be issued from the equipment often have to be converted to an analog shape. A schematic of a typical simple circuit used in such communication is ιo illustrated in Fig. 1. An analog-to-digital converter (ADC) 1 is connected to an incoming line 5 and delivers digital data to a signal processor 9 which communicates with user circuits, not shown, to forward information thereto. In actual embodiments the ADC has a transfer function which always includes errors. The errors result in a degraded performance in terms of signal-to-noise ratio (SNR) and spurious free dynamic range (SFDR). In a typical i5 application, the incoming line 5 is connected to some device 8 for radio frequency receiving which receives signals from an antenna 10. Errors of one kind existing in the converting operation in an ADC are called static and are defined to be those errors which do not depend on the actual input signal to the ADC. These errors are approximately stable in time or change very slowly and will hereinafter be 2 o assumed to be permanent or constant in time. A typical example comprises matching properties. The ADCs considered herein use a successive approximation procedure and are called SA-ADCs. Furthermore, they use binary search and subranging and in the subranging step redundant code is used, see Jan-Erik Eklund, "A/D conversion for sensor systems", Thesis, 2 5 Linkόpings Universitet, 1998, Jiren Yuan, Christer Svensson, "A 10-bit 5-MS/s Successive Approximation ADC Cell Used in a 70-MS/s ADC Array in 1.2 μm CMOS", IEEE Journal of Solid State Circuits, Vol. 29, No. 8, pp. 866 - 872, Aug. 1994, and "SPT7860, 10-BIT, 40 MSPS, 175 mW A/D CONVERTER", Data sheet, 7/24/96, Signal Processing Technology, Inc., 4755 Forge Road, Colorado Springs, Colorado 80907, USA. so SUMMARY OF THE INVENTION It is an object of the invention to provide an efficient digital error correction of an ADC, in particular of a parallel ADC, using no special trimming signals. It is another object to provide methods and devices for correcting static mismatches in ADCs. 3 5 Thus a method of correcting, in the digital domain, static, in particular matching, errors in the analog domain is provided. In the method the following steps can be executed: 1. Measuring the actual histogram of the uncorrected digital values output from the ADC. 2. Estimating an expected histogram from the measured histogram. 3. Calculating the deviation of the measured histogram from the expected histogram. 4. Calculating a correction table based on the calculated deviation. 5. Correcting output data by using values from the correction table to correct uncorrected data, e.g. adding the value to an uncorrected digital value. Also, gain and offset errors in ADC cells in parallel ADCs can be corrected. An ADC 5 is provided which has a reference level generator which gives a good stability of the generated coarse reference levels but still not requires too many components to provide the fine reference levels. BRIEF DESCRIPTION OF THE DRAWINGS The invention will now be described by way of a non-limiting embodiment with ιo reference to the accompanying drawings, in which: - Fig. 1 is a schematic of devices for receiving radio signals, - Fig. 2 is a circuit diagram of an ADC, - Figs. 3a, 3b are diagrams illustrating subranging, - Figs. 4a, 4b are diagrams illustrating redundant subranging, i5 - Figs. 5a, 5b are diagrams illustrating redundant subranging for a too large and a too small step respectively between coarse reference levels, - Fig. 6 is a graph illustrating the distribution of output codes for an input sine signal, - Figs. 7a, 7b are diagrams illustrating redundant subranging for a too large step between two coarse reference levels and an input signal a little below and above respectively the higher 2 o one of the two coarse reference levels, - Fig. 8 is a simulated histogram of output codes for an ADC having a static error, - Fig. 9 is a simulated histogram of output codes for an ADC having a different static error, - Fig. 10 is a schematic illustrating the subranging stages in a 13-bit ADC, - Fig. 11 is a diagram illustrating the calculation of output coded using the subranging stages 2 5 of Fig. 10, - Fig. 12 is a diagram illustrating calculated errors for an error of a coarse reference level, - Figs. 13a, 13b are graphs illustrating calculated errors for a static error of a coarse reference level and for a dynamical conversion error respectively, - Fig. 14 is a graph illustrating a simulated histogram of an ADC having a static matching 3 o error of a coarse reference level, - Fig. 15 is a graph illustrated an expected gaussian distribution estimated from the histogram of Fig. 14, - Fig. 16 is a graph illustrated simulated and expected histograms for an ADC having a matching error, 3 5 - Fig. 17 is a graph illustrating the expected histogram at coarse reference level having an error, - Fig. 18 is a graph illustrating a simulated histogram of an ADC having a static matching error of a coarse reference level similar to that of Fig. 14, - Fig. 19 is a graph illustrating a histogram obtained by low-pass filtering the histogram of Fig. 18, - Fig. 20 is a block diagram of a control and calculating unit in a ADC according to prior art, - Fig. 21 is a block diagram of control and calculating unit in an ADC having static error correction, - Fig. 22 is a flow diagram of steps performed by a calculation unit in the control and calculating unit of Fig. 21, - Fig. 23 is a block diagram of a parallel ADC device, - Fig. 24 is a diagram illustrating the conversion times of the cells in a parallel ADC device, - Fig. 25 is a block diagram showing part of a parallel ADC having gain and offset correction of cells, - Fig. 26 is a flow diagram of additional steps performed by the calculation unit in the control and calculating unit in each cell of a parallel ADC for making gain and offset correction, - Fig. 27 is a block diagram of the calculation unit in the control and calculating unit in each cell of a parallel ADC for making gain and offset correction, - Fig. 28 is a circuit diagram of a common reference level generator for a parallel ADC, - Fig. 29 is a circuit diagram of a reference level generator which is only partially common for a parallel ADC, - Fig. 30 is a circuit diagram of reference level generators being individual for each cell of a parallel ADC, and - Fig. 31 is a block diagram illustrating a parallel ADC having a single calculating unit for calculating an estimated or filtered model distribution. DESCRIPTION OF PREFERRED EMBODIMENTS An analog-to-digital converter using successive approximation (SA-ADC) can use a binary search method. Then a sampled value, V s , of an input signal is compared to a sequence of known reference values. The reference values are selected from a reference source having a plurality of output signals or reference levels. For the digital code x the output reference signal used in the comparison is V R (x), which typically is a voltage having the magnitude (x-Vunit) [V] where Vunit is a unit voltage. The sequence of reference signals used in searching the output code is determined by the binary search algorithm. The sampled o value V s is first compared to the reference value in the middle of the search range, V R (middle). The result from this comparison is the most significant bit (MSB) in the searched digital output word, which is the digital code x corresponding to a reference signal V R (x) deviating from the sampled value V s by the least possible amount. Depending on the result of the first comparison a new reference value is chosen. If V s < V R (middle), the result is 5 MSB = 0 and the next reference value to be compared to V s is lower than V R (middle). If V s > V R (middle), the result is MSB = 1 and the next reference value to be compared is higher than V R (middle). The same comparison procedure is then repeated for the remaining bits in the searched output word. For a resolution of n-bits the number of required reference levels or values generally is 2 n , which can be a quite high number. Then, a subranging technique can be used, see M. P. V. Kolluri, "A 12-bit 500ns Subranging ADC", IEEE Journal of Solid State Circuits, Vol. 24, No. 6, Dec. 1989. The total range of the signal V s to be converted is divided by using reference levels included in a coarse part V RC and a fine part V g sequences of reference 5 levels V RC (y) and V RF (z), one coarse reference level and one fine reference level being added to provide a "composite" reference level which is then compared to the sampled signal V s , y and z being some order numbers of the reference levels. For an "equal" division the coarse and fine parts will have 2 n/2 reference values each and thus the ADC has 2 n 2+ 1 reference values. The algorithm is: Find integers y, z which minimize ι° !V s - (V RC (y) + V RF (z)) | (1) or possibly: Find y, z which makes the difference v s - (v RC (y) + RF(Z)) a -) have a positive value which is as small as possible. y and z are selected to be integers corresponding to binary words comprising n/2 bits is each and are thus both in the range of [0,2 n/2 -l]. The corresponding digital code is then x = y.2- ι/2 + z^ an( -j fa us there are 2 n possible results. In order to make this work, the reference values V RC and Vp must be chosen correctly. In order to analyze the actual implementation a hardware oriented representation can be used: Find the y, z which minimize !v s -c c - yv Cunit -c c - z-v Funit -c F | (2) 2 o as derived from the circuit implementation shown in Fig. 2. There, reference generators 11, 13 deliver output reference voltages yV Cunit and z-V Funit respectively through switches 15, 17 to capacitors C c and C F . The sampled value V s is through a switch 19 connected to the capacitor C c at the electrode connected to the reference generator 11. The electrodes of the capacitors C c , C F which are not connected to the respective reference generators 11, 13 are 2 5 connected to each other at a node N, to ground through a switch S s and to one input of a comparator 21, to the other input of which some small reference voltage is applied. The output of the comparator 21 is connected to a control circuit 23 which controls the reference generators 11, 13 and the switches 15, 17, 19, S s and provides the searched digital output word x. 3 o In the circuit of Fig. 2 Eq. (2) is implemented in the following way: Sample an analog value V s into the capacitors C c , C F to get an electrical charge (V s -C c + 0 C F ) in the node N. Subtract charges by applying the reference voltages to the capacitors C c , C F . When the charge generated by some reference voltage is approximately equal to the sampled charge at the node N, the correct reference levels have been found. The available reference charges are (y-V Cunit C c ) and (z V Funit -C F ). Examples of the subranging method are illustrated in Figs. 3a, 3b. Also, redundant output code can advantageously be used in an SA-ADC, see the cited paper by M. P. V. Kolluri. The term redundant code means that for at least some levels of the value V s of the input sampled signal several possible output codes exist. The reason for introducing redundancy originally is the handling of dynamic errors during the conversion of the MSBs. However, the redundant code can be used for correcting static errors, as will be described hereinafter. The redundancy is achieved by letting the fine reference have more voltage levels than required, and thus making it cover a larger range than one coarse voltage unit, see Figs. 4a, 4b. The resolution, i.e. the smallest distance between two levels of the finest reference source, is the same as in an ADC not using redundancy, but the output word is shorter, i.e. has fewer bits. In Figs. 3b, 4a and 4b the results of the conversion for the same input level of V s are shown. The results should therefore be the same (= 8). In Figs. s 4a and 4b two ways of obtaining this result are shown. Consequently, a mistake can be allowed when calculating the two MSBs and still the correct value for the sampled value V s shown can be found. In Fig. 4a the MSBs should read y = 10 BIN but instead y = 01 BIN is found. The sequence of fine reference values between the codes 01 BIN and 10 BIN for y is prolonged into the region between 10 BIN and HBIN allowing o the correct level to be found. In Fig. 4b the correct MSBs are found and the fine reference levels between the y- values 10 BIN and 11 BIN can be directly used. The MSBs are called y and the LSBs z as above. These are then combined to a digital output code x: x = 4-y + (z - 2) = 100 BIN y + (z - 10 BIN ) (3) 5 The value 4 indicates that 4 levels on the fine scale equals one level on the coarse scale. The value 2 is due to the negative overlap of two codes on the fine scale. The generation of reference levels relies on matching passive components. First of all, the capacitors C c and C F must match what normally raises no severe problems since capacitors can be rather easily made with a high accuracy in integrated circuits. However, a 3 o sufficiently good matching of the voltage levels V RC (y) = yNcun it and V^z) = z-V Funit cannot be easily obtained. A simple and commonly used way of generating a high number of voltage levels is through voltage division in a resistor ladder comprising a plurality of resistors which all should have the same resistance value but the resistances of which actually have small deviations from said same resistance value. Each coarse voltage unit V Cιmit (y) = 3 s V RC (y + l) - V RC (y) for the code y will then also have a small error and the level V RC (y) which should be equal to yV Cunit is where V Δ (y) is an error in the voltage level for the code y. In Fig. 5a the level 10 is above the expected value and in Fig. 5b it is below. The conversion of an input signal uses the actual level V RC (y), but the digital output x from the ADC represents the expected level. The size or span of a reference level for a code y, i.e. the quantity V Cunit (y) = V Cunit + V Δ (y) = V RC (y + l) - V RC (y), will influence the number of codes which occur in that level when converting an input signal having a more or less random shape to provide a large number of converted values. Thus, the size or span can be measured using statistical methods. A measure of the deviation of the size of a coarse reference level which can be calculated from such a measurement is called Differential Non- Linearity (DNL). In the measurement a test signal is applied as an input signal of the ADC and the histogram of the output codes is measured. For an input signal being a perfect sine wave having a swing corresponding to the conversion range the histogram will look like a bath tub, see Fig. 6. The histogram follows a smooth curve for an ideal ADC. However, due to the static matching errors, as e.g. derived from deviations of resistance values as discussed above, the histogram of output codes from any ADC will deviate from the ideal curve. The deviation or error is quantified by the DNL value for each code i as given by: DNL(i) = (#Measured(i) - #Theoretical(i))/#Theoretical(i) (5) For the reference levels illustrated in Fig. 5a it is now assumed that the conversion of o all bits are done correctly, and thus we obtain no situations like that illustrated in Fig. 4a. The level 10 in the coarse reference voltage suffers from a matching error. Depending on V s , the fine reference levels V RF (z) are mapped between 01 and 10, see Fig. 7a, or between 10 and 11, see Fig. 7b. Ideally, the fine reference part of the output code should contain the codes z = 010 BIN , 011 BIN , 100 BIN or 101 BIN . In Fig. 7a, however, a few output values can s have the code z = H0 BjN for the fine part. The density of the code H0 BIN is a measure of the error in the coarse level y = 10 BIN . In a similar way, the code density for the fine code z = 101 BjN is too small in Fig. 7b indicating that the distance between the coarse levels corresponding to the codes y = 10 BIN and y = 11 BIN is too short. The analog-to-digital conversion gives a digital code. The digital code represents the 3 o true reference levels, which, due to matching errors, are unknown. The measured DNL information can be used for finding the interpretation of the output code and map the output code on a more convenient linear scale. By studying Figs. 7a and 7b it is observed that the code y = 10 BIN should rather be 10.001 BIN . This type of information can be used for adjusting all the codes to match their physical levels. 3 5 In a measurement an ADC having two subranging stages were used to give an output of 6 bits having 48 unique levels. The 3 MSBs and the 3 LSBs give 8 levels each. 6 of the 8 fine levels equal one coarse level. This can be compared to Figs. 4a, 4b where 4 fine levels equal one coarse level. The digital output code x is found from: x = 6-y + z (6) The coarse reference has the range [000 BIN , 111 BIN ], and the fine reference has unique levels in the range [001 BIN , 110 BIN ]. The codes y = 010 BIN and z = H 1 BI N give the same output code as y = 011 BIN and z = 001 BIN , that is 19. Then the span of the fine reference voltage was changed from 1.8 V to 1.6 V in order to get a clearly visible mismatch. The result is a mismatch of the type illustrated in Fig. 7a. Since the sequence of fine reference values then is a little compressed, the code z = 111 B IN now represents unique analog values. The digital decoder as given by Eq. (6), however, does not take that into account. The result is a too high density for some codes, which is seen as peaks in the histogram of Fig. 8 for the codes 19, 25, 31 and 37. If the sequence of fine reference levels is instead changed to map to the sequence of coarse reference levels according to x = 7-y + z (7) i.e. so that the 7 levels on the fine scale correspond to 1 coarse level, the resulting histogram is as shown in Fig. 9. A few codes occur too sparsely, i.e. the codes 21, 28, 35 and 42. As seen in Figs. 8 and 9, the DNL measurement shows that there is a mismatch. Although the mismatch in this case was forced from the outside, it is possible to use the DNL o measurement for finding the internal mismatch. In the measured case all coarse levels have the same erroneous relation to the fine reference levels. In a real case, all levels in the sequence of coarse reference levels will have their own relation to the fine reference levels. To correct therefor a table listing correction values for each coarse reference level can be used. 5 In a somewhat more complicated but more realistic embodiment which will be discussed hereinafter the ADC has three subranging stages having 4, 4 and 5 bits respectively. The codes are redundant and the segmentation is made as is shown in Fig. 8. Consider the code blocks A, B and C corresponding to the subranging stages to be separate binary words comprising four, four and five bits respectively. These blocks must be weighted to be o combined to one single digital word. The weight function is in this design: D = (A- 12 + B)- 12-2 + C (8) where the actual codes from the stages are also called A, B and C and the result code to be delivered from the ADC is D. A and B are in the range of [0, 15] and C is in the range of [0, 31]. The output code D will be in the range of [0, 4619], i.e. a little more than 12 bits. There are several combinations of the codes A, B and C that give the same result D and also some combinations cannot occur. The 24 middle codes of C then correspond to the unit code interval of B and the 12 middle codes of B correspond to the unit code interval of A. The actual output word D should have an offset as given by D = (A- 12 + (B - B offs ))- 12-2 + (C - C offs ) (8') The individual offsets of the subranging stages are here denoted by C offs and B offs and they are ideally equal to 4 and 2 respectively. The total offset is thus equal to 52. However, in the following description this total offset is not considered since it is only a subtraction of a constant. The non-redundant output code would in this case be given by D = (A- 16 + B) 16-2 + C (9) Since 12 is less than 16, the most significant bits has less weight in the redundant output code. Each value of A, B and C is generated by some physical component, which has a matching error in accordance with the discussion above. The physical levels are named after the principle V A (x), where x is the code. V A without an argument generally refers to the group of physical levels related to A. Thus, V A (3) is the physical level corresponding to the digital output code A = 3 (MSBs = 011 BIN ). 0 A matching having an error of about 0.1 % can be achieved using an extremely careful layout of the physical components. However, this error is too large when the total output word comprises more than 10 bits as will be demonstrated hereinafter. The errors of the component values and thus the matching is, however, static or stationary and can be handled by means of statistic measurements as will now be described for the subranging stages of this 5 example: First, a word, P, is formed from the 9 LSBs (B and C stages) as a part of the ADC output signal according to Eq. (8): P = B-24 + C (10) The output word is then (not considering the digital offsets) 3 o D = A-288 + P (11) P is in the range of [0, 391] (15-24 + 31 = 391). The middle 288 (= 12-24) codes of P correspond to those reference levels which are located within each step of N A , i.e. between V A (x) and V A (x+ l), and these codes are unique for each value of A, see Fig. 11. Each step in A thus has the same weight as 288 steps in the code P. Owing to the redundancy, several combinations of A, B, C give the same output code D such as e.g.: {A, B, C} = {1, 13, 28} = > {A, P} = {1, 340} = > D = 628 {A, B, C} = {2, 2, 4} = > {A, P} = {2, 52} = > D = 628 The accuracy of V p typically has to be better than 1 LSB. The matching requirement for V p is thus Matching_Error < 1/288 < 0.35%, which can be achieved by a careful layout as has already been discussed. Thus the errors in V c (x) and V B (x) must not be considered. For an accuracy of V A better than 1 LSB, the matching requirements of V A is Matching_Error < 1/4608 < 0.022% which cannot easily be achieved. Obviously, the requirements on V A must be higher than the requirements on V p since V A covers a larger signal range than V p . s In correcting static errors the range formed by P or V P can be used for measuring the size of each step in V A , i.e. the step or interval Δ A (x) = V A (x+ l) - V A (x). The correction is made when actually using the ADC and then some analog signal is fed to the ADC and is converted thereby to give a plurality of output digital values. For each output value D to be delivered by the ADC as computed using Eq. (11), there is one value for A and one value for o P. The codes P for each value of A are sorted in one group. The values of P for A = 3 are denoted by P A=3 and so on. Thus, 16 different histograms are obtained, one for each group of P A=X , x = 0, 1, ..., 15. If the step height Δ A (x) is the same for all x, the histogram will, for a suitably chosen input analog signal, show that 288 different codes of P A are used since ideally Δ A (x) = 288 Δ P , where Δ p is the unit step in P. If the step size Δ A (x) is wrong for a 5 code x, a different number of codes in P A will be used. The result from the measurement is used for creating a look-up table listing the true values for the codes of A. For a look-up table L(A) the ADC output is formed as ^corrected = L(A) + B-24 + C = L(A) + P (12) where A is used as the address of a record in the look-up table L. 3 o Assume that the step corresponding to V A=2 is too wide and has an error of 0.28 % of the total range. This corresponds to an error of 0.28 % - 16-288 LSB = 13 LSB. In this case (288 + 13) codes in P A = 2 will be used provided that no dynamic errors exist. The correct digital range corresponding to the physical step Δ A =2 is thus ΔL(2) = L(3) - L(2) = 304. The correction table is then formed as: 35 L(0) = 0 L(l) = ΔL(0) L(2) = ΔL(0) + ΔL(1) L(3) = ΔL(0) + ΔL(1) + 304 A non-uniform distribution of the codes obtained from the sampled values will generally exist owing to the shape of the input signal from which the samples are taken, see the bath tub curve of Fig. 6. Thus some input signal levels V s may be more common, resulting in that some output codes are more common. A solution to this problem would be to measure the histogram, of the output values from the ADC and compare it to the histogram of the input signal, i.e., the true histogram. The deviation will be a measurement of the error, which as above is called DNL (Differential Non-Linearity). However, the true histogram is not known. Instead thus, the existing information on the expected input signal must be used for making an intelligent estimate of the expected histogram, h e , h e = f(h m ,θ) (13) where 1^ is the measured histogram and θ is a quantity in some way characterizing the expected histogram. The parameters μ, δ, N as defined below can for example be included in the quantity θ. A relative error e is then generally calculated as e = (1^ - h e )/h e (14) for each uncorrected output digital value. For a correct density, e = 0. For too many codes, 0 e > 0, and for too little codes, e < 0. The error e can then be used to create a correction table as will be described hereinafter. In Fig. 12 a diagram is shown of the relative error e at a step of A. The diagram shows the error for output codes around A = 6 and P = 340, corresponding to D = 2068 and A = 7, P = 52, compare Fig. 11, and shows that the relative error is approximately equal to zero 5 except in a region above the step where it is equal to one for about 20 codes, i.e. up to about 2088. This means that the reference level V A (7) is too high and that the correct level is located at a level which is lower by a step corresponding to 20 fine levels, i.e. the levels of V c above, and that the output data must be corrected accordingly. In the diagrams of 13a, 13b which are similar to the diagram of Fig. 12 but in a smaller o scale, the first diagram shows the same case as in Fig. 12 with a level which is located too high. In the diagram of Fig. 13b the case for a dynamical conversion is illustrated. In that case there are errors deviating from zero at both sides of a shift of the coarse variable A. On one side of the shift there are errors equal to + 1 and on the opposite side there are errors equal to -1. However, the total errors balance each other so that if the error is integrated or summed over the range R at the variable shift, a result equal to zero is obtained which is typical of dynamical errors. In actual cases there may be a combination of the cases illustrated in Figs. 13a, 13b. The dynamical errors can always be eliminated by summing over a region at the shift. A positive sum of the errors then directly indicates that the corresponding reference level is too high and a negative sum that the reference level is too low. The absolute value of the sum gives the error of the reference level in the corresponding number of LSBs. Estimating an expected histogram or generally determining an expected histogram will be described hereinafter. For some applications, a specific distribution of the output codes is expected. For example, for DMT-systems (Discrete Multi Tone) a gaussian distribution is expected. If the shape of the expected code density is assumed to be a gaussian distribution, the parameters (μ, 6, N) of the distribution can be estimated from a sequence of uncorrected data, D(i): ό = 1^-∑ (oω - μ) 2 i 1/2 < 16) The estimated expected distribution is found from for x = [0, 4711] . In Fig. 14 a simulated histogram is shown for a suitably chosen input analog signal. A o level error as illustrated in Fig. 12 is assumed and the error is visible by the high counts corresponding to the level shift. A gaussian distribution estimated from the simulated histogram is plotted in Fig. 15. Other expected shapes of the distribution of the output codes, e.g. a rectangular shape, can be estimated in a way similar to that described above using well known statistical 5 methods. For some applications, the expected shape of the distribution may not be known such as can be the case for a general purpose ADC. In that case the expected histogram can be determined by low-pass filtering the measured histogram as will be described hereinafter. In such a filtering the mismatch errors which generally have a high frequency behaviour will be removed or at least reduced. 0 Instead of using a total histogram partial histograms of the types illustrated in Fig. 16 which are determined for each value of A can be used and therefrom P A can be calculated. In Fig. 16 the input analog signal is assumed to produce samples having a mean p. in the center of the conversion range and a suitable standard deviation & to produce a near zero frequency at the borders of the conversion range. The smooth curve illustrates the ideal histogram for an ideal input signal giving a perfect gaussian distribution of sampled values and for an ideal ADC. The curve having noise or ripple illustrates a simulated histogram for a typical input signal and for some step errors in the A-conversion circuits. In Fig. 16 mainly the histograms for the middle eight A-values are visible since the histograms for the A-values [0,1] and [10,11] at the lower and upper boundary of the range are very small. As stated above, the codes [0, 51] and [340, 391] for P are not expected to be used, see Fig. 11. When they are still used in the actual conversion process as measured, this clearly signals a step error, or possibly a dynamical conversion error corrected by the redundancy feature, as is visible for the conversion block A = 3. As an example, correct the range Δ A=3 , provided that the actual histogram and the expected histogram have been determined. An expected value, H e (A=3), of the occurrences of samples within a range at the border of an interval is found from the expected histogram, the range for example comprising 64 successive levels at the upper border: H e (A = 3) = Σ h e ([(52 +4-288-32), (52+4-288+32 -1)]) where the sum is taken over all integer values in the range specified in the argument (corresponds to the range R above. The measured histogram value is the sum of the counts of the values in the same or corresponding range: H m (A = 3) = Σ h m ([P A==3 = [391-52-32, 391-52 + 32] & P A=4 = [0, 32-1 +52]]) o The correction term is then corr(A = 3) = (H m (A = 3) - H e (A = 3))/H e (A=3) Thus, only 32 codes above and 32 codes below the expected height of A = 3 are counted, i.e. at the level V A (4). The maximum allowed error in the coarsest reference levels V A (x), x = 0, 1, ..., 15 thus is the voltage corresponding to +/- 32 LSB. 5 Hence, assume a range within which the error in A is allowed, e.g. +/-32 LSB. Add together the counts of the expected overlap of codes. The memory may then only contain counts for the 2-32+2-32 values around each step in A and based on these counts an estimated gaussian distribution can be determined. These memory addresses located both at the low border and the high border of P are numbered 0 - 63. If the step of A is too large, an 0 increased count is found in the memory positions 32 - 63, compare Fig. 12. If the step of A is too small, a reduced count is found in the memory positions 0 - 31. In the determination of the gaussian distribution the histogram between these values at each interval upper border can be assumed to be e.g. a straight line between the histogram values at the ends of each interval, see Fig. 15, but also a direct estimation of the gaussian distribution can be made using standard statistical methods. The expected histogram, h e , can be found in an alternative way: Assume that the error err(A) in A measured in bits is limited so that s | (err(A) - 288) | /288 < 0.25 (18) The number of codes in the range P = [123, 267] will then always be correct. The counts in these intervals are then used for estimating the expected histogram such as an estimated gaussian distribution. Alternatively the total counts in this range for the possible A-values can be calculated: o H e (A) = Δ h m (P A [123, 267]). (19) This gives 16 points on a curve. The intermediate values can be found by interpolation. These intermediate values are then directly used in the comparison to an appropriate number of counts at the steps in A. Alternatively the total curve or the 16 points may be used for estimating a some suitable distribution such as a gaussian distribution. is For a simulated count distribution which is shown in Fig. 18 and is similar to that of Fig. 14 a filtering process has been applied using the uncorrected output code as the variable corresponding to time and the count corresponding to the instantaneous signal value as in signal filtering. A low-pass filter is used to remove the "high frequency" oscillations or the ripple and the resulting filtered signal is shown in Fig. 19. The program code used in the 20 computer program Matlab is as follows: cl =-0.96875; c2=0.03125; hny=filtfilt(c2,[l cl],h_meas); h_fιlt=filtfιlt(c2,[l cl],hny); 2 5 The filtered histogram can be used like the expected histogram as described above to calculate the relative errors for each uncorrected digital value and then finding correction terms. The logic control circuit 23 for the binary search and output word calculation, see Fig. 2, can in an ADC not using any correction as described above contain a unit 41 for the 30 binary search control as depicted in Fig. 20. This unit issues signals to the reference generators generating the reference levels V c , V B , V A , the issuing starting in response to a clock signal. The issued signals are changed in accordance with signals received from the comparator 21. After the signal from the comparator indicates that the combination of reference levels best agreeing with the sampled input value has been achieved, the found binary values of A, B, C are output to a calculating unit 43 together with a signal indicating to the calculating unit that the new values are available. The calculating unit will upon receiving that signal calculate the output word D according to Eq. (8) and deliver it as the output signal of the converter. A block diagram of a logic control circuit 23 for the binary search and output word calculation using correction as described above is shown in Fig. 21. The control circuit contains a unit 41 for the binary search control working as described with reference to Fig. 13. The found binary values of A, B, C are here output to an evaluation unit 45. The found binary values of B, C are also directly output to the calculating unit 43' but the found binary value A is delivered to unit or memory 47 holding a correction table L(A). When receiving the new binary value A the correction unit 47 forwards the value L(A) stored therein to the calculating unit. The calculating unit 43' will upon receiving the binary table value L(A) calculate the output word D corrected according to Eq. (12) and deliver it as the output signal of s the converter. In the evaluation unit 45 a storage control unit 49 receives the new found values A, B, C. They are evaluated for example by first calculating the quantity P and comparing it to predetermined boundary values. If it is decided that the digital value represented by the combination of the found A, B, C is to be counted, a memory cell in a count memory 51 is o addressed for example by using A and P as row and column addresses in an array and the count the cell is incremented by one. When a sufficient number of counts have been made in the count memory 51, for example as signalled by overflow occurring in a memory cell when incrementing the count therein, the operation of the storage control is stopped so that no new combinations of found A, B, C are counted and a signal is fed to a unit 53 for calculation of 5 the correction table L(A). The unit 53 then starts then calculation according to one of the methods described above. When the calculation is finished, the new correction table values L(A) are stored in the table unit 47, the count memory 51 is reset and signal is sent to the storage control 49 to again start incrementing the counts in the count memory 51. The correction table memory 47 can be reset after each start of the ADC or preferably it can be a 0 non- volatile memory which is used when restarting the ADC. Thus, as has been described above, the unit will, after a sufficient number of converted samples have been counted in the memory 51, have new data L(A) for correction of the output values D as generated by the calculation unit 53. In addition to the condition of overflow of a count in a memory cell the calculation can be made such as only once at start- 35 up or after reset of the ADC or periodically. A flow diagram of the steps used in the calculation is shown in Fig. 22. In a first block 61 the estimated histogram h e is determined by evaluating the counted values in the array stored in the count memory 51. This can be done by e.g. one of the following methods: 1. estimating an expected distribution, e.g. a gaussian distribution, using counted values for all combinations (A,B,C) or (A,P). 2. estimating an expected distribution, e.g. a gaussian distribution, using counted values for only combinations (A,P) in a range at each A-level. 3. estimating an expected distribution, e.g. a gaussian distribution, using counted values for combinations (A,P) in a range well inside the A-interval above an A-level. 4. calculating the total count within a middle interval of each step of A and finding a smooth curve through the total counts by interpolation. 5. low-pass filtering the counts as a function of uncorrected output codes. In the next block 63 the total count of the range at each A-level is calculated and then, in a block 65, the corresponding estimated total count is calculated from the estimated histogram. Thereupon, in a block 67 correction factors corr(A) are calculated from total counts and finally the correction table L(A) is created in a block 69, e.g. for relative correction factors, according to: ΔL(A) = (1 + corr(A))-span A where span A is the number of fine levels, i.e. the P-levels, corresponding to one A-level. In the embodiment described above, span A = 288. Alternatively the correction table can be created from ΔL(A) = Σ e, where the sum is taken over a range of uncorrected digital values at the shift from A-l to A. A single analog-to-digital converter can be too slow for some applications. Then, a plurality of single or individual ADCs, called ADC cells or ADC channels, are arranged which convert the successive sampled values in a cyclical process, the conversion in each cell being performed in parallel with or multiplexed in time with the conversion in the other cells, the conversion process starting at successive times for the successively sampled analog 5 values. Such a composite device is called a parallel ADC device (PSA-ADC), see e.g. U.S. patent 5,585,796 for Christer M. Svensson et al. In Fig. 23 such a parallel ADC device having m parallel channels is schematically illustrated. The input analog signal V s is sampled by successively closing switches corresponding to the switch 19 in sample and hold circuits llli, 111 2 ll l m , one for each ADC cell 113 1 ? 113 2 , ..., 113 m , as controlled by clock o signals from a time control unit 115, to make the instantaneous value of V s to be held or stored in the respective sample and hold circuit. The ADC cell connected to a sample and hold circuit compares the value held therein to reference values. The ADC cells deliver the output words on output lines to a multiplexer 117, from which a flow of digital words is obtained as an output of the total device. 5 In Fig. 24 a timing diagram of the conversion process is shown. It is observed that for each ADC there is a time period of length t c in which the conversion of a sampled value is executed followed by a short intermediate time period indicated at 19. Each channel repeats the conversion process periodically with the same and fixed frequency, the time skew or time offset of the ADC cells being shown by the sloping line in Fig. 24. In the correction procedure for static errors as described, there may appear an error accumulation owing to rounding errors in each ADC cell in a parallel ADC. The steps Δ A are measured by the quantised scale P. The accuracy of P is expected to be 1 LSB. This error might obviously accumulate and can maximally result in a gain error of 16 LSB, i.e. 16/4096 = 0.4%. Thus a correction or balancing of the gain in each ADC channel may be required. Also, the parallel ADC cells are designed to have equal reference levels using reference generators such as 11, 13 of the circuit shown in Fig. 2. Actually, these reference levels may differ and thus errors can exist. The errors include particularly errors in the general or average level of all reference levels which can be called offset errors and errors in the total conversion range, i.e. the range of the input signal, within which it will be converted, which errors can be called gain errors. Gain is defined to be in principle the ratio between range of the physical levels, in particular the coarse levels, in the reference generator and the codes in the correction table for A. Each ADC cell can be provided with the feature of correcting static errors as described. In the correcting, a histogram is calculated and thus a measured distribution of uncorrected output values is obtained. In some way measures of the width of the distribution and the center of the distribution are produced. For example the standard deviation σ and the average or mean μ k can be calculated for the counts of each cell: N-l r i ' k - r^∑ α ω - iH )2j1 ' 2 < 19 > These calculated values are particularly good estimates of the corresponding parameters (μ k , σ k ) in a gaussian distribution. 5 Instead of the standard deviation other width measures can be used such as the mean of the absolute value of the deviation of each output code as calculated from G k = 1/N-∑ i D - μ k \ (19') The offset and gain in each cell is then adjusted according to these measurements. An estimated mean for the output signals of the total ADC device is given by, provided that the o number N of digitized values is the same for all channels, κ i=0 The estimated standard deviation of all the values delivered by the ADC device is in the same way given by An offset for each ADC cell is calculated from offs k (0) = [-(μ k - μ A )] + const. (23) where the constant is some value used in order not to obtain negative values of L (0). This offset is to be added to all the L k (A)-values in the correction table for the considered ADC. After this, new corrections Δ'L k (A) for each step which are to be added to the already produced corrections L k (A) for each ADC are obtained from Δl^A) = [ - span A -A] (24) σ k - σ where span A as -ϊbove is the number of fine levels, i.e. the P-levels, corresponding to one A- level. This last correction thus corrects for the possible inequality of the gain in each cell. The parallel ADC as shown in Fig. 23 then has to be supplemented with a central correction unit 119 as seen in the block diagram of Fig. 25. From each ADC cell thus the center and width measures μ and σ k are provided to the central correction unit which calculates a general center measure μ A and a general width measure σ Λ . Then these values are fed to the evaluation units 45 of each ADC cell in which the units 53 for calculation the correction table make the final correction of the table. The additional steps to be executed by the units 53 are shown in the block diagram of Fig. 26. Here the center and width measures o μ and σ are calculated in a block 71 and are in the next block 73 provided to the central correction unit. In a block 75 the reception of the values the general center and width measures μ A and σ A are awaited. After receiving them, in a block 77, the offset is calculated and finally the gain adjustment is calculated to produce the final correction table to be used when thereupon feeding converted values from the ADC. 5 The method of correcting the offset and gain as described above can also be used in a parallel ADC in which the cells do not use the histogram based correction of static errors. In such an ADC cell, see Fig. 21, the original or initial L(A) is created using equal steps, what is also made in the histogram based method. However, the evaluation unit 45 can be simplified and in particular there may be no large memory for counts. An evaluation unit 45' o to be used in that case is shown by the block diagram of Fig. 27. When receiving the result of a comparison of an analog value, in a first calculation unit 201 the uncorrected digital output code is calculated such as in the above described example from D = A-288 + B-24 + C. This code is added to a sum of such codes stored in a first register 203. The code is also squared and is added to sum of such squares stored in a second register 205. After summing a for example predetermined, sufficient number of uncorrected codes and their squares, the summing is stopped and a second calculation unit 207 is activated. It calculates the average μ k and the standard deviation σ k from the stored sums and transmits the calculated values to the central calculating unit 119. A third calculation unit 209 receives the calculated general mean and standard deviation μ Λ and σ A and calculates therefrom a new offset and new correction terms Δ'L(A). The correction terms are added to the original L(A)-values valid for equal step heights to produce new L(A)-values which are finally stored in the table 47. Then the registers are reset and the summing process is started again. If the distribution of the counted values can be considered to be constant in time, the method as described above for adjusting the gains of the cells of a parallel ADC can also be used for a single ADC cell. The width measure will then show only the accumulated error due to rounding and similar phenomena. A valid width measure can be determined from a very large number of counts corresponding to a plurality of the counts made for each new determination of the correction table L(A) based on the histogram method. In a parallel ADC the reference levels can be generated individually for each ADC cell or by a common reference generator as is disclosed in the cited U.S. patent for Christer M. Svensson et al. A circuit diagram of a common reference generator arrangement is shown in Fig. 28 for ADCs having 2 + 2 bits. Two reference voltages VR1, VR2 are applied to ladders of resistors Rl and R2 respectively, one reference voltage to each resistor ladder. From each connection point in the ladders lines having resistors Rp extend to the respective cell and are therein connected through switches to summing nodes ref which can be implemented as the summing node N of Fig. 2. V Cunit is then VR1/4 and V Funit is equal to VR2/4. The switches in each cell make the selection of a reference level to which the input 5 signal is compared. Switching in cell 3 will causing ringing in cell 2 and in cell 1. For the reference generator for the most significant bits this is a large problem. The disturbance must be less than the required resolution. For the less significant bits, however, the resolution requirements are reduced and so are the disturbance requirements. Crosstalk is distributed in the lines. o The advantage of having a common reference generator obviously is that the gain in the different cells is matched or equal. The disadvantage is the coupling between the different cells through the reference wires, as discussed above. This coupling is code (signal) dependent and is most severe for the MSBs, for which the load is highest and the relative requirements are highest. 5 In a parallel ADC having separate, individual reference generators, one for each cell, there is no problem of coupling between the cells. The disadvantage of such an arrangement is that the circuit may be very large and that there might be a gain error, as has been discussed above. A circuit diagram of individual reference generators in a parallel ADC similar to that of Fig. 28 is shown in Fig. 29. Since subranging is used in the cells, only the most significant part of the reference generator, i.e. the part that is used for finding A, can also be made individual to each cell. The correction terms for A is found from the common part of the reference generator and thus the gain is adjusted in the same way as the individual levels of A. A circuit diagram of an arrangement having individual reference generators for only the most sigmficant bits in a parallel ADC and similar to that of Figs. 28 and 29 is shown in Fig. 30. The two reference voltages VR1, VR2 are applied to ladders of resistors Rl and R2 respectively. One resistor ladder of resistors Rl is provided in each cell but the ladder of resistors R2 for the MSBs is common to all cells. In the resistor ladders individual to the cells no parallel resistors Rp are used. In this way, the connection or coupling between cells is reduced. The supply wire for the reference voltage is still common for all cells, but it can be made with a lower impedance. In a parallel ADC the expected histogram h e can be estimated using the counts from the entire ADC and then each cell be corrected individually. A block diagram of such an arrangement is shown in Fig. 31. The contents of the memories 51, see Fig. 21, used to store the counts for uncorrected output data will then all be used by the common calculation unit 119' for finding the expected histogram. The operation performed in the block 61 of Fig. 22 will then be made in the unit 119' and not in each ADC cell. The error correction as described herein can also be used as a BIST (Built In Self Test). This is a standard procedure in digital circuits, but it can be difficult to implement it in analog circuits. The error correction procedure can by the above mentioned methods find some errors in the ADC. By analysing the measured histogram, conclusions on the ADC can be made. 5 Example 1. If the fine reference (codes B and/or C) is malfunctioning in such a way that it delivers only one or a few reference levels, groups of codes will be missing in the histogram measurement. Assume a non-redundant (D=A 16-32+B-32+C) code: If C is only delivering 4 of its expected 32 codes, (32-4)/32 = 7/8 of all codes will be missing. 0 For a redundant code (e.g. D=A-24 12+B- 12+C): If C is only delivering 4 of its expected 24 unique codes, the number of missing codes depends on which 4 codes that are working, but the failure rate is between (24-4)/24=5/6 and 23/24. These cases can be easily detected by a zero counter in the histogram logic. However, if the ADC has not been used, i.e. has not received any input signal, no values or counts are 5 expected. Therefore, only zero counts between minimum and maximum of the present codes may be used for the detection. Thus the following procedure can be executed. Measure the histogram as required for the error correction and then count the zeros in the appropriate interval. If an error is detected, an error flag is set or some similar indicator signalling an error. Example 2. If the coarse reference (codes A) is failing, missing codes or has large deviations from expected values, the correction values in the table L(A) will deviate very much from the expected levels. This can be easily detected by a subtraction and a comparison (threshold circuit). Example 3. If the analog circuitry, i.e. the comparator, is too slow, a specific pattern of missing codes will occur. The dynamic error correction is expected to handle this type of errors, but if the error is too large, due to the fact that the comparator is too slow or something else, the dynamic error correction will overflow. This pattern can be detected. The pattern has a typical shape, but the exact shape can depend on the implementation. In principle the missing codes appear in groups on one side of some reference levels. The groups are larger and more probable at the levels corresponding to the more significant bits. To determine the pattern, some sample can be taken out of the production of ADC circuits and it is checked what happens in this specific design. Then a program is loaded into s all other circuits, which tells the pattern to look for. Another way is to assume that the dynamic error correction is overdimensioned. Then an overflow in the dynamic error correction can be detected as e.g. in the example above B = 15 and C=31 for the same sample. Underflow is detected as B=0 and C=0 for the same sample. If the over/ underflow is frequent, the circuit is malfunctioning. o In the description of the histogram based correction methods only the coarsest reference levels, i.e. the A-values, are corrected. Obviously, some of correction methods can be used also to the correct the next to coarsest reference levels, i.e. the B-values, using the redundant C-values, and so on up to the next finest reference levels. It is not necessary to use the same correction method in the different cases. 5 A histogram based matching calibration method has thus been described allowing that the static matching requirements can be relaxed. The calibration technique is completely digital. The extra latency is low, since the real-time correction is look-up table based. The calibration initially requires some time corresponding to the conversion time of a magnitude of order of 10 7 samples to acquire enough data for the calibration.

Claims: CLAIMS 1. A method of determining digital values from analog values successively sampled from an analog signal, the method comprising the steps of: providing a sequence of reference values, each reference value having an order number, comparing each sampled analog value to the reference values to determine a reference value best agreeing with the sampled value, determining, from the order number of the determined reference value, an uncorrected digital value representing the sampled analog value, characterized by the additional steps of: counting during a predetermined time period or for a predetermined number of sampled analog values the occurrences of at least some of the uncorrected digital values, calculating from the counted occurrences a model distribution of occurrences of the uncorrected digital values to provide model occurrences of the digital values, comparing the counted occurrences to the model occurrences, in the step of determining an uncorrected digital value, using also the result of the comparing of the counted and model occurrences, in addition to order number of the determined reference value, to determine a corrected digital value representing the sampled analog value with an equal or higher accuracy than the uncorrected digital value. 2. A method according to claim 1, characterized in that in the step of calculating a model distribution, the counted occurrences as a function of the uncorrected digital values are estimated to provide an expected distribution which is taken to be the model distribution. 3. A method according to claim 1, characterized in that in the step of calculating a model distribution, the counted occurrences as a function of the uncorrected digital values are low-pass filtered to provide the model distribution. 4. A method according to claim 1, characterized in that in the step of calculating a model distribution, predetermined ones of the counted occurrences are summed to provide summed occurrences, from which a model distribution is calculated by interpolation. 5. A method according to any of claims 1 - 4, characterized in that in the step of providing a sequence of reference values, a first subsequence of o coarse reference values and a second subsequence of fine reference values are provided, that in the step of determining the uncorrected digital value, that one of the coarse reference values and that one of the fine reference values which when added to each other give a value having the smallest deviation from or best agreeing with the sampled analog value is determined, 5 that in the step of determining from the order number of the determined reference value an uncorrected digital value, the order numbers of the determined coarse reference value and fine reference value as placed in the first and second sequences respectively are combined with or added to each other to give the digital value representing the analog signal. 6. A method of correcting static errors in an analog-to-digital converter, characterized by the steps of: counting during a time period the occurrences of at least some of uncorrected digital values which are output from the converter and represent analog values sampled from an input signal, calculating from the counted occurrences a model, in particular an expected, filtered or interpolated, distribution of occurrences of the uncorrected digital values to provide model occurrences of the digital values, comparing the counted occurrences to the model occurrences, using, after the time period, the result of the comparing to correct the uncorrected digital values to provide corrected digital values which more accurately represent the analog values than the uncorrected digital values. 7. A method according to claim 6, characterized in that in the step of calculating a model distribution an expected distribution is calculated which is taken to be one of a family of similar distributions, each member of the family defined by at least one parameter, and s determining said at least one parameter from the counted occurrences. 8. A method according to any of claims 6 - 7, characterized in that in the step of counting the occurrences, only the occurrences of uncorrected digital values within predetermined intervals are counted, the predetermined intervals located around break points in the range of uncorrected digital values. o 9. A method of determining digital values from analog values successively sampled from an analog signal, the method comprising the steps of: providing a first sequence of coarse reference values and a second sequence of fine reference values, comparing a sampled value to the coarse reference values of the first sequence and the 5 fine reference values of the second sequence, determining that one of the coarse reference values and that one of the fine reference values which when added to each other give a value having the smallest deviation from the sampled value, combining or adding to each other the order numbers of the determined coarse reference 0 value and fine reference value as placed in the first and second sequences respectively to give a digital value representing the analog signal, characterized in that for a multitude of successively analog values the number of occurrences of the order numbers of the determined coarse reference value and fine reference value are stored to 35 give counts for each pair of the order number of a coarse reference value and of the order number of fine reference value, determining from the stored counts a model, in particular an estimated, filtered or interpolated, distribution of counts, comparing the counts of the pairs of a first coarse reference level and fine reference levels at the upper boundary of the sequence of fine reference levels and the counts of the pairs of a second coarse reference level located directly above the first coarse reference level and fine reference levels at the lower boundary of the sequence of fine reference levels to counts for the same pairs calculated from the model distribution, determining from the result of the comparing a correction term to be combined with or added to, after determining the order numbers for an analog value, the sum of the order numbers of a determined coarse reference value and a determined fine reference value to give a digital value representing the analog signal, from which the values were determined. 10. A method according to claim 9, characterized in that the correction term is determined by summing the respective counts, finding the relative deviation of the sum of stored counts from the sum of estimated counts and multiplying the number of levels in the sequence of fine reference levels by the relative deviation. 11. A method according to any of claims 9 - 10, characterized in that when determining that one of the coarse reference values and that one of the fine reference values s which when added to each other give a value having the smallest deviation from the sampled value, the adding is made with a negative offset, so that for adding a coarse reference value to at least the lowest fine reference value an offset sum is obtained which is lower than said coarse reference value. 12. A method according to any of claims 9 - 11 , characterized in that in providing the o first and second sequences the sequences are provided with redundancy so that when adding one of the coarse reference values to at least the highest of the fine reference values a result value higher than or equal to the coarse reference value being next higher than said one of the coarse reference values. 13. A method according to any of claims 1 - 12, characterized in that stored counted 5 occurrences are used for self test of a device making the conversion. 14. A method according to claim 13 , characterized in that in the self test at least one of the following is made: counting zeros among the counted occurrences, detecting too large control signals, 0 detecting a predetermined pattern, measuring the correlation with the model distribution, training the system to detect a specific pattern and in particular loading a program, and detecting over-/underflow in a dynamic error correction procedure. 15. A converter for determining digital values from analog values successively sampled 35 from an analog signal, the converter comprising: a reference level generator providing a sequence of reference values, each reference value having an order number, a comparator for comparing each sampled value to reference values obtained from the reference level generator to determine a reference value best agreeing with the sampled value, first calculation means for determining, from the order number of the determined reference value, an uncorrected digital value representing the sampled value, characterized by memory means connected for storing counts of the occurrences of at least some of the uncorrected digital values, means connected to the calculation means for incrementing, when receiving an uncorrected digital value for which a count is stored in the memory means, the stored count of the occurrence of the uncorrected digital value, second calculation means connected to the memory means for calculating from the counted occurrences a model distribution of occurrences of the uncorrected digital values to provide model occurrences of the digital values, comparing means connected to the memory means and the second calculation means for comparing the counted occurrences to the model occurrences, the first calculation means connected to the comparing means and arranged to use also the result of the comparing of the counted and model occurrences to determine corrected digital values representing the sampled values more accurately than the uncorrected digital values. 16. A device according to claim 15, characterized in that the second calculating means are arranged to estimate the counted occurrences as a function of the uncorrected digital values to provide an expected distribution which is taken to be the model distribution. 17. A device according to claim 15, characterized in that the second calculating means are arranged to low-pass filter the counted occurrences as a function of the uncorrected digital values to provide the model distribution. 18. A device according to claim 15, characterized in that the second calculating means are arranged to sum predetermined ones of the counted occurrences to provide summed occurrences and to interpolate from the summed occurrences the model distribution. 19. A device for correcting static errors in an analog-to-digital converter, characterized by: memory means for storing counts of the occurrences of at least some of uncorrected 0 digital values which are output from the converter and represent analog values sampled from an input signal, means connected to the memory means and to an output of the converter for incrementing, during a time period, when the converter outputs an uncorrected digital value for which a count is stored in the memory means, the count of the uncorrected digital value, 5 calculation means for calculating from the counted occurrences an expected distribution of occurrences of the uncorrected digital values to provide model, in particular estimated, low-pass filtered or interpolated, occurrences of the digital values, comparing means connected to the memory means and the calculation means for comparing the counted occurrences to the model occurrences, a correction unit connected to the comparing means and using, after the time period, the result of the comparing to correct uncorrected digital values output from the converter to provide corrected digital values which more accurately represent the analog values than the uncorrected digital values. 20. A device according to claim 19, characterized in that the calculating means are arranged to estimate an expected distribution of a family of similar distributions, each member of the family defined by at least one parameter, and to determine said at least one parameter from the stored counted occurrences. 21. A device according to any of claims 19 - 20, characterized in that in the memory means only the occurrences of uncorrected digital values within predetermined intervals are counted, the predetermined intervals located around break points in the range of uncorrected digital values. 22. A device according to any of claims 15 - 21 , characterized in that the reference generator is arranged to generate a first subsequence of coarse reference values and a second subsequence of fine reference values, a comparator for comparing each sampled value to reference values obtained from the reference level generator to determine a reference value best agreeing with the sampled value, for determining, from the order number of the determined reference value, an uncorrected digital value representing the sampled value, that the comparator is arranged, when determining the best agreeing reference value, to determine that one of the coarse reference values and that one of the fine reference values which when added to each other give a value having the smallest deviation from the sampled value, that the first calculation means are arranged to combine or add, when determining from the order number of the determined reference value an uncorrected digital value, the order numbers of the determined coarse reference value and fine reference value as placed in the first and second sequences respectively to give the digital value representing the analog signal. 23. A device for determining digital values from analog values successively sampled 0 from an analog signal, the device comprising: a reference level generator to provide a first sequence of coarse reference values and a second sequence of fine reference values, a comparator for comparing a sampled value to the coarse reference values of the first sequence and to the fine reference values of the second sequence, 5 means for determining that one of the coarse reference values and that one of the fine reference values which when added to each other give a value having the smallest deviation from the sampled value, calculation means for combining or adding the order numbers of the determined coarse reference value and fine reference value as placed in the first and second sequences respectively to give a digital value representing the analog signal, characterized by memory and counting means for storing, for a multitude of successively analog values, the number of occurrences of the order numbers of the determined coarse reference value and fine reference value to give counts for each pair of the order number of a coarse reference value and of the order number of fine reference value, means for determining from the stored counts a model, in particular an estimated, filtered or interpolated, distribution of counts, comparing means for comparing the counts of the pairs of a first coarse reference level and fine reference levels at the upper boundary of the sequence of fine reference levels and the counts of the pairs of the coarse reference level directly above the first coarse reference level and fine reference levels at the lower boundary of the sequence of fine reference levels to counts for the same pairs calculated from the model distribution, means connected to the comparing means for determining from the result of the s comparing a correction term to be combined with or added to, after determining the order numbers for an analog value, the sum of the order numbers of a determined coarse reference value and a determined fine reference value to give a digital value representing the analog signal, from which the values were determined. 24. A device according to claim 23, characterized in that the means for determining o the correction term are arranged to determine the correction term by summing the respective counts, finding the relative deviation of the sum of stored counts from the sum of estimated counts and multiplying the number of levels in the sequence of fine reference levels by the relative deviation. 25. A device according to any of claims 23 - 24, characterized in that the comparator, 5 when determining that one of the coarse reference values and that one of the fine reference values which when added to each other give a value having the smallest deviation from the sampled value, are arranged to make the adding with a negative offset, so that for adding a coarse reference value to at least the lowest fine reference value an offset sum is obtained which is lower than said coarse reference value. 0 26. A device according to any of claims 23 - 25, characterized in that the reference level generator is arranged to provide the first and second sequences the sequences with redundancy so that the comparator, when adding one of the coarse reference values to at least the highest of the fine reference values a result value higher than or equal to the coarse reference value being next higher than said one of the coarse reference values. 35 27. A parallel converter device comprising a plurality of element devices according to any of claims 15 - 26 working in parallel for determining digital values from analog values successively sampled from an analog signal, characterized in that the second calculation means are common to all element devices and are connected to the memory means of all element devices for calculating from the counted occurrences in all the memory means the model distribution. 28. A parallel converter device comprising a plurality of element converter devices working in parallel for determining digital values from analog values successively sampled from an analog signal, each element device arranged to provide uncorrected digital values representing sampled analog values, characterized by first calculation means connected to receive the uncorrected digital values and arranged to calculate a center measure and a width measure of the distribution of the uncorrected digital values for each element device and for all the uncorrected digital values, and in each element device: - comparing means connected to the first calculation means for comparing the center and width measures to the center and width measures for all values, - a correction table for storing corrections, - second calculation means connected to the comparing means and the correction table for calculating, based on the result of the comparing, in particular on the difference of the s measures, corrections stored in the correction table, - correction means connected to the correction table and connected to receive the uncorrected digital values and determining from the uncorrected digital values and the corrections corrected digital values which represent the sampled analog values more accurately than the uncorrected digital values. o 29. A parallel converter device according to claim 28, characterized in the second calculation means when calculating the corrections are arranged to determine corrections for gain and/or offset in the element device. 30. A parallel converter device comprising a plurality of element converter devices working in parallel for determining digital values from analog values successively sampled 5 from an analog signal, a comparator included in each element device to compare sampled analog values to sequence of reference values obtained from a subsequence of coarse reference values and a subsequence of fine reference levels, as generated by reference level generator, characterized in that the subsequence of coarse reference levels is generated by parts of the reference level generator which are individual to each element device and that the 0 subsequence of fine reference levels is generated a single part of the reference level generator which is common to all element devices.

Inventors: EKLUND JAN ERIK, RUDBERG MIKAEL, EKLUND, JAN, ERIK, RUDBERG, MIKAEL
Applicants: ERICSSON TELEFON AB L M, TELEFONAKTIEBOLAGET LM ERICSSON (PUBL)
Application year: 2000
Main classification: H03M1
IPC codes: H03M1