Disclosure of Invention
In order to solve the problems in the prior art, the invention provides an ADC digital background calibration method based on an intelligent optimization algorithm. The technical problems to be solved by the invention are realized by the following technical scheme:
The invention provides an ADC digital background calibration method based on an intelligent optimization algorithm, which comprises the following steps:
After receiving M groups of output data sent by the analog-to-digital converter, constructing M groups of interpolation output codes by using a Lagrange interpolation algorithm;
constructing a target optimization function according to M groups of output data and M groups of interpolation output codes, and carrying out optimization search on the target optimization function by adopting a particle swarm optimization algorithm to obtain M groups of weights, so that the mean square error between each group of output data and the corresponding interpolation output code is minimum;
And taking the average value of the M groups of weights as the optimal weight of the optimal search.
In one embodiment of the present invention, after receiving the M sets of output data sent by the analog-to-digital converter, the step of constructing M sets of interpolation output codes by using a lagrangian interpolation algorithm includes:
receiving M groups of output data sent by an analog-to-digital converter;
Determining the order of fitting interpolation by using a Lagrange interpolation algorithm: Wherein N represents that the digital output bit width of the analog-to-digital converter is N bits, Representing a downward rounding;
and constructing interpolation output codes according to the fitted interpolation orders by using a Lagrange interpolation algorithm according to each group of output data, and obtaining M groups of interpolation output codes corresponding to the M groups of output data.
In one embodiment of the present invention, before the step of constructing an interpolated output code according to the fitted interpolation order by using a lagrangian interpolation algorithm for each set of the output data, the method further includes:
And estimating the capacitance mismatch in the analog-to-digital converter, and setting an initial search range of the particle swarm optimization algorithm when each group of output data is optimally searched.
In an embodiment of the present invention, after the step of outputting the average value of the M sets of weights as the optimal weight for the current optimization search, the method further includes:
returning to the step of receiving M groups of output data sent by the analog-to-digital converter, and determining an initial search range of the particle swarm optimization algorithm when each group of output data and interpolation output codes are searched for next optimization according to the average value;
And the initial search range of the particle swarm optimization algorithm in the next optimization search is the center value of the average value.
In one embodiment of the present invention, the objective optimization function is:
where W represents the weight to be optimized, D j represents the actual output of the jth iteration of each set of output data, Representing the interpolated output, k representing the preset number of iterations for each set of output data, D j andThe dimensions of (2) are all 1×n and the dimension of W is n×1.
Compared with the prior art, the invention has the beneficial effects that:
The invention provides an ADC digital background calibration method based on an intelligent optimization algorithm, which is characterized in that an interpolation particle swarm optimization algorithm is taken as a framework to perform optimization search on a target optimization function, and the minimum mean square error between each group of output data and the corresponding interpolation output code is taken as a target to obtain the optimal weight of the optimization search, so that the precision of a successive approximation type ADC is improved, and the calibration on the ADC digital background is simply and efficiently realized.
The present invention will be described in further detail with reference to the accompanying drawings and examples.
Detailed Description
The present invention will be described in further detail with reference to specific examples, but embodiments of the present invention are not limited thereto.
Fig. 1 is a flowchart of an ADC calibration method based on an intelligent optimization algorithm according to an embodiment of the invention. As shown in fig. 1, an embodiment of the present invention provides an ADC digital background calibration method based on an intelligent optimization algorithm, including:
s1, after receiving M groups of output data sent by an analog-to-digital converter, constructing M groups of interpolation output codes by using a Lagrange interpolation algorithm;
S2, constructing a target optimization function according to the M groups of output data and the M groups of interpolation output codes, and carrying out optimization search on the target optimization function by adopting a particle swarm optimization algorithm to obtain M groups of weights, so that the mean square error between each group of output data and the corresponding interpolation output code is minimum;
And S3, taking the average value of the M groups of weights as the optimal weight of the optimal search.
Optionally, in the step S1, after receiving the M sets of output data sent by the analog-to-digital converter, a step of constructing M sets of interpolation output codes by using a lagrangian interpolation algorithm includes:
s101, receiving M groups of output data sent by an analog-to-digital converter;
s102, determining an order of fitting interpolation by using a Lagrange interpolation algorithm: wherein N represents that the digital output bit width of the analog-to-digital converter is N bits, Representing a downward rounding;
s103, constructing interpolation output codes according to the fitting interpolation orders by using a Lagrange interpolation algorithm according to each group of output data, and obtaining M groups of interpolation output codes corresponding to the M groups of output data.
Specifically, in order to make the interpolation error within 1LSB (LEAST SIGNIFICANT Bit ), the Lagrangian algorithm may be used to interpolate the data before the interpolationDetermining the order of fitting interpolation, wherein N represents the digital output bit width of the analog-to-digital converter as N bits,Representing a rounding down. Alternatively, this embodiment selectively uses an analog-to-digital converter with a digital output bit width of 12-16 bits, taking a 14bit analog-to-digital converter with a digital output bit width as an example, with a fitting interpolation order of 5.
Further, in the above step S103, for the N-bit analog-to-digital converter, lagrangian interpolation is performed on each set of output data according to the following formula:
Wherein D j represents the output data of the jth iteration in the process of optimizing and searching the output data of each group, and h j represents the preset interpolation coefficient of the jth iteration in the process of optimizing and searching the output data of each group.
Optionally, before the step of constructing the interpolation output code according to the order of fitting interpolation by using the lagrangian interpolation algorithm for each set of output data, the method further includes:
and estimating the capacitance mismatch in the analog-to-digital converter, and setting an initial search range of a particle swarm optimization algorithm during optimization search of each group of output data.
It should be understood that, estimating the mismatch of the capacitor in the ADC may be implemented by means of simulation, searching a process library file, or the like, and since the optimal search of each set of data and the interpolation output code needs to be iterated multiple times, the estimated mismatch of the capacitor may be used as a priori knowledge to set the initial search range of the particle swarm optimization algorithm when each set of data iterates for the first time.
With continued reference to fig. 1, after the step of outputting the average value of the M sets of weights as the optimal weight for the optimized search, the method further includes:
s4, returning to the step of receiving M groups of output data sent by the analog-to-digital converter, and determining an initial search range of a particle swarm optimization algorithm when each group of output data and interpolation output codes are searched for next optimization according to the average value;
The initial search range of the particle swarm optimization algorithm in the next optimization search is centered on the average value.
Optionally, the objective optimization function is:
where W represents the weight to be optimized, D j represents the actual output of the jth iteration of each set of output data, Interpolation output code representing jth iteration in the process of optimizing search of each set of output data, k representing preset iteration number in optimizing search, D j andThe dimensions of (2) are all 1×n and the dimension of W is n×1.
The above-mentioned ADC calibration method based on the intelligent optimization algorithm is further described below by taking an SAR ADC with a calibration accuracy of 14 bits as an example. As shown in fig. 2, for a 14bit SAR ADC, the lagrangian interpolation can make the error smaller than 1LSB when the order of the lagrangian interpolation is 5, so the interpolation expression is:
where h is an interpolation coefficient, h j takes 0.05, -0.3, 0.75, -0.3, and 0.05 in order.
Then, an optimized objective function is established by utilizing the interpolation output code and the output data so as to provide an error convergence criterion, wherein the specific expression of the optimized objective function is as follows:
Furthermore, the particle swarm optimization algorithm is used for solving the actual weight of the SAR ADC, and has the advantages of simple structure, easiness in implementation and the like. Specifically, the weight value of the SAR ADC is used as a searching position of the particle swarm optimization algorithm, the mismatch of the capacitor is estimated through means such as simulation and searching of a process library file, the mismatch is used as priori knowledge, and the initial searching range of the particle swarm optimization algorithm during optimization searching is set. In this embodiment, if the ratio of the mean square value sigma of the capacitance process error to the capacitance value C is 3%, the center value of the initial search range at the time of the optimal search is a set of ideal binary numbers of W' = [2 (-1) 2 (-2) 2 (-3) 2 (-4) 2 (-5) 2 (-6) 2 (-7) 2 (-8) 2 (-9) 2 (-10) 2 (-11) 2 (-12) 2 (-13) 2 (-14) ].
Illustratively, for the upper 10 bits of the digital output bit width, the search range is set to W '. + -. 20LSB, the minimum value of the lower four bits is set to 0, and the maximum value is set to W'. + -. 5LSB.
In this embodiment, the real weight of the SAR ADC is calculated by using a particle swarm optimization algorithm with linearly decreasing inertia weight, and the particle swarm optimization algorithm with linearly decreasing inertia weight can be described as follows:
vi(t+1)=wvi(t)+c1r1(pi-xi(t))+c2r2(pg-xi(t))
xi(t+1)=xi(t)+vi(t+1)
Wherein x i and v i respectively represent a position vector and a velocity vector of the ith particle, w represents an inertia weight, p i represents a local optimal position, p g represents a global optimal position, c 1 and c 2 are constants, r 1 and r 2 are random numbers between [0,1], item represents a current iteration number, item max represents a maximum iteration number, and w max and w min respectively represent a maximum value and a minimum value of the inertia weight.
The process for calculating the real weight of the SAR ADC by using the particle swarm optimization algorithm with linearly decreasing inertia weight is as follows:
(1) Parameters of the particle swarm optimization algorithm are initialized as shown in Table 1:
TABLE 1
(2) After receiving M groups of output data, taking the error between the output interpolation codes and the output data as a calibration searching object, and carrying out optimization searching by utilizing a particle swarm optimization algorithm, wherein each group of output data and the corresponding output interpolation codes can be iterated for 50 times, and each group comprises 56 output interpolation codes.
(3) After the optimization search is finished, M weights obtained through iteration are averaged to be output as optimal weights, and therefore interference of non-ideal factors such as noise can be avoided.
And then receiving M groups of data, using the optimal weight obtained by the last optimization search as the central value of the initial search range of the current optimization search, re-defining the initial search range, and then determining the optimal weight of the current optimization search through multiple iterations until the output data of the ADC is processed.
In this example, the optimal weight obtained by optimizing the search is :[0.499400 0.498688 0.250308 0.125632 0.062654 0.031070 0.015628 0.007919 0.003847 0.001993 0.001023 0.000477 0.00021 0.00011 0.00005].
Further, by performing a fast fourier transform on the output data of the ADC before and after calibration to perform performance comparison, as shown in fig. 3-4, the quantization noise before calibration is about 20dB higher than that after calibration, and specific performance index pairs are shown in table 2:
TABLE 2
| |
ENOB |
SNDR |
SFDR |
THD |
| Before calibration |
8.48bit |
52.78dB |
68.01dB |
-65.77dB |
| After calibration |
11.93bit |
73.60dB |
91.33dB |
-85.52dB |
It can be seen that the ENOB (EFFECTIVE NUMBER OF BITS, effective bit number) of the pre-calibration ADC is 8.48 bits, the ENOB after calibration is 11.93 bits, which improves by 3.45 bits, the SNDR (Signal-to-Noise-and-Distortion Ratio) of the pre-calibration ADC is 52.78dB, the SNDR after calibration is 73.60dB, which improves by 20.82dB, the SFDR (Spurious-FREE DYNAMIC RANGE ) of the pre-calibration ADC is 68.01dB, the SNDR of the pre-calibration ADC is 91.33dB, which improves by 23.32dB, the THD (Total Harmonic Distortion ) of the pre-calibration ADC is-65.77 dB, the THD after calibration is-85.52 dB, and the THD after calibration is optimized by 19.75dB. Obviously, the intelligent optimization algorithm-based method provided by the invention can be used for effectively calibrating the SAR ADC in the digital background, and various performances are improved.
According to the above embodiments, the beneficial effects of the invention are as follows:
The invention provides an ADC digital background calibration method based on an intelligent optimization algorithm, which is characterized in that an interpolation particle swarm optimization algorithm is taken as a framework to perform optimization search on a target optimization function, and the minimum mean square error between each group of output data and the corresponding interpolation output code is taken as a target to obtain the optimal weight of the optimization search, so that the precision of a successive approximation type ADC is improved, and the calibration on the ADC digital background is simply and efficiently realized.
In the description of the present invention, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present invention, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Further, one skilled in the art can engage and combine the different embodiments or examples described in this specification.
The foregoing is a further detailed description of the invention in connection with the preferred embodiments, and it is not intended that the invention be limited to the specific embodiments described. It will be apparent to those skilled in the art that several simple deductions or substitutions may be made without departing from the spirit of the invention, and these should be considered to be within the scope of the invention.