Gain error calibration method and apparatus, computer device, and medium
Patent Information
- Application Number
- CN202211444575.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-18
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2042-11-18
AI Technical Summary
[0005]鉴于上述问题,本申请实施例提供了一种增益误差的校准方法、装置、计算机设备和介质,克服了上述非易失性存储器存储量大导致芯片面积开销增大的问题
[0055] The gain error calibration method provided in this application embodiment can determine the target correction value and target correction direction corresponding to each gain error by acquiring at least two gain errors and a preset calibration reference value. The target correction value and target correction direction corresponding to each gain error are then written to non-volatile memory, facilitating gain error calibration based on these values. The correspondence between gain errors and target correction values is many-to-one, allowing multiple gain errors to share a single target correction value, thereby reducing the storage requirements of the non-volatile memory and minimizing chip area overhead.
Smart Images

Figure CN115694493B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer device, and medium for calibrating gain error. Background Technology
[0002] In the actual chip development process, due to the limitations of simulators and deviations in manufacturing processes, gain errors may exist in the analog-to-digital converter (ADC) path of the chip, which limits the accuracy of signal output.
[0003] In related technologies, error calibration is performed by selecting a correction value for the gain error of each channel. For example, a value opposite to the value of the gain error that needs to be corrected is selected for error calibration. Each channel's gain error has a corresponding correction value. After calibration, the correction value is stored in the chip's non-volatile memory for error calibration after the chip is powered on.
[0004] However, using the above method results in a larger storage capacity for non-volatile memory, increasing chip area overhead. Summary of the Invention
[0005] In view of the above problems, the embodiments of this application provide a method, apparatus, computer equipment and medium for calibrating gain error, which overcomes the problem of increased chip area overhead caused by the large storage capacity of non-volatile memory.
[0006] Firstly, a method for calibrating gain error is provided, including:
[0007] At least two gain errors are obtained, each of which corresponds to one of the at least two analog-to-digital converter (ADC) channels;
[0008] Based on at least two of the gain errors and a preset calibration reference value, a target correction value and a target correction direction are determined for each of the gain errors, wherein the correspondence between the gain error and the target correction value is many-to-one;
[0009] The target correction value and the target correction direction corresponding to each gain error are written to a non-volatile memory to calibrate the gain error according to the target correction value and the target correction direction corresponding to each gain error.
[0010] In one alternative approach, determining the target correction value corresponding to each of the gain errors based on at least two of the gain errors and a preset calibration reference value includes:
[0011] When the first target gain error is less than the preset calibration reference value, the target correction value corresponding to the first target gain error is determined based on the absolute value of the sum of the first target gain error and the target adjustment parameter.
[0012] When the second target gain error is greater than the preset calibration reference value, the target correction value corresponding to the second target gain error is determined based on the absolute value of the difference between the second target gain error and the target adjustment parameter.
[0013] In one alternative approach, determining the target correction value corresponding to the first target gain error based on the absolute value of the sum of the first target gain error and the target adjustment parameter includes:
[0014] Determine whether the absolute value of the sum of the first target gain error and the target adjustment parameter is less than a preset distance variable value;
[0015] When the absolute value of the sum is less than a preset distance variable value, the distance variable value is updated based on the absolute value of the sum;
[0016] Update the target adjustment parameter, and return to the execution to determine whether the absolute value of the sum of the first target gain error and the target adjustment parameter is less than a preset distance variable value, until the absolute value of the sum of the first target gain error and the updated target adjustment parameter is greater than or equal to the updated distance variable value;
[0017] The target correction value corresponding to the first target gain error is determined to be the previous target adjustment parameter of the updated target adjustment parameter.
[0018] In one alternative approach, determining the target correction value corresponding to the second target gain error based on the absolute value of the difference between the second target gain error and the target adjustment parameter includes:
[0019] Determine whether the absolute value of the difference between the second target gain error and the target adjustment parameter is less than a preset distance variable value;
[0020] When the absolute value of the difference is less than a preset distance variable value, the distance variable value is updated based on the absolute value of the difference;
[0021] Update the target adjustment parameter, and return to determine whether the absolute value of the difference between the second target gain error and the target adjustment parameter is less than a preset distance variable value, until the absolute value of the difference between the second target gain error and the updated target adjustment parameter is greater than or equal to the updated distance variable value;
[0022] The target correction value corresponding to the second target gain error is determined to be the previous target adjustment parameter of the updated target adjustment parameter.
[0023] In one alternative approach, determining the target correction direction corresponding to each of the gain errors based on at least two of the gain errors and a preset calibration reference value includes:
[0024] When the first target gain error is less than the preset calibration reference value, the target correction direction corresponding to the first target gain error is determined as the first direction, and the first direction is used to describe that the target correction value is a positive number.
[0025] In one alternative approach, determining the target correction direction corresponding to each of the gain errors based on at least two of the gain errors and a preset calibration reference value includes:
[0026] When the second target gain error is greater than the preset calibration reference value, the target correction direction corresponding to the second target gain error is determined as the second direction, which is used to describe the target correction value as a negative number.
[0027] In one alternative approach, it also includes:
[0028] Obtain the maximum and minimum gain errors from at least two of the said gain errors;
[0029] The target adjustment parameter is determined from the error adjustment array based on the average of the absolute values of the maximum gain error and the minimum gain error, the error adjustment array being determined based on the adjustment accuracy of the gain error and the maximum gain error.
[0030] Secondly, a gain error calibration device is provided, comprising:
[0031] An acquisition module is used to acquire at least two gain errors, each of which corresponds to one of at least two analog-to-digital converter (ADC) channels;
[0032] The determination module is used to determine the target correction value and target correction direction corresponding to each gain error based on at least two gain errors and a preset calibration reference value, wherein the correspondence between the gain error and the target correction value is many-to-one;
[0033] The writing module is used to write the target correction value and the target correction direction corresponding to each gain error to a non-volatile memory, so as to calibrate the gain error according to the target correction value and the target correction direction corresponding to each gain error.
[0034] In one alternative approach, the determining module includes: a first determining unit and a second determining unit;
[0035] The first determining unit is configured to determine a target correction value corresponding to the first target gain error based on the absolute value of the sum of the first target gain error and the target adjustment parameter when the first target gain error is less than the preset calibration reference value.
[0036] The second determining unit is used to determine the target correction value corresponding to the second target gain error based on the absolute value of the difference between the second target gain error and the target adjustment parameter when the second target gain error is greater than the preset calibration reference value.
[0037] In one alternative approach, the first determining unit is specifically used for:
[0038] Determine whether the absolute value of the sum of the first target gain error and the target adjustment parameter is less than a preset distance variable value;
[0039] When the absolute value of the sum is less than a preset distance variable value, the distance variable value is updated based on the absolute value of the sum;
[0040] Update the target adjustment parameter, and return to the execution to determine whether the absolute value of the sum of the first target gain error and the target adjustment parameter is less than a preset distance variable value, until the absolute value of the sum of the first target gain error and the updated target adjustment parameter is greater than or equal to the updated distance variable value;
[0041] The target correction value corresponding to the first target gain error is determined to be the previous target adjustment parameter of the updated target adjustment parameter.
[0042] In one alternative approach, the second determining unit is specifically used for:
[0043] Determine whether the absolute value of the difference between the second target gain error and the target adjustment parameter is less than a preset distance variable value;
[0044] When the absolute value of the difference is less than a preset distance variable value, the distance variable value is updated based on the absolute value of the difference;
[0045] Update the target adjustment parameter, and return to determine whether the absolute value of the difference between the second target gain error and the target adjustment parameter is less than a preset distance variable value, until the absolute value of the difference between the second target gain error and the updated target adjustment parameter is greater than or equal to the updated distance variable value;
[0046] The target correction value corresponding to the second target gain error is determined to be the previous target adjustment parameter of the updated target adjustment parameter.
[0047] In one alternative approach, the first determining unit is specifically used for:
[0048] When the first target gain error is less than the preset calibration reference value, the target correction direction corresponding to the first target gain error is determined as the first direction, and the first direction is used to describe that the target correction value is a positive number.
[0049] In one alternative approach, the second determining unit is specifically used for:
[0050] When the second target gain error is greater than the preset calibration reference value, the target correction direction corresponding to the second target gain error is determined as the second direction, which is used to describe the target correction value as a negative number.
[0051] In an alternative embodiment, the acquisition module is further configured to acquire the maximum gain error and the minimum gain error among at least two of the said gain errors;
[0052] The determining module is further configured to determine a target adjustment parameter from an error adjustment array based on the average of the absolute values of the maximum gain error and the minimum gain error, the error adjustment array being determined based on the adjustment accuracy of the gain error and the maximum gain error.
[0053] Thirdly, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the gain error calibration method as described in any of the above embodiments.
[0054] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the gain error calibration method as described in any of the above embodiments.
[0055] The gain error calibration method provided in this application embodiment can determine the target correction value and target correction direction corresponding to each gain error by acquiring at least two gain errors and a preset calibration reference value. The target correction value and target correction direction corresponding to each gain error are then written to non-volatile memory, facilitating gain error calibration based on these values. The correspondence between gain errors and target correction values is many-to-one, allowing multiple gain errors to share a single target correction value, thereby reducing the storage requirements of the non-volatile memory and minimizing chip area overhead.
[0056] The above description is merely an overview of the technical solutions of the embodiments of this application. In order to better understand the technical means of the embodiments of this application and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of this application more obvious and understandable, specific implementation methods of this application are described below. Attached Figure Description
[0057] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 This is a flowchart illustrating a gain error calibration method provided in this embodiment;
[0059] Figure 2A This is a schematic diagram of an error distribution provided in this embodiment;
[0060] Figure 2B This is a schematic diagram of gain error calibration provided in this embodiment;
[0061] Figure 3 This is a schematic diagram of the structure of a gain error calibration device provided in this embodiment;
[0062] Figure 4 This is a schematic diagram of the structure of a computer device provided in this embodiment. Detailed Implementation
[0063] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0064] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims and drawings of this application are intended to cover non-exclusive inclusion.
[0065] The term "embodiment" as used herein means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of the phrase "embodiment" in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0066] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists, A and B exist simultaneously, or B exists. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0067] Furthermore, the terms "first," "second," etc., in the specification and claims of this application or in the aforementioned drawings are used to distinguish different objects rather than to describe a specific order, and may explicitly or implicitly include one or more of the features.
[0068] In the description of this application, unless otherwise stated, "multiple" means two or more (including two), and similarly, "multiple groups" means two or more (including two groups).
[0069] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0070] Currently, the amount of non-volatile memory required for gain error calibration is mainly determined by simulation and process deviations to determine the maximum absolute value MAX and the minimum positive scale Step, thus determining the number of bits in the non-volatile memory.
[0071] For example, the required number of bits Num is determined by MAX / Step. The correction of gain error needs to consider both positive and negative deviations. Then, the final number of bits for an ADC channel is N = ([log2(Num)] + 1) bits. For a multi-channel ADC, when the number of ADC channels is C, the total number of bits of non-volatile memory required is C*N bits.
[0072] In the above implementation, each ADC channel stores a corresponding correction value in non-volatile memory, which increases the storage capacity of non-volatile memory and increases chip area overhead.
[0073] To address the aforementioned issues, this embodiment provides a gain error calibration method that enables multiple ADC channels to share a single correction value, effectively solving the problem of large storage requirements in non-volatile memory and thereby reducing chip area overhead. Figure 1 As shown.
[0074] Figure 1 The following is a flowchart illustrating a gain error calibration method provided in this embodiment. The gain error calibration method may include the following:
[0075] S110, Obtain at least two gain errors.
[0076] Each gain error corresponds to one of the at least two analog-to-digital converter (ADC) channels. In other words, the correspondence between ADC channels and gain errors is one-to-one, with one ADC channel corresponding to one gain error.
[0077] The gain error of multiple ADC channels can be measured separately using automatic test equipment (ATE). For example, when the number of ADC channels is C, the gain error of channels 1 to C can be measured separately using ATE.
[0078] S120. Based on at least two gain errors and a preset calibration reference value, determine the target correction value and target correction direction corresponding to each gain error.
[0079] The preset calibration reference value is the ideal value after the gain error is calibrated. For example, the calibration reference value can be set to 0. It can be understood that, under ideal conditions, the gain error of each ADC channel is calibrated to 0 as much as possible, thereby ensuring the accuracy of the ADC channel output signal.
[0080] The target correction direction can be used to characterize the sign of the target correction value. Specifically, the target correction direction can include a positive direction and a negative direction. A positive direction indicates that the ADC channel corresponding to the target correction value needs to be calibrated in the positive direction; a negative direction indicates that the ADC channel corresponding to the target correction value needs to be calibrated in the negative direction. Here, the positive and negative directions are two opposite directions.
[0081] The correspondence between gain error and target correction value is many-to-one. Among the gain errors corresponding to multiple ADC channels, there are at least two gain errors that correspond to the same target correction value, that is, at least two gain errors that correspond to the same target correction value.
[0082] S130. Write the target correction value and target correction direction corresponding to each gain error to the non-volatile memory.
[0083] When at least two target correction values corresponding to gain errors are equal, the non-volatile memory writing process can write only one target correction value, thereby effectively reducing the storage capacity of the non-volatile memory.
[0084] By writing the target correction value and target correction direction corresponding to each gain error into non-volatile memory, the chip containing non-volatile memory can calibrate the gain error according to the target correction value and target correction direction corresponding to each gain error after power-on.
[0085] For example, if the first gain error corresponding to an ADC channel is -1.0, the target correction value is 0.5, and the target correction direction is positive, the first gain error is calibrated by correcting -1.0 to 0.5 in the positive direction. After the correction, the corrected result of the first gain error is -0.5. If the second gain error corresponding to another ADC channel is 0.7, the target correction value is 0.3, and the target correction direction is negative, the second gain error is calibrated by correcting 0.7 to 0.3 in the negative direction. After the correction, the corrected result of the second gain error is 0.4.
[0086] In this embodiment, by acquiring at least two gain errors and a preset calibration reference value, the target correction value and target correction direction corresponding to each gain error can be determined. The target correction value and target correction direction corresponding to each gain error are then written to non-volatile memory, facilitating gain error calibration based on these values. The correspondence between gain errors and target correction values is many-to-one, allowing multiple gain errors to share a single target correction value, thereby reducing the number of non-volatile memories and minimizing chip area overhead.
[0087] Based on the description of the above embodiments, this embodiment can also determine an updatable target adjustment parameter as the error adjustment parameter corresponding to multiple gain errors.
[0088] The method in this embodiment also includes:
[0089] Obtain the maximum and minimum gain errors from at least two gain errors; determine the target adjustment parameter from the error adjustment array based on the average of the absolute values of the maximum and minimum gain errors, the error adjustment array being determined based on the adjustment accuracy of the gain errors and the maximum gain error.
[0090] Specifically, the target adjustment parameter is determined from the error adjustment array based on the average of the absolute values of the maximum gain error and the minimum gain error. The error adjustment array is determined based on the adjustment accuracy of the gain error and may include: finding the adjustment value closest to the average of the absolute values of the maximum gain error and the minimum gain error from the error adjustment array as the target adjustment parameter.
[0091] The error adjustment array can be determined by the adjustment precision of the gain error and the maximum gain error. The adjustment precision of the gain error can be set according to the actual adjustment requirements, and this disclosure does not make specific limitations on it.
[0092] For example, the gain error adjustment precision is set to S=4, the maximum gain error is GE=1, and the error adjustment array TRIM_ARRAY[j](j=0,...,(2 S -1))=TRIM_ARRAY[j]=GE*((j+1) / (2 S ), that is, TRIM_ARRAY[j](j=0,...,15)=(j+1) / (2 4 ),in,
[0093] When the maximum gain error Max (same as GE above) is 1 and the minimum gain error Min is -0.5, the average of the absolute values of the maximum gain error Max and the minimum gain error Min [abs(Max)+abs(Min)] / 2 = 0.75, and the error adjustment array TRIM_ARRAY[j](j=0,...,15) = (j+1) / (2 4 The adjustment value closest to 0.75 in the range is... Then The target adjustment parameter is determined (i.e., NS_TRIM[0]).
[0094] It should be noted that the target adjustment parameters determined here are the initial parameters that have not been updated. The first update to the target adjustment parameters will be based on the initial parameters that have not been updated. The update is performed, and subsequent parameter updates are based on the current target adjustment parameters.
[0095] Therefore, by adjusting the gain error accuracy and the maximum gain error, an error adjustment array is determined as the target adjustment parameter for correcting the gain error, so as to effectively correct the gain error.
[0096] After determining the target adjustment parameters, the target correction value for the gain error can be determined by combining the relationship between the target adjustment parameters and the gain error.
[0097] In some embodiments, determining a target correction value for each gain error based on at least two gain errors and a preset calibration reference value may include:
[0098] When the first target gain error is less than the preset calibration reference value, the target correction value corresponding to the first target gain error is determined based on the absolute value of the sum of the first target gain error and the target adjustment parameter; when the second target gain error is greater than the preset calibration reference value, the target correction value corresponding to the second target gain error is determined based on the absolute value of the difference between the second target gain error and the target adjustment parameter.
[0099] At least two gain errors can be recorded using an array GO[i] (i = 0...(C-1)), where C is the number of ADC channels.
[0100] The first target gain error can be any one of at least two gain errors, GO[i], and the second target gain error can be any one of at least two gain errors, GO[i].
[0101] The target correction value can be determined separately based on the relationship between the gain error and the preset calibration reference value, which makes it easier to determine the target correction value that matches the gain error.
[0102] The determination of the target correction value corresponding to the first target gain error based on the absolute value of the sum of the first target gain error and the target adjustment parameter may include:
[0103] The process involves determining whether the absolute value of the sum of the first target gain error and the target adjustment parameter is less than a preset distance variable value. If the absolute value is less than the preset distance variable value, the distance variable value is updated based on the absolute value of the sum. The target adjustment parameter is then updated, and the process returns to determine whether the absolute value of the sum of the first target gain error and the target adjustment parameter is less than the preset distance variable value, until the absolute value of the sum of the first target gain error and the updated target adjustment parameter is greater than or equal to the updated distance variable value. Finally, the target correction value corresponding to the first target gain error is determined to be the previous target adjustment parameter of the updated target adjustment parameter. This facilitates the accurate determination of the target adjustment parameter corresponding to the first target gain error.
[0104] For example, the process of determining the target correction value corresponding to the first target gain error is illustrated below.
[0105]
[0106] Here, dis_zero_tmp is a preset distance variable value, which is a pre-set variable value used for the first comparison. The preset distance variable value can be the maximum gain value GE.
[0107] When updating the distance variable value, the absolute value abs(GO[i]+NS_TRIM[k] of the sum of the first target gain error and the target adjustment parameter may be assigned to the distance variable value dis_zero_tmp, that is, dis_zero_tmp=abs(GO[i]+NS_TRIM[k]). Wherein, when the preset distance variable value is not updated, the parameter k=0. With reference to the foregoing example, when the first target gain error is the first gain error GO[0], dis_zero_tmp=abs(GO[0]+NS_TRIM[0]).
[0108] When updating the target adjustment parameter, the update may be performed according to the ratio of the current target adjustment parameter to a preset numerical value. For example, after NS_TRIM[0] is updated, the updated target adjustment parameter NS_TRIM[1] is obtained, where NS_TRIM[1]=NS_TRIM[0] / 2. With reference to the foregoing example, when , Similarly, NS_TRIM[2^(M-1)]=NS_TRIM[2^(M)] / 2, where M is the correction bit of the target adjustment value.
[0109] The target correction value GOGE[i] of the first gain error=NS_TRIM[get_near_zero], k is a variation factor of the target adjustment parameter. Every time the condition if(abs(GO[i]+NS_TRIM[k])<dis_zero_tmp) is satisfied, k=k+1, and get_near_zero is a value k[m-1] previous to the currently traversed parameter k[m].
[0110] Determining a target correction direction corresponding to each gain error according to at least two gain errors and a preset calibration reference value comprises:
[0111] when the first target gain error is less than the preset calibration reference value, determining that the target correction direction corresponding to the first target gain error is a first direction, wherein the first direction is used to describe that the target correction value is a positive number.
[0112] Wherein, when the first target gain error is less than the preset calibration reference value, for the calibration reference value 0, it indicates that the first target gain error needs to be corrected in the positive direction to get closer to 0, which facilitates accurate correction of the gain error.
[0113] For example, when the first target gain error GO[i] is less than the calibration reference value 0, the target correction direction corresponding to the first target gain error is determined as follows.
[0114]
[0115] TRIM_DR[i] = 0 indicates that the target correction direction is positive.
[0116] The determination of the target correction value corresponding to the second target gain error based on the absolute value of the difference between the second target gain error and the target adjustment parameter may include:
[0117] Determine whether the absolute value of the difference between the second target gain error and the target adjustment parameter is less than the preset distance variable value;
[0118] When the absolute value of the difference is less than a preset distance variable value, the distance variable value is updated based on the absolute value of the difference; the target adjustment parameter is updated, and the process returns to determine whether the absolute value of the difference between the second target gain error and the target adjustment parameter is less than the preset distance variable value, until the absolute value of the difference between the second target gain error and the updated target adjustment parameter is greater than or equal to the updated distance variable value; the target correction value corresponding to the second target gain error is determined to be the previous target adjustment parameter of the updated target adjustment parameter. This facilitates the accurate determination of the target adjustment parameter corresponding to the second target gain error.
[0119] For example, the process of determining the target correction value corresponding to the second target gain error is illustrated below.
[0120]
[0121]
[0122] Here, dis_zero_tmp is a preset distance variable value, which is a pre-set variable value used for the first comparison. The preset distance variable value can be the maximum gain value GE.
[0123] When updating the distance variable value, the absolute value of the difference between the second target gain error and the target adjustment parameter, abs(GO[i]-NS_TRIM[k]), can be assigned to the distance variable value dis_zero_tmp, where dis_zero_tmp = abs(GO[i]-NS_TRIM[k]). When the preset distance variable value is not updated, parameter k = 0. Referring to the example above, when the second target gain error is the first gain error GO[0], dis_zero_tmp = abs(GO[0]-NS_TRIM[0]).
[0124] When updating the target adjustment parameter, it can be updated according to the ratio of the current target adjustment parameter to the preset value. For example, after updating NS_TRIM[0], the updated target adjustment parameter NS_TRIM[1] is obtained, and NS_TRIM[1] = NS_TRIM[0] / 2. Combining the above example, in hour, Similarly, NS_TRIM[2^(M-1)]=NS_TRIM[2^(M)] / 2, where M is the correction bit of the target adjustment value.
[0125] The target correction value GOGE[i] for the second gain error=NS_TRIM[get_near_zero], k is the variation factor of the target adjustment parameter. Once if(abs(GO[i]-NS_TRIM[k])<dis_zero_tmp) holds, k=k+1, and get_near_zero is the previous value k[m-1] of the currently traversed parameter k[m].
[0126] According to at least two gain errors and a preset calibration reference value, determining the target correction direction corresponding to each gain error comprises:
[0127] When the second target gain error is greater than the preset calibration reference value, determining that the target correction direction corresponding to the second target gain error is a second direction, where the second direction is used to describe that the target correction value is a negative number.
[0128] Wherein, when the second target gain error is greater than the preset calibration reference value, with the calibration reference value being 0, it indicates that the second target gain error needs to be corrected in the opposite direction to get closer to 0, which facilitates accurate correction of the gain error.
[0129] For example, when the second target gain error GO[i] is greater than the calibration reference value 0, the target correction direction corresponding to the second target gain error is determined as follows.
[0130]
[0131] TRIM_DR[i]=1 indicates that the target correction direction is the opposite direction.
[0132] As shown in Figure 2A , the gain error distribution of multiple channels can be shown as error distribution 1, error distribution 2, error distribution 3, error distribution 4, error distribution 5 and error distribution 6, wherein error distribution 1 is taken as an example to illustrate the determination of the target correction value and the target correction direction.
[0133] Assume the number of channels C=5, the maximum gain value GE=1, the adjustment accuracy of gain error S=4, the error adjustment array TRIM_ARRAY[j] (j=0,...,15)=(j+1) / (2 4 ), GO[i] (i=0,1,2,3,4)=[-1.0,-0.8,-0.5,0.8,1.0], which is obtained based on the above determination process.
[0134]
[0135] GH[0] is the gain error of GO[0] after calibration, GH[1] is the gain error of GO[1] after calibration, GH[2] is the gain error of GO[2] after calibration, GH[3] is the gain error of GO[3] after calibration, and GH[4] is the gain error of GO[4] after calibration.
[0136] A plurality of gain errors shown in error distribution 1 are calibrated, and the calibrated error distribution is as shown in Figure 2B .
[0137] In this embodiment, the storage capacity of the non-volatile memory required for gain error calibration is (S+C*M) bits. Compared with the storage capacity C*N bits of the non-volatile memory in the prior art, in practical applications, S≤N and M<N. Assuming S takes the maximum value N, (C-1) / C≥M / N can be obtained. As the number of channels C increases, M has more solutions. It can be concluded that as the number of channels increases, this embodiment can significantly reduce the storage capacity of the non-volatile memory.
[0138] Figure 3 is a schematic structural diagram of a gain error calibration apparatus provided in this embodiment, wherein the gain error calibration apparatus comprises: an acquisition module 310, a determination module 320 and a writing module 330.
[0139] The acquisition module 310 is configured to acquire at least two gain errors, each of the gain errors corresponds to one ADC channel among at least two analog-to-digital converter (ADC) channels.
[0140] The determination module 320 is configured to determine a target correction value and a target correction direction corresponding to each gain error according to the at least two gain errors and a preset calibration reference value, wherein the correspondence between the gain errors and the target correction values is many-to-one.
[0141] The writing module 330 is configured to write the target correction value and the target correction direction corresponding to each gain error into a non-volatile memory, so as to calibrate the gain error according to the target correction value and the target correction direction corresponding to each gain error.
[0142] In some embodiments, optionally, the determination module 320 comprises: a first determination unit and a second determination unit.
[0143] The first determination unit is configured to, when a first target gain error is less than the preset calibration reference value, determine the target correction value corresponding to the first target gain error according to an absolute value of a sum of the first target gain error and a target adjustment parameter.
[0144] The second determining unit is used to determine the target correction value corresponding to the second target gain error based on the absolute value of the difference between the second target gain error and the target adjustment parameter when the second target gain error is greater than the preset calibration reference value.
[0145] In some embodiments, optionally, the first determining unit is specifically used for:
[0146] Determine whether the absolute value of the sum of the first target gain error and the target adjustment parameter is less than a preset distance variable value; if the absolute value of the sum is less than the preset distance variable value, update the distance variable value based on the absolute value of the sum; update the target adjustment parameter, and return to determine whether the absolute value of the sum of the first target gain error and the target adjustment parameter is less than the preset distance variable value, until the absolute value of the sum of the first target gain error and the updated target adjustment parameter is greater than or equal to the updated distance variable value; determine that the target correction value corresponding to the first target gain error is the previous target adjustment parameter of the updated target adjustment parameter.
[0147] In some embodiments, optionally, the second determining unit is specifically used for:
[0148] Determine whether the absolute value of the difference between the second target gain error and the target adjustment parameter is less than a preset distance variable value; if the absolute value of the difference is less than the preset distance variable value, update the distance variable value based on the absolute value of the difference; update the target adjustment parameter, and return to determine whether the absolute value of the difference between the second target gain error and the target adjustment parameter is less than the preset distance variable value, until the absolute value of the difference between the second target gain error and the updated target adjustment parameter is greater than or equal to the updated distance variable value; determine that the target correction value corresponding to the second target gain error is the previous target adjustment parameter of the updated target adjustment parameter.
[0149] In some embodiments, optionally, the first determining unit is specifically used for:
[0150] When the first target gain error is less than the preset calibration reference value, the target correction direction corresponding to the first target gain error is determined as the first direction, and the first direction is used to describe that the target correction value is a positive number.
[0151] In some embodiments, optionally, the second determining unit is specifically used for:
[0152] When the second target gain error is greater than the preset calibration reference value, the target correction direction corresponding to the second target gain error is determined as the second direction, which is used to describe the target correction value as a negative number.
[0153] In some embodiments, optionally, the acquisition module is further configured to acquire the maximum gain error and the minimum gain error among at least two of the gain errors; the determination module is further configured to determine a target adjustment parameter from an error adjustment array based on the average of the absolute values of the maximum gain error and the minimum gain error, the error adjustment array being determined based on the adjustment accuracy of the gain error and the maximum gain error.
[0154] The gain error calibration device provided in this embodiment can determine the target correction value and target correction direction corresponding to each gain error by acquiring at least two gain errors and a preset calibration reference value. It then writes the target correction value and target correction direction corresponding to each gain error into a non-volatile memory, facilitating gain error calibration based on these values. The correspondence between gain errors and target correction values is many-to-one, allowing multiple gain errors to share a single target correction value, thereby reducing the storage requirements of the non-volatile memory and minimizing chip area overhead.
[0155] This application also provides a computer device. Please refer to the following for details. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0156] The computer device includes a memory 410 and a processor 420 that are interconnected via a system bus. It should be noted that only a computer device with components 410-420 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components may be implemented alternatively. Those skilled in the art will understand that the computer device described herein is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0157] Computer devices can include desktop computers, laptops, handheld computers, and cloud servers. These devices allow for human-computer interaction with users through keyboards, mice, remote controls, touchpads, or voice-activated devices.
[0158] The memory 410 includes at least one type of readable storage medium, including non-volatile memory or volatile memory, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. RAM may include static RAM or dynamic RAM. In some embodiments, the memory 410 may be an internal storage unit of a computer device, such as the hard disk or memory of the computer device. In other embodiments, the memory 410 may also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, or flash card equipped on the computer device. Of course, the memory 410 may include both internal storage units and external storage devices of the computer device. In this embodiment, the memory 410 is typically used to store the operating system and various application software installed on the computer device, such as the program code of the method described above. In addition, the memory 410 may also be used to temporarily store various types of data that have been output or will be output.
[0159] Processor 420 is typically used to perform overall operations of a computer device. In this embodiment, memory 410 is used to store program code or instructions, including computer operation instructions, and processor 420 is used to execute the program code or instructions stored in memory 410 or process data, such as program code that runs the methods described above.
[0160] In this article, the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus system can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0161] Another embodiment of this application also provides a computer-readable medium, which may be a computer-readable signal medium or a computer-readable medium. A processor in a computer reads computer-readable program code stored in the computer-readable medium, enabling the processor to execute the functional actions specified in each step or combination of steps in the above method; and to generate means for implementing the functional actions specified in each block or combination of blocks in the block diagram.
[0162] Computer-readable media include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared memory or semiconductor systems, devices or apparatuses, or any suitable combination thereof, wherein the memory is used to store program code or instructions, the program code including computer operation instructions, and the processor is used to execute the program code or instructions of the above-described methods stored in the memory.
[0163] The definitions of memory and processor can be found in the description of the foregoing computer device embodiments, and will not be repeated here.
[0164] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0165] In the various embodiments of this application, the functional units or modules can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0166] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0167] In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" as described in this application does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims listing several means, several units of these means may be embodied by the same item of hardware. The use of "first," "second," and "third," etc., does not indicate any order and these words should be interpreted as names. Unless otherwise specified, the steps in the above embodiments should not be construed as limiting the order of execution.
[0168] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for calibrating gain error, characterized in that, include: At least two gain errors are obtained, each of which corresponds to one of at least two analog-to-digital converter (ADC) channels; Based on at least two of the gain errors and a preset calibration reference value, determine the target correction value and target correction direction corresponding to each of the gain errors; The correspondence between the gain error and the target correction value is many-to-one. Among the gain errors corresponding to at least two of the ADC channels, there are at least two target correction values corresponding to the gain errors that are equal. The target correction value and the target correction direction corresponding to each gain error are written to a non-volatile memory to calibrate the gain error according to the target correction value and the target correction direction corresponding to each gain error; wherein, when there are at least two target correction values corresponding to the gain errors that are equal, the equal target correction values are written to one of the non-volatile memory. The step of determining the target correction value corresponding to each gain error based on at least two gain errors and a preset calibration reference value includes: When the first target gain error is less than the preset calibration reference value, the target correction value corresponding to the first target gain error is determined based on the absolute value of the sum of the first target gain error and the target adjustment parameter. When the second target gain error is greater than the preset calibration reference value, the target correction value corresponding to the second target gain error is determined based on the absolute value of the difference between the second target gain error and the target adjustment parameter. The method for determining the target adjustment parameter includes: Obtain the maximum and minimum gain errors from at least two of the said gain errors; The target adjustment parameter is determined by the adjustment value in the error adjustment array that is closest to the average of the absolute values of the maximum gain error and the minimum gain error, based on the average of the absolute values of the maximum gain error and the minimum gain error; the error adjustment array is determined based on the adjustment accuracy of the gain error and the maximum gain error.
2. The method according to claim 1, characterized in that, The step of determining the target correction value corresponding to the first target gain error based on the absolute value of the sum of the first target gain error and the target adjustment parameter includes: Determine whether the absolute value of the sum of the first target gain error and the target adjustment parameter is less than a preset distance variable value; When the absolute value of the sum is less than a preset distance variable value, the distance variable value is updated based on the absolute value of the sum; Update the target adjustment parameter, and return to the execution to determine whether the absolute value of the sum of the first target gain error and the target adjustment parameter is less than a preset distance variable value, until the absolute value of the sum of the first target gain error and the updated target adjustment parameter is greater than or equal to the updated distance variable value; The target correction value corresponding to the first target gain error is determined to be the previous target adjustment parameter of the updated target adjustment parameter.
3. The method according to claim 1, characterized in that, Determining the target correction value corresponding to the second target gain error based on the absolute value of the difference between the second target gain error and the target adjustment parameter includes: Determine whether the absolute value of the difference between the second target gain error and the target adjustment parameter is less than a preset distance variable value; When the absolute value of the difference is less than a preset distance variable value, the distance variable value is updated based on the absolute value of the difference; Update the target adjustment parameter, and return to determine whether the absolute value of the difference between the second target gain error and the target adjustment parameter is less than a preset distance variable value, until the absolute value of the difference between the second target gain error and the updated target adjustment parameter is greater than or equal to the updated distance variable value; The target correction value corresponding to the second target gain error is determined to be the previous target adjustment parameter of the updated target adjustment parameter.
4. The method according to claim 1, characterized in that, The step of determining the target correction direction corresponding to each gain error based on at least two gain errors and a preset calibration reference value includes: When the first target gain error is less than the preset calibration reference value, the target correction direction corresponding to the first target gain error is determined as the first direction, and the first direction is used to describe that the target correction value is a positive number.
5. The method according to claim 1, characterized in that, The step of determining the target correction direction corresponding to each gain error based on at least two gain errors and a preset calibration reference value includes: When the second target gain error is greater than the preset calibration reference value, the target correction direction corresponding to the second target gain error is determined as the second direction, which is used to describe the target correction value as a negative number.
6. A gain error calibration device, characterized in that, include: An acquisition module is used to acquire at least two gain errors, each of which corresponds to one of at least two analog-to-digital converter (ADC) channels; The determination module is used to determine the target correction value and target correction direction corresponding to each gain error based on at least two gain errors and a preset calibration reference value. The correspondence between the gain error and the target correction value is many-to-one. Among the gain errors corresponding to at least two ADC channels, at least two of the gain errors have the same target correction value. The writing module is used to write the target correction value and the target correction direction corresponding to each gain error to a non-volatile memory, so as to calibrate the gain error according to the target correction value and the target correction direction corresponding to each gain error; wherein, when there are at least two target correction values corresponding to the gain errors that are equal, the equal target correction values are written to one of the non-volatile memory. The determination module is specifically used for: When the first target gain error is less than the preset calibration reference value, the target correction value corresponding to the first target gain error is determined based on the absolute value of the sum of the first target gain error and the target adjustment parameter. When the second target gain error is greater than the preset calibration reference value, the target correction value corresponding to the second target gain error is determined based on the absolute value of the difference between the second target gain error and the target adjustment parameter. The method for determining the target adjustment parameter includes: Obtain the maximum and minimum gain errors from at least two of the said gain errors; The target adjustment parameter is determined by the adjustment value in the error adjustment array that is closest to the average of the absolute values of the maximum gain error and the minimum gain error, based on the average of the absolute values of the maximum gain error and the minimum gain error; the error adjustment array is determined based on the adjustment accuracy of the gain error and the maximum gain error.
7. A computer device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the gain error calibration method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the gain error calibration method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Digital to analog converter with shared calibration
US20070296618A1
Calibration of a time-interleaved analog-to-digital converter (ADC) circuit
US9088293B1