CN111934636B - Attenuator calibration device and method - Google Patents

Attenuator calibration device and method Download PDF

Info

Publication number
CN111934636B
CN111934636B CN202010982800.3A CN202010982800A CN111934636B CN 111934636 B CN111934636 B CN 111934636B CN 202010982800 A CN202010982800 A CN 202010982800A CN 111934636 B CN111934636 B CN 111934636B
Authority
CN
China
Prior art keywords
power
code word
preset
attenuator
digital
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010982800.3A
Other languages
Chinese (zh)
Other versions
CN111934636A (en
Inventor
黄炎
彭晓林
陈锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Siglent Technologies Co Ltd
Original Assignee
Shenzhen Siglent Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Siglent Technologies Co Ltd filed Critical Shenzhen Siglent Technologies Co Ltd
Priority to CN202010982800.3A priority Critical patent/CN111934636B/en
Publication of CN111934636A publication Critical patent/CN111934636A/en
Application granted granted Critical
Publication of CN111934636B publication Critical patent/CN111934636B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03HIMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
    • H03H7/00Multiple-port networks comprising only passive electrical elements as network components
    • H03H7/24Frequency- independent attenuators
    • H03H7/25Frequency- independent attenuators comprising an element controlled by an electric or magnetic variable

Abstract

The invention discloses a calibration device and a method of an attenuator, wherein the difference value of the power of the output signals of the attenuator corresponding to two adjacent code words of a digital-to-analog converter is respectively compared with a preset range, wherein the lower limit of the preset range is a preset power lower limit value, the upper limit of the preset range is a preset power upper limit value, the code words of the digital-to-analog converter are changed by adopting different code word steps to change the power distribution of the output signals of the attenuator according to the magnitude relation between the difference value of the power of the output signals of the attenuator corresponding to two adjacent code words and the preset power lower limit value and the preset power upper limit value, and the power of the output signals of the attenuator used for fitting a calibration curve and the corresponding code words are obtained by adopting different modes, so that the distribution of the measurement data used for fitting the calibration curve of the attenuator is more reasonable, and the.

Description

Attenuator calibration device and method
Technical Field
The invention relates to the technical field of attenuators, in particular to a device and a method for calibrating an attenuator.
Background
The attenuator is an electronic component providing attenuation, is widely applied to electronic equipment, and has the characteristic of adjustable attenuation, so that when the equipment excitation source outputs a signal with constant power, the attenuator is connected, and then the attenuation of the attenuator is adjusted, so that signals with different powers are output.
The attenuator generally adjusts the attenuation amount by outputting voltages with different magnitudes through a digital-to-analog converter, wherein the larger the voltage output by the digital-to-analog converter is, the larger the attenuation amount of the attenuator is, and the digital-to-analog converter controls the magnitude of the output voltage by configuring different code words for the digital-to-analog converter, and the larger the code word configured by the digital-to-analog converter corresponds to the larger the output voltage of the digital-to-analog converter. Before leaving the factory, a general manufacturer calibrates the attenuator produced, that is, obtains a calibration curve of the attenuator at different frequencies, which indicates a corresponding relationship between the power of the output signal of the attenuator at different frequencies and a codeword configured by the digital-to-analog converter, so that a user can search the codeword corresponding to the power on the calibration curve according to the power of the output signal of the attenuator required by the user when using the attenuator.
When the output power of the excitation source is constant at a certain frequency, the conventional attenuator calibration method is to change the codeword of the digital-to-analog converter with a fixed step value from 0, control the digital-to-analog converter to output different voltages by changing the codeword of the digital-to-analog converter, so as to control the attenuator to attenuate the signal output by the excitation source with different attenuation amounts, and then measure the power of the output signal of the attenuator each time by using a power meter, however, in order to ensure the calibration accuracy, it is usually required to ensure that the difference between the powers of the output signals of the attenuators corresponding to adjacent codewords is smaller than a constant value, when the codeword of the digital-to-analog converter is changed by using the fixed step value, if the difference between the powers of the output signals of the attenuators corresponding to adjacent codewords is larger than the constant value, the step value of the codeword/10 is required to reduce the step value of the, and recording the corresponding code word and the power of the output signal of the attenuator, and so on to obtain the power of the output signal of the attenuator and the corresponding data of the code word under a certain frequency, and then obtaining a calibration curve under a certain frequency by utilizing polynomial fitting. Because the attenuation curve of the attenuator is very gentle in two stages when the code word is small or is close to the upper limit value of the attenuator, if the code word is configured by taking a constant value as the upper limit value, the power output by the attenuator is not measured at the position where the attenuation curve is gentle due to the fact that the constant value acting on the upper limit value is relatively large, and therefore the error of the fitted calibration curve is too large when the code word is large or small, and the calibration accuracy of the attenuator is low. And, when the difference in the power of the attenuator output signals corresponding to adjacent codewords is greater than a constant value, the process required to reduce the codeword step value by a step of fixed step value/10 is long.
Disclosure of Invention
The invention mainly solves the technical problem of how to improve the accuracy of attenuator calibration.
According to a first aspect, there is provided in an embodiment a method of calibrating an attenuator, comprising:
the method comprises the steps that a code word of a digital-to-analog converter used for controlling the attenuation amount in an attenuator is obtained, the attenuator is used for attenuating the power of a signal with constant power under a preset frequency according to the attenuation amount, and the code word size of the digital-to-analog converter is positively correlated with the attenuation amount;
acquiring a preset code word stepping value, and changing the code word of the digital-to-analog converter according to the preset code word stepping value so that the attenuator attenuates the power of the received signal according to different attenuation amounts and outputs signals with different powers;
acquiring a difference value of the power of the output signal of the attenuator corresponding to two adjacent code words of the digital-to-analog converter, and judging the magnitude relation between the difference value of the power of the output signal and a preset power upper limit value and a preset power lower limit value respectively, wherein the preset power upper limit value is larger than the preset power lower limit value;
when the difference value of the power of the output signals is judged to be smaller than a preset power lower limit value, changing the code words of the digital-to-analog converter in a first code word stepping mode;
when the difference value of the power of the output signals is judged to be larger than or equal to a preset power lower limit value and smaller than a preset power upper limit value, changing the code word of the digital-to-analog converter in a first code word stepping mode, and acquiring the power of the signals currently output by the attenuator and the code word corresponding to the power in a preset mode;
when the difference value of the power of the output signals is judged to be larger than the preset power upper limit value, changing the code word of the digital-to-analog converter in a second code word stepping mode, and acquiring the power of the signals currently output by the attenuator and the code word corresponding to the power in a preset mode;
and fitting a corresponding relation curve of the power of the signal output by the attenuator and the code words corresponding to each power according to the power of the signal output by the attenuator under the preset frequency and the code words corresponding to each power, so as to obtain a calibration curve of the attenuator under the preset frequency.
According to a second aspect, an embodiment provides an attenuator calibration apparatus, including:
a digital-to-analog converter;
the attenuator is used for receiving a signal with constant power under a preset frequency, determining an attenuation amount according to a code word of the digital-to-analog converter, attenuating the power of the received signal according to the attenuation amount and then outputting the attenuated signal, wherein the code word size of the digital-to-analog converter is positively correlated with the attenuation amount size;
the controller is used for acquiring a preset code word stepping value, changing the code word of the digital-to-analog converter according to the preset code word stepping value, so that the attenuator attenuates the power of the received signal according to different attenuation amounts, and outputting signals with different powers;
the controller is further configured to obtain a difference value between the powers of the output signals of the attenuator corresponding to two adjacent codewords of the digital-to-analog converter, and determine a size relationship between the difference value of the powers of the output signals and a preset power upper limit value and a preset power lower limit value respectively; when the difference value of the power of the output signals is judged to be smaller than a preset power lower limit value, changing the code words of the digital-to-analog converter in a first code word stepping mode; when the difference value of the power of the output signals is judged to be larger than or equal to a preset power lower limit value and smaller than a preset power upper limit value, changing the code word of the digital-to-analog converter in a first code word stepping mode, and acquiring the power of the signals currently output by the attenuator and the code word corresponding to the power in a preset mode; when the difference value of the power of the output signals is judged to be larger than the preset power upper limit value, changing the code word of the digital-to-analog converter in a second code word stepping mode, and acquiring the power of the signals currently output by the attenuator and the code word corresponding to the power in a preset mode;
and the controller is further used for fitting a corresponding relation curve between the power of the signal output by the attenuator and the code word corresponding to each power according to the power of the signal output by the attenuator under the preset frequency and the code word corresponding to each power, so that a calibration curve of the attenuator under the preset frequency is obtained.
According to the calibration method/apparatus of the attenuator of the above embodiment, since the difference between the powers of the output signals of the attenuator corresponding to two adjacent codewords of the digital-to-analog converter is compared with a preset range, wherein the lower limit of the preset range is the lower limit of the preset power, and the upper limit of the preset range is the upper limit of the preset power, according to the magnitude relationship between the difference between the powers of the output signals of the attenuator corresponding to two adjacent codewords and the lower limit of the preset power and the upper limit of the preset power, the codewords of the digital-to-analog converter are changed by different codeword steps to change the power distribution of the output signals of the attenuator, and the powers of the output signals of the attenuator used for fitting the calibration curve and the corresponding codewords are obtained in different manners, so that the distribution of the measurement data used for fitting the calibration curve of the attenuator is more reasonable, and according to different hardware characteristics of, the distribution of the measurement data is dynamically adjusted, so that the fitted calibration curve of the attenuator is more accurate, and the calibration accuracy of the attenuator is improved.
Drawings
FIG. 1 is a block diagram showing the configuration of an attenuator calibration apparatus according to an embodiment of the present invention;
FIG. 2 is a diagram of a user calibration curve using an attenuator according to one embodiment;
FIG. 3 is a schematic diagram of an application circuit of the calibration apparatus of the attenuator according to an embodiment;
FIG. 4 is a flowchart of a method for calibrating an attenuator according to an embodiment of the present invention;
FIG. 5 is a flow chart of a fitting of a calibration curve according to an embodiment.
Detailed Description
The present invention will be described in further detail with reference to the following detailed description and accompanying drawings. Wherein like elements in different embodiments are numbered with like associated elements. In the following description, numerous details are set forth in order to provide a better understanding of the present application. However, those skilled in the art will readily recognize that some of the features may be omitted or replaced with other elements, materials, methods in different instances. In some instances, certain operations related to the present application have not been shown or described in detail in order to avoid obscuring the core of the present application from excessive description, and it is not necessary for those skilled in the art to describe these operations in detail, so that they may be fully understood from the description in the specification and the general knowledge in the art.
Furthermore, the features, operations, or characteristics described in the specification may be combined in any suitable manner to form various embodiments. Also, the various steps or actions in the method descriptions may be transposed or transposed in order, as will be apparent to one of ordinary skill in the art. Thus, the various sequences in the specification and drawings are for the purpose of describing certain embodiments only and are not intended to imply a required sequence unless otherwise indicated where such sequence must be followed.
The numbering of the components as such, e.g., "first", "second", etc., is used herein only to distinguish the objects as described, and does not have any sequential or technical meaning. The term "connected" and "coupled" when used in this application, unless otherwise indicated, includes both direct and indirect connections (couplings).
In the embodiment of the invention, the difference value of the power of the output signals of the attenuators corresponding to two adjacent code words of the digital-to-analog converter is respectively compared with the upper limit value of the preset power and the lower limit value of the preset power, the code words of the digital-to-analog converter can be changed in different stepping modes according to the comparison result so as to change the power of the output signals of the attenuators, and the power of the output signals of the attenuators for fitting the calibration curve and the code words of the digital-to-analog converter corresponding to the output signals of the attenuators are obtained in different modes, so that the power of the output signals of the attenuators for fitting the calibration curve and the code words of the digital-to.
Referring to fig. 1, fig. 1 is a block diagram of an attenuator calibration apparatus 100 according to an embodiment of the present invention, which includes an excitation source 101, a digital-to-analog converter (DAC) 102, an attenuator 103, and a controller 104.
The excitation source 101 is configured to output a signal with constant power at a preset frequency, an output end of the excitation source 101 is connected to an input end of the attenuator 103, the signal output by the excitation source 101 may be a current signal, a voltage signal, or the like, the signals have the same power at a certain frequency, and the frequency of the signal output by the excitation source is adjustable, so that the signal output by the excitation source can output a signal with a large frequency range.
The digital-to-analog converter 102 is configured to configure a corresponding codeword according to a control instruction of the controller 104, and convert the codeword into an analog voltage signal through digital-to-analog conversion and output the analog voltage signal to the control end of the attenuator 103.
The attenuator 103 is configured to receive a signal with constant power at a preset frequency output by the excitation source 101, determine an attenuation amount according to a codeword of the dac 102, attenuate the power of the received signal according to the attenuation amount, and output the attenuated signal, where the codeword size of the dac is positively correlated with the attenuation amount size.
The control end of the attenuator 103 is used to control the amount of attenuation of the power of the signal received by the attenuator 103 according to the magnitude of the voltage value of the voltage signal output by the digital-to-analog converter 102, in other words, the code word of the digital-to-analog converter 102 can be used to control the amount of attenuation of the power of the signal received by the attenuator 103, the larger the code word is, the larger the amount of attenuation is, the positive correlation is between the code word and the signal, and the power of the signal received by the attenuator 103 minus the amount of attenuation is the power of the signal output by the attenuator 103, therefore, it can be seen that the power of the signal output by the attenuator 103 can be controlled by the code word of the.
The controller 104 is connected to the digital-to-analog converter 102, and configured to obtain a preset codeword step value, and change a codeword of the digital-to-analog converter 102 according to the preset codeword step value, so that the attenuator 103 attenuates power of a received signal according to different attenuation amounts, and outputs signals with different powers. In this embodiment, the codeword of the dac 102 usually has a larger value range, for example, between 0 and 65535, and if the dac 102 takes all the codewords in the whole value range, the attenuator 103 outputs 65536 signals with different powers, so that the measurement points required to be obtained for fitting a calibration curve of one frequency are too large, and the rate is slow. Therefore, a codeword step value step is usually preset, and the codeword of the dac 102 is changed according to the preset codeword step value step, that is, each time the codeword of the dac 102 is changed according to the preset codeword step value step, if the codeword before the change is a, the codeword after the change is a + step, and if the codeword after the change is a +2 step, the process is repeated until the codeword after the change exceeds the value range.
In the process of changing the code word of the digital-to-analog converter 102 according to the preset code word step value, the controller 104 is further configured to obtain a difference between powers of output signals of the attenuator 103 corresponding to two adjacent code words of the digital-to-analog converter 102, and determine a magnitude relationship between the difference of the powers of the output signals and the preset power Upper Limit value Upper Limit and the preset power Lower Limit value Lower Limit.
When the controller 104 judges that the difference Δ ATT between the powers of the signals output by the attenuator 103 corresponding to two adjacent codewords of the digital-to-analog converter 102 is smaller than the preset Lower power Limit, the codewords of the digital-to-analog converter 102 are changed in a first codeword stepping manner.
When the controller 104 determines that the difference Δ ATT between the powers of the signals output by the attenuator 103 corresponding to two adjacent codewords of the digital-to-analog converter 102 is greater than or equal to a preset power Lower Limit value Lower Limit and smaller than a preset power Upper Limit value Upper Limit, the codewords of the digital-to-analog converter 102 are changed in a first codeword stepping manner, and the power of the signal currently output by the attenuator 103 and the codewords corresponding to the power are obtained in a preset manner.
When the controller 104 judges that the difference between the powers of the signals output by the attenuator 103 corresponding to two adjacent code words of the digital-to-analog converter 102 is greater than the preset power Upper Limit value Upper Limit, the code words of the digital-to-analog converter 102 are changed in a second code word stepping mode, and the power of the signal currently output by the attenuator 103 and the code words corresponding to the power are obtained in a preset mode.
In the present embodiment, the power of the signal currently output by the attenuator 103 and the code word corresponding to the power acquired by the controller 104 in different ways are measurement data used for fitting the calibration curve of the attenuator 103.
In one embodiment, the controller 104 changes the codeword of the dac 102 in a first codeword stepping manner, including: and changing the code words of the digital-to-analog converter according to the preset code word stepping value, namely changing the code words of the digital-to-analog converter according to the preset code word stepping.
In an embodiment, when the controller 104 determines that the difference Δ ATT between the powers of the output signals of the attenuator 103 corresponding to two adjacent codewords of the dac 102 is smaller than the preset Lower power Limit, the method further includes: the power of the signal currently output by the attenuator and the code word corresponding to the power are not acquired, that is, although the code word of the digital-to-analog converter 102 changes, the power of the signal output by the attenuator changes, but the controller 104 does not acquire the power of the signal currently output by the attenuator 103 and the code word (measurement data) corresponding to the power for fitting the calibration curve.
When the controller 104 determines that the difference Δ ATT between the powers of the signals output by the attenuators 103 corresponding to two adjacent codewords of the dac 102 is smaller than the Lower power Limit, which is a case that the codeword of the dac 102 is smaller or larger, for example, the codeword is in the range of 0 to 1000, or in the range of 64535 to 65535, the difference between the powers of the signals output by the attenuators 103 corresponding to two adjacent codewords is smaller, so the codeword of the dac 102 is still changed by using the step value step of the preset codeword, but the controller 104 does not obtain the measurement data for fitting the calibration curve.
In an embodiment, the obtaining, by the controller 104, the power of the signal currently output by the attenuator 103 and the code word corresponding to the power in a preset manner includes:
when the code word of the analog-to-digital converter 102 is changed, the power of the signal currently output by the attenuator 103 and the code word corresponding to the power are obtained.
When the controller 104 determines that the difference Δ ATT between the powers of the signals output by the two adjacent codewords of the digital-to-analog converter 102 and the attenuator 103 is greater than or equal to the preset power lower limit value and smaller than the preset power upper limit value, this condition is a relatively reasonable condition for selecting the measurement data, so that the codeword of the digital-to-analog converter 102 is changed according to the preset codeword step value without changing the preset codeword step value at this time, and when the codeword is changed every time, the controller 104 acquires the power of the signal currently output by the attenuator and the codeword corresponding to the power, that is, when the digital-to-analog converter 102 changes the codeword according to the preset codeword step value every time, the controller 104 acquires the measurement data for fitting the calibration curve every time.
In one embodiment, the controller 104 changing the codeword of the digital-to-analog converter 102 in the second codeword stepping manner includes:
reducing the preset code word step value according to a preset rule to obtain a reduced code word step value, and changing the code word of the digital-to-analog converter 102 according to the reduced code word step value so that the difference value of the power of the signals output by the attenuator 103 corresponding to two adjacent code words is smaller than a preset power upper limit value; wherein, reducing the step value of the preset code word according to the preset rule comprises: and dividing the preset code word stepping value step by the difference value delta ATT of the power of the output signal to be used as the reduced code word stepping value.
When the controller 104 determines that the difference Δ ATT between the powers of the output signals of the attenuator 103 corresponding to two adjacent codewords of the dac 102 is greater than or equal to the Upper Limit value Upper Limit of the preset power, in this case, the power difference between the output signals corresponding to each codeword is large, which may cause the power distribution point interval of the output signals on the calibration curve to be too large, thereby affecting the accuracy of the calibration curve, and the preset codeword step value step needs to be reduced to change the codeword of the data converter 102, so as to obtain more suitable distributed measurement data. In this embodiment, step/Δ ATT is used to quickly adjust the preset code word step by step, so that the difference between the powers of the output signals of the attenuator 103 corresponding to two adjacent code words is smaller than the Upper Limit value Upper Limit of the preset power, and the controller 104 can quickly obtain reasonably distributed measurement data.
The controller 104 is further configured to fit a corresponding relationship curve between the power of the signal output by the attenuator 103 and the code word according to the power of the signal output by the attenuator at the preset frequency and the code word corresponding to each power, that is, the measurement data of the attenuator 103 at the preset frequency, so as to obtain a calibration curve of the attenuator 103 at the preset frequency. The present embodiment may use an existing fitting curve method to fit the measurement data acquired by the controller 104, such as a least squares method.
The present embodiment further includes a power detector connected to the output end of the attenuator 103 for detecting the power of the signal output by the attenuator 103, and the controller 104 may obtain the power of the signal output by the attenuator by collecting the power of the signal output by the attenuator 103 detected by the power detector. The power detector in this embodiment may be any existing power detection device, such as a power meter.
In this embodiment, the excitation source 101 may output signals with constant power at multiple frequencies, and the controller 104 controls the code of the dac 102 to adjust according to the signals with constant power at different frequencies received by the attenuator 103 and controls the manner of acquiring the measurement data, so as to obtain calibration curves of the attenuator 103 at multiple frequencies.
Referring to fig. 2, fig. 2 is a schematic diagram of an attenuator calibration curve used by a user according to an embodiment, when the power of a received signal of the attenuator 103 is Pin, the attenuator can output signals in a power range from Pm-1 to Pm, and corresponding code words are dacm-1 to dacm, according to measurement data formed by Pm-1, Pm, dacm-1 and dacm, the calibration curve can be found, and according to the found corresponding calibration curve, when the power of the signal received by the attenuator 103 is Pin, all the code words of the corresponding digital-to-analog converter 102 and the power of all output signals of the corresponding attenuator 103 can be obtained, that is, the power range of the output signal of the attenuator is P0 to Pn, and the code word range of the corresponding digital-to-analog converter is 0 to 65535, so that the calibration process of the attenuator at a certain frequency is completed.
In some embodiments, when plotting the calibration curve, only measurement data of the attenuator at a part of the frequencies, which are referred to as calibration frequencies, are typically acquired, so that only the calibration curve at the calibration frequencies can be looked at in the above-described manner. If a frequency does not belong to the calibration frequency and the frequency is located between the first calibration frequency and the second calibration frequency, then the code words of the calibration curve corresponding to the first standard frequency and the second standard frequency are taken, and interpolation is performed according to the taken code words and the output signal power, so that the calibration curve of the attenuator under the frequency can be obtained.
Referring to fig. 3, fig. 3 is a schematic diagram of an application circuit of a calibration apparatus of an attenuator according to an embodiment, in which a signal ATT output by the calibration apparatus of the attenuator is attenuated by a Fixed attenuator Fixed ATT to increase an attenuation range, which is equivalent to a resistor for adjusting Power of an output signal, and after passing through a first branch and a second branch, the signal ATT is output through a first output Port1 and a second output Port2, respectively, and a Power Meter is connected to the first output Port1 and the second output Port2, and the Power Meter is used for measuring Power of output signals of the first output Port1 and the second output Port2, respectively, so as to calibrate the attenuator. In addition, in the present embodiment, the first branch and the second branch are respectively coupled to the measurement branch Meas1 (Meas 2) and the feedback branch Ref1 (Ref 2), the measurement branch Meas1 (Meas 2) and the feedback branch Ref1 (Ref 2) are respectively connected with VGA2 (VGA 4) and ADC2 (ADC 4) and VGA1 (VGA 3) and ADC1 (ADC 3), which are respectively used for measuring the power of the feedback branch and the measurement branch, and the SPI port in fig. 3 is a control port of the controller.
Referring to fig. 4, fig. 4 is a flowchart illustrating a calibration method of an attenuator according to an embodiment of the present invention, where the calibration method can be executed in a controller, and the method includes steps S101 to S107, which are described in detail below.
Step S101, obtaining a codeword of the digital-to-analog converter 102 for controlling an attenuation amount in the attenuator, where the attenuator 103 is configured to attenuate a received signal with constant power at a preset frequency according to the attenuation amount, and a codeword size of the digital-to-analog converter 102 is positively correlated to an attenuation amount size.
The dac 102 is configured to configure a corresponding codeword according to a control instruction of the controller, convert the codeword into an analog voltage signal through digital-to-analog conversion, and output the analog voltage signal to the control end of the attenuator 103, where the attenuator 103 determines an attenuation amount in response to the voltage signal output by the dac, and then the attenuator 103 attenuates the power of the received signal with constant power at a preset frequency according to the determined attenuation amount, and outputs the attenuated signal. Thus, the code words of the digital-to-analog converter 102 are different, and the power of the output signal of the attenuator 103 is also different.
Step S102, obtaining a preset step value, and changing a codeword of the dac 102 according to the step value, so that the attenuator 103 attenuates the power of the received signal according to different attenuation amounts, and outputs signals with different powers.
The present embodiment changes the codeword of the digital-to-analog converter according to the preset codeword step value step, so that the attenuator outputs signals with different powers. In this embodiment, the codeword of the dac 102 usually has a larger value range, for example, between 0 and 65535, and if the dac 102 takes all the codewords in the whole value range, the attenuator 103 outputs 65536 signals with different powers, so that the measurement points required to be obtained for fitting a calibration curve of one frequency are too large, and the rate is slow. Therefore, a codeword step value step is usually preset, and the codeword of the dac 102 is changed according to the preset codeword step value step, that is, each time the codeword of the dac 102 is changed according to the preset codeword step value step, if the codeword before the change is a, the codeword after the change is a + step, and if the codeword after the change is a +2 step, the process is repeated until the codeword after the change exceeds the value range.
Step S103, obtaining a difference value delta ATT of the power of the output signal of the attenuator 103 corresponding to two adjacent code words of the digital-to-analog converter 102, and judging the size relation between the difference value delta ATT of the power of the output signal and a preset power upper limit value and a preset power lower limit value respectively, wherein the preset power upper limit value is larger than the preset power lower limit value.
And step S104, when the difference value delta ATT of the power of the output signal is judged to be smaller than the preset power lower limit value, changing the code word of the digital-to-analog converter in a first code word stepping mode.
And step S105, when the difference value delta ATT of the power of the output signal is judged to be larger than or equal to a preset power lower limit value and smaller than a preset power upper limit value, changing a code word of the digital-to-analog converter in a first code word stepping mode, and acquiring the power of the signal currently output by the attenuator and a code word corresponding to the power in a preset mode.
And step S106, when the difference value of the power of the output signals is judged to be larger than the preset power upper limit value, changing the code word of the digital-to-analog converter in a second code word stepping mode, and acquiring the power of the signals currently output by the attenuator and the code word corresponding to the power in a preset mode.
In this embodiment, the power of the signal currently output by the attenuator acquired in different ways and the code word corresponding to the power are measurement data used for fitting the calibration curve of the attenuator.
In an embodiment, changing the codeword of the dac 102 in a first codeword stepping manner includes: and changing the code words of the digital-to-analog converter according to the preset code word stepping value, namely changing the code words of the digital-to-analog converter according to the preset code word stepping.
In an embodiment, when the difference Δ ATT of the powers of the output signals is smaller than the preset power lower limit, the method further includes: the power of the signal currently output by the attenuator and the code word corresponding to the power are not acquired, that is, although the code word of the digital-to-analog converter 102 changes, the power of the signal output by the attenuator changes, but the controller 104 does not acquire the power of the signal currently output by the attenuator 103 and the code word (measurement data) corresponding to the power for fitting the calibration curve.
When the difference between the powers of the signals output by the attenuators 103 corresponding to two adjacent codewords of the dac 102 is smaller than the Lower power Limit, which is a case where the codeword of the dac 102 is smaller or larger, for example, the codeword is in the range of 0 to 1000, or in the range of 64535 to 65535, and the difference between the powers of the signals output by the attenuators 103 corresponding to two adjacent codewords is smaller, the codeword of the dac 102 is still changed by using the preset codeword step value at this time, but the controller 104 does not obtain the measurement data for fitting the calibration curve.
In an embodiment, obtaining the power of the signal currently output by the attenuator 103 and the codeword corresponding to the power in a preset manner includes:
when the code word of the analog-to-digital converter 102 is changed, the power of the signal currently output by the attenuator 103 and the code word corresponding to the power are obtained.
When the difference between the powers of the signals output by the attenuators 103 corresponding to two adjacent code words of the digital-to-analog converter 102 is judged to be greater than or equal to the preset power lower limit value and smaller than the preset power upper limit value, this condition is a relatively reasonable condition for selecting the measurement data, so the preset code word step value is still not changed at this time, the code word of the digital-to-analog converter 102 is changed according to the preset code word step value, and the power of the signal output by the attenuator and the code word corresponding to the power are collected once when the code word is changed once, that is, the digital-to-analog converter 102 obtains the measurement data used for fitting the calibration curve once when the code word is changed once according to the preset code word step value.
In one embodiment, changing the codeword of the dac 102 in the second codeword stepping manner includes:
reducing the preset code word step value according to a preset rule to obtain a reduced code word step value, and changing the code word of the digital-to-analog converter 102 according to the reduced code word step value so that the difference value of the power of the signals output by the attenuator 103 corresponding to two adjacent code words is smaller than a preset power upper limit value; wherein, reducing the step value of the preset code word according to the preset rule comprises: and dividing the preset code word stepping value step by the difference value delta ATT of the power of the output signal to be used as the reduced code word stepping value.
When it is determined that the difference between the powers of the output signals of the attenuator 103 corresponding to two adjacent codewords of the dac 102 is greater than or equal to the Upper Limit value Upper Limit, in this case, the power difference between the output signals corresponding to each codeword is large, which may cause the power distribution point interval of the output signals on the calibration curve to be too large, thereby affecting the accuracy of the calibration curve, and the codeword of the data converter 102 needs to be changed by reducing the step value step of the preset codeword, so as to obtain more suitable distributed measurement data. In this embodiment, the step/Δ ATT is used to quickly reduce the step value of the preset codeword, so that the difference between the powers of the output signals of the attenuators corresponding to two adjacent codewords is smaller than the Upper Limit of the preset power, and the controller can quickly obtain reasonably distributed measurement data.
And S107, fitting a corresponding relation curve of the power of the signal output by the attenuator and the code words corresponding to each power according to the power of the signal output by the attenuator under the preset frequency and the code words corresponding to each power, so as to obtain a calibration curve of the attenuator under the preset frequency. The present embodiment may adopt an existing fitting curve method, such as a least square method, to fit the acquired measurement data.
In an embodiment, the initial value of the codeword of the dac 102 is 0, in this embodiment, the codeword of the dac is changed according to the above method steps starting from the codeword of 0, and the power of the output signal of the attenuator is measured at the same time to fit the calibration curve of the attenuator at a certain frequency, please refer to fig. 5, where fig. 5 is a flowchart illustrating the fitting of the calibration curve according to an embodiment, and includes the following steps:
in step S201, when the received signal of the attenuator is at a preset frequency, the codeword of the dac 102 is configured to be an initial value 0.
Step S202, record the current codeword of the dac 102, obtain and record the power Pn of the corresponding attenuator output signal, and determine whether the current codeword Temp _ dac of the dac 102 is greater than or equal to the preset codeword upper limit value (65535).
Step 203, if the current codeword Temp _ dac is smaller than the preset codeword upper Limit value, the current codeword Temp _ dac of the dac 102 is added with the preset codeword step value to be used as the next codeword of the dac 102, the next codeword is used as the current codeword, the power Pn +1 of the attenuator output signal corresponding to the current codeword of the dac 102 is obtained, and whether the difference Δ ATT between the power Pn +1 of the attenuator output signal corresponding to the current codeword and the power Pn of the attenuator output signal corresponding to the previous codeword is greater than or equal to the preset power Lower Limit value Lower Limit is judged.
And step S204, if the delta ATT is more than or equal to the Lower Limit value Lower Limit of the preset power, judging whether the delta ATT is less than the Upper Limit value Upper Limit of the preset power.
Step 205, if Δ ATT is smaller than the Lower Limit value Lower Limit of the preset power, configuring the next codeword of the current codeword according to the step value of the preset codeword, and taking the next codeword of the configured current codeword as the current codeword of the dac, and returning to step 203.
And S206, if the delta ATT is smaller than the Upper Limit value Upper Limit of the preset power, configuring the next code word of the current code word according to the step value of the preset code word, taking the next code word as the current code word, and returning to the S102.
And step S207, if the delta ATT is greater than or equal to the Upper Limit value Upper Limit of the preset power, reducing the preset stepping value according to a formula step = step/delta ATT, taking the reduced preset stepping value as the preset stepping value, and returning to the step S203.
Step S208, if the current codeword Temp _ dac is greater than or equal to the preset codeword upper limit value, fitting the obtained power of the attenuator output signal and the corresponding codeword to a calibration curve at the preset frequency, and repeating steps S201 to S208 for the next frequency.
Those skilled in the art will appreciate that all or part of the functions of the various methods in the above embodiments may be implemented by hardware, or may be implemented by computer programs. When all or part of the functions of the above embodiments are implemented by a computer program, the program may be stored in a computer-readable storage medium, and the storage medium may include: a read only memory, a random access memory, a magnetic disk, an optical disk, a hard disk, etc., and the program is executed by a computer to realize the above functions. For example, the program may be stored in a memory of the device, and when the program in the memory is executed by the processor, all or part of the functions described above may be implemented. In addition, when all or part of the functions in the above embodiments are implemented by a computer program, the program may be stored in a storage medium such as a server, another computer, a magnetic disk, an optical disk, a flash disk, or a removable hard disk, and may be downloaded or copied to a memory of a local device, or may be version-updated in a system of the local device, and when the program in the memory is executed by a processor, all or part of the functions in the above embodiments may be implemented.
The present invention has been described in terms of specific examples, which are provided to aid understanding of the invention and are not intended to be limiting. For a person skilled in the art to which the invention pertains, several simple deductions, modifications or substitutions may be made according to the idea of the invention.

Claims (8)

1. A method for calibrating an attenuator, comprising:
the method comprises the steps that a code word of a digital-to-analog converter used for controlling the attenuation amount in an attenuator is obtained, the attenuator is used for attenuating the power of a signal with constant power under a preset frequency according to the attenuation amount, and the code word size of the digital-to-analog converter is positively correlated with the attenuation amount;
acquiring a preset code word stepping value, and changing the code word of the digital-to-analog converter according to the preset code word stepping value so that the attenuator attenuates the power of the received signal according to different attenuation amounts and outputs signals with different powers;
acquiring a difference value of the power of the output signal of the attenuator corresponding to two adjacent code words of the digital-to-analog converter, and judging the magnitude relation between the difference value of the power of the output signal and a preset power upper limit value and a preset power lower limit value respectively, wherein the preset power upper limit value is larger than the preset power lower limit value;
when the difference value of the power of the output signals is judged to be smaller than a preset power lower limit value, changing the code words of the digital-to-analog converter in a first code word stepping mode;
when the difference value of the power of the output signals is judged to be larger than or equal to a preset power lower limit value and smaller than a preset power upper limit value, changing the code word of the digital-to-analog converter in a first code word stepping mode, and acquiring the power of the signals currently output by the attenuator and the code word corresponding to the power in a preset mode;
when the difference value of the power of the output signals is judged to be larger than the preset power upper limit value, changing the code word of the digital-to-analog converter in a second code word stepping mode, and acquiring the power of the signals currently output by the attenuator and the code word corresponding to the power in a preset mode;
fitting a corresponding relation curve of the power of the signal output by the attenuator and the code words corresponding to each power according to the power of the signal output by the attenuator under the preset frequency and the code words corresponding to each power, and obtaining a calibration curve of the attenuator under the preset frequency;
the changing the code word of the digital-to-analog converter in the first code word stepping mode comprises:
changing the code word of the digital-to-analog converter according to a preset code word stepping value;
when the difference value of the power of the output signal is judged to be smaller than the preset power lower limit value, the method further comprises the following steps:
and not acquiring the power of the signal currently output by the attenuator and the code word corresponding to the power.
2. The calibration method of claim 1, wherein said changing the codeword of the digital-to-analog converter in a second codeword step comprises:
and reducing the preset code word stepping value according to a preset rule to obtain a reduced code word stepping value, and changing the code words of the digital-to-analog converter according to the reduced code word stepping value so that the difference value of the power of signals output by the attenuator corresponding to two adjacent code words is smaller than a preset power upper limit value.
3. The calibration method according to claim 2, wherein said reducing the step value of the predetermined codeword according to the predetermined rule comprises:
and dividing the preset code word stepping value by the difference value of the power of the output signal to be used as the reduced code word stepping value.
4. The calibration method of claim 1, wherein the obtaining the power of the signal currently output by the attenuator and the codeword corresponding to the power in a preset manner comprises:
and when the code word of the digital-to-analog converter is changed, acquiring the power of the signal currently output by the attenuator and the code word corresponding to the power.
5. An attenuator calibration device, comprising:
a digital-to-analog converter;
the attenuator is used for receiving a signal with constant power under a preset frequency, determining an attenuation amount according to a code word of the digital-to-analog converter, attenuating the power of the received signal according to the attenuation amount and then outputting the attenuated signal, wherein the code word size of the digital-to-analog converter is positively correlated with the attenuation amount size;
the controller is used for acquiring a preset code word stepping value, changing the code word of the digital-to-analog converter according to the preset code word stepping value, so that the attenuator attenuates the power of the received signal according to different attenuation amounts, and outputting signals with different powers;
the controller is further configured to obtain a difference value between the powers of the output signals of the attenuator corresponding to two adjacent codewords of the digital-to-analog converter, and determine a size relationship between the difference value of the powers of the output signals and a preset power upper limit value and a preset power lower limit value respectively; when the difference value of the power of the output signals is judged to be smaller than a preset power lower limit value, changing the code words of the digital-to-analog converter in a first code word stepping mode; when the difference value of the power of the output signals is judged to be larger than or equal to a preset power lower limit value and smaller than a preset power upper limit value, changing the code word of the digital-to-analog converter in a first code word stepping mode, and acquiring the power of the signals currently output by the attenuator and the code word corresponding to the power in a preset mode; when the difference value of the power of the output signals is judged to be larger than the preset power upper limit value, changing the code word of the digital-to-analog converter in a second code word stepping mode, and acquiring the power of the signals currently output by the attenuator and the code word corresponding to the power in a preset mode;
the controller is further configured to fit a corresponding relation curve between the power of the signal output by the attenuator and the code word corresponding to each power according to the power of the signal output by the attenuator at a preset frequency and the code word corresponding to each power, so that a calibration curve of the attenuator at the preset frequency is obtained;
the changing the code word of the digital-to-analog converter in the first code word stepping mode comprises:
changing the code word of the digital-to-analog converter according to a preset code word stepping value;
when the difference value of the power of the output signal is judged to be smaller than the preset power lower limit value, the method further comprises the following steps:
and not acquiring the power of the signal currently output by the attenuator and the code word corresponding to the power.
6. The calibration apparatus of claim 5, wherein said changing the codeword of said digital to analog converter in a first codeword step comprises:
changing the code word of the digital-to-analog converter according to a preset code word stepping value;
the changing the code word of the digital-to-analog converter in the second code word stepping mode comprises:
reducing the preset code word stepping value according to a preset rule to obtain a reduced code word stepping value, and changing the code words of the digital-to-analog converter according to the reduced code word stepping value so that the difference value of the power of signals output by the attenuator corresponding to two adjacent code words is smaller than a preset power upper limit value;
wherein, reducing the step value of the preset code word according to the preset rule comprises:
and dividing the preset code word stepping value by the difference value of the power of the output signal to be used as the reduced code word stepping value.
7. The calibration apparatus according to claim 5, wherein when the difference between the powers of the output signals is smaller than the preset power lower limit value, the calibration apparatus further comprises:
not acquiring the power of the signal currently output by the attenuator and a code word corresponding to the power;
the obtaining the power of the signal currently output by the attenuator and the code word corresponding to the power in a preset manner includes:
and when the code word of the digital-to-analog converter is changed, acquiring the power of the signal currently output by the attenuator and the code word corresponding to the power.
8. The calibration device of claim 5, further comprising:
a power detector for detecting the power of the signal output by the attenuator.
CN202010982800.3A 2020-09-18 2020-09-18 Attenuator calibration device and method Active CN111934636B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010982800.3A CN111934636B (en) 2020-09-18 2020-09-18 Attenuator calibration device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010982800.3A CN111934636B (en) 2020-09-18 2020-09-18 Attenuator calibration device and method

Publications (2)

Publication Number Publication Date
CN111934636A CN111934636A (en) 2020-11-13
CN111934636B true CN111934636B (en) 2021-01-12

Family

ID=73335225

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010982800.3A Active CN111934636B (en) 2020-09-18 2020-09-18 Attenuator calibration device and method

Country Status (1)

Country Link
CN (1) CN111934636B (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6711388B1 (en) * 2000-03-30 2004-03-23 Nokia Corporation Distributed power level control system of transmitter for cellular communication
CN105337673B (en) * 2014-06-30 2017-10-24 展讯通信(上海)有限公司 Mobile terminal automated power control calibration method and device
CN106324336B (en) * 2015-06-30 2019-01-04 展讯通信(上海)有限公司 A kind of power-sensing circuit, power amplifier module and calibration of power circuit
CN206461609U (en) * 2016-12-31 2017-09-01 歌尔科技有限公司 A kind of superhet and improve its accuracy of measurement device
CN109088675B (en) * 2017-06-13 2022-02-08 北京普源精电科技有限公司 Channel calibration method and device for radio frequency signal source
US10164593B1 (en) * 2017-09-07 2018-12-25 Silicon Laboratories Inc. Accurate, low-power power detector circuits and related methods using programmable reference circuitry
CN107994963B (en) * 2017-12-27 2023-11-24 京信网络系统股份有限公司 Method and device for expanding detection range of power detector
CN109687906A (en) * 2019-01-25 2019-04-26 泰瑞创通讯(成都)有限公司 Optical attenuator calibration method

Also Published As

Publication number Publication date
CN111934636A (en) 2020-11-13

Similar Documents

Publication Publication Date Title
JP5670153B2 (en) Data acquisition system and calibration method thereof
CN115753022B (en) Testing system and testing method for performance of optical device
US7405683B1 (en) Extending the dynamic range in an energy measurement device
KR19990007490A (en) Method and apparatus for testing integrated circuit analog-to-digital converter
US20140198820A1 (en) Systems and methods for an auto-ranging temperature sensor
US8547256B2 (en) Analog unit
CN113203472B (en) Microphone probe sensitivity compensation method and system for oscilloscope
CN111934636B (en) Attenuator calibration device and method
KR101744880B1 (en) System for testing performance of frequency synthesizer for radar and method thereof
US6687489B1 (en) Implementing RF power measurements in a broadband communications device
US6989663B2 (en) Flatness correction
EP3509217A1 (en) Compensating for degradation of electronics due to radiation vulnerable components
JP2004219126A (en) Method of automatically changing current range
CN112098702B (en) Digital oscilloscope and vertical gear correction method for digital oscilloscope
JP2000151409A (en) A/d converter and regulator for grade amplifier
US8866549B2 (en) Method of power amplifier calibration
JP2019138735A (en) Current detection device, current detection system, and method for correcting current detection device
EP1678822B1 (en) Method for calibration of a signal receiver
CN112994807A (en) Automatic calibration system and method for signal source
CN116505947B (en) Analog-to-digital converter calibration method, device, storage medium and chip
JPH052933B2 (en)
US20130134961A1 (en) Method for performing power detection, and associated apparatus
KR101612739B1 (en) Distance measurement apparatus and method utilizing time to digital converter having scalable resolution
US7859334B2 (en) Hybrid power control for a power amplifier
JP4946786B2 (en) Threshold measurement method and apparatus for optical module circuit

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant