Single-channel double-gain high-precision measurement method, system, equipment and medium

By adopting dual gain technology and oversampling rate setting in a single-channel measurement system, the problems of small signal measurement range and low analysis accuracy in the existing technology are solved, and higher signal measurement accuracy and dynamic range are achieved.

CN119363113AInactive Publication Date: 2025-01-24ZHUHAI COPOWER ELECTRIC

Patent Information

Application Number
CN202411468907.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-01-24
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When measuring power grid signals, the existing single-channel single-gain scheme has problems such as small signal measurement range and low resolution accuracy, making it difficult to measure the nominal and fault conditions of the signal at the same time.

Method used

Adopting a single-channel dual-gain high-precision measurement method, the analog input signal is oversampled by setting the oversampling rate to achieve a high signal-to-noise ratio, and two analog-to-digital converter channels are combined to expand signal capture using different gain levels. scope.

Benefits of technology

A wider signal measurement range and higher signal resolution accuracy can be achieved, and a large -scale and small -scale signal can be measured at the same time to ensure that the measurement accuracy reaches a higher signal -to -noise ratio.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0005094178050000031
    Figure BDA0005094178050000031
  • Figure BDA0005094178050000033
    Figure BDA0005094178050000033
  • Figure BDA0005094178050000071
    Figure BDA0005094178050000071
Patent Text Reader

Abstract

The invention discloses a single-channel double-gain high-precision measurement method, system and device and a medium, and the method comprises the steps: setting an oversampling rate, and achieving a signal-to-noise ratio of a preset high value when an analog input signal is oversampled based on the oversampling rate; correlation mapping exists among the oversampling rate, the signal sampling frequency and the Nyquist frequency; combining the two analog-to-digital converter channels to sample the same analog input signal; the channels of the two analog-to-digital converters are provided with programming gain amplifiers which are configured to receive input signals with different numerical values and expand the signal capture range of the analog-to-digital converters by using different gain levels; when signal sampling is executed, signal sampling operation is carried out based on the oversampling rate and the signal input ranges of different numerical values; according to the invention, the nominal condition and the fault condition of the signal can be measured at the same time, a wider signal measurement range is provided, and the signal analysis precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of high-precision measurement technology, and in particular to a single-channel dual-gain high-precision measurement method, system, equipment and medium. Background Art

[0002] The intelligent distribution terminal of the power system is equipped with a pole-mounted high-voltage switch. The sensors convert the primary large signals such as the phase voltage, zero-sequence voltage, phase current, and zero-sequence current of the power grid into secondary small signals that can be collected by the intelligent terminal. The input signal amplitude of the sampling signal may vary greatly under different working conditions. For example, in the light-load state during normal operation, the secondary signal amplitude may be 0.1 times the rated value, while in the fault condition, the secondary signal amplitude may be 20 times the rated value, but the system is still required to respond to changes of 0.001 times the rated value; Figure 1 The overrange signal shown, Figure 1 The signal measurement range in is small. Consider an input signal from a sensor that is generally very small relative to the input range, but may be over-range (for example during startup or under fault conditions). The signal range of relay protection applications is generally small relative to the fault condition, but the user may want to measure both the nominal condition and the fault condition at the same time.

[0003] The existing single-channel single-gain solution can only configure one sampling channel for signal detection, such as Figure 2 As shown, an AC signal passes through two stages of pre-conditioning amplifiers ( Figure 2 After passing through U22C and U22D in the circuit, it reaches the ADC input to be sampled.

[0004] At present, data acquisition systems mainly adopt the method of amplification first, filtering, and finally sampling and quantization. When the data acquisition system requires a very high resolution, the traditional method will encounter the bottleneck problem of Nyquist sampling rate and the constraints of ADC bit number and price; take industrial control with a voltage of sine wave 1mV to 20V as an example: 16-bit converter system, the peak value is +32767, and the trough value is -32767, then the theoretical resolution of the signal is √2*20000 / 32767=0.863mV. According to the accuracy requirements of the application, the user may hope that the accuracy is higher than 0.5S, but the inaccuracy of the conditioned signal before the converter, that is, the accumulated noise, makes it difficult to meet the 0.5S requirement.

[0005] In summary, the data acquisition system has the defects of small signal measurement range and low signal analysis accuracy, which urgently needs to be improved. Summary of the invention

[0006] In order to simultaneously measure the nominal condition and fault condition of a signal, provide a wider signal measurement range, and improve signal analysis accuracy, the present application provides a single-channel dual-gain high-precision measurement method, system, device, and medium.

[0007] In the first aspect, the invention objective of the present application is achieved by adopting the following technical solutions: A single-channel dual-gain high-precision measurement method, comprising: An oversampling rate is set, and when the analog input signal is oversampled based on the oversampling rate, a signal-to-noise ratio reaching a preset high value is achieved; there is an associated mapping between the oversampling rate and the signal sampling frequency and the Nyquist frequency; Combining two analog-to-digital converter channels to sample the same analog input signal; each of the two analog-to-digital converter channels is provided with a programmed gain amplifier configured to receive sampling operations of input signals of different numerical values, and using different gain levels to expand the signal capture range of the analog-to-digital converter; When performing signal sampling, the signal sampling operation is performed based on the oversampling rate and signal input ranges of different values.

[0008] By adopting the above technical scheme, the present invention provides a single-channel dual-gain high-precision signal measurement method. In order to achieve the purpose of being able to simultaneously measure the nominal condition and fault condition of the signal, provide a wider signal measurement range, and improve the signal analysis accuracy, the present invention uses an analog-to-digital converter (such as AD7616) to set an oversampling rate to oversample the analog input signal to achieve a signal-to-noise ratio as high as a preset high value (such as the signal-to-noise ratio of a 16-bit converter system using AD7616 reaches 92.9dB), and the oversampling rate is used to represent the correlation mapping between the signal sampling frequency and the Nyquist frequency; in practical applications, appropriately increasing the sampling rate can reduce the power of the noise in the system, and oversampling does not affect the power of the signal, so oversampling achieves an improvement in the signal-to-noise ratio under the condition of reducing the noise power and not affecting the signal power, so as to ensure that the sampling measurement accuracy reaches a higher signal-to-noise ratio; at the same time, by combining the two The analog-to-digital converters are combined to sample the same analog input signal and achieve a larger dynamic range by using different gains. Specifically, achieving the highest DR (dynamic range) through single-channel dual gain means using different gain settings within a single channel to expand the signal range that the ADC (analog-to-digital converter) can capture, thereby improving the overall dynamic range and being suitable for applications that simultaneously measure large-range and small-range signals; wherein the channels of the analog-to-digital converter are all provided with programmed gain amplifiers, which are configured to receive input signal sampling operations of different numerical values, that is, by configuring the voltage range through a smaller ADC channel, it is possible to detect system overvoltage and overcurrent conditions, and by configuring the voltage input range through a larger ADC channel to capture the range amplitude of the fault condition, so that the present invention enables smaller input signals and larger input signals to be simultaneously resolved to the required measurement accuracy through the configuration and measurement method of higher signal-to-noise ratio and wider dynamic range.

[0009] In a preferred example of the present application, the channels of the two analog-to-digital converters are both provided with programmed gain amplifiers, which are configured to receive input signals of different numerical values ​​and use different gain levels to expand the signal capture range of the analog-to-digital converters, and further include: Setting a first gain threshold and a second gain threshold and associating them with two analog-to-digital converters in a one-to-one correspondence; Dynamically adjust the gain value of the single-channel dual-gain system by using the first gain threshold and the second gain threshold; The method of dynamically adjusting the gain value of the single-channel measurement system by using the first gain threshold and the second gain threshold comprises: after performing a signal sampling operation based on the oversampling rate and the signal input range of different values, performing a fast Fourier transform and gain calculation on the sampled input signal to obtain a signal amplitude; The signal amplitude is compared with the first gain threshold and the second gain threshold respectively to obtain a comparison result, and the corresponding analog input gain terminal is automatically switched based on the comparison result.

[0010] By adopting the above technical scheme, a programmable gain amplifier (PGA) can be an amplifier with gain controlled by an external signal or a program controller, so as to adjust the method multiple according to the precision measurement requirements. The present invention applies PGA to adjust the gain of the input signal of the analog-to-digital converter (ADC), which is conducive to ensuring that the input signal is within the linear range of the analog-to-digital converter; the first gain threshold and the second gain threshold are set reference values, and adaptive parameter definition can be performed according to the parameters of the current single-channel dual-gain system. The present invention determines whether and how to adjust the gain of the programmable gain amplifier by comparing the amplitude of the input signal with the gain threshold; Fast Fourier Transform (FFT) is used to analyze the signal spectrum after sampling and determine the amplitude of the signal. The present invention can accurately evaluate the strength of the signal through FFT and gain calculation, and adjust the gain accordingly to ensure that the signal is always in the optimal processing state without overload or distortion.

[0011] In a preferred example of the present application, there is an associated mapping between the oversampling rate and the signal sampling frequency and the Nyquist frequency, including: Based on formula (1), the oversampling rate OSR and the signal sampling frequency f are characterized s , Nyquist frequency f m : White noise power in a single channel measurement system Calculated based on formula (2): In the formula, e rms is the average power of the noise.

[0012] By adopting the above technical solution, the oversampling rate represents the multiple of the number of sampling points in the sampling process relative to the minimum necessary number of sampling points; by increasing the sampling frequency, the signal-to-noise ratio of the signal can be effectively improved; the white noise power is the noise power within a unit bandwidth, which is used to describe the noise level in the system. By reasonably selecting the oversampling rate and calculating the white noise power, high-precision measurement of the analog input signal can be achieved, and the calculation of the white noise power provides a data basis for noise suppression.

[0013] In a preferred example of the present application, the oversampling rate is determined based on formula (3): f os =4 w *f s (3) In the formula, f os is the oversampling frequency, W is the additional number of bits of resolution; the oversampling rate OSR is 4.

[0014] By adopting the above technical solution, in actual application, W can be set to 1, and the oversampling frequency can be calculated by formula (3) to determine the actual sampling frequency; by reasonably selecting the oversampling rate and the additional number of resolution bits, the present invention can achieve high-precision measurement of analog input signals.

[0015] In a preferred example of the present application: the analog-to-digital converter is AD7616; W takes a value of 1; and / or, The method also includes: Based on formula (4), the correlation between the signal-to-noise ratio and the signal amplitude of the analog input signal is constructed: SNR=20*log 10 (S max / S min ) (4) In the formula, SNR is the signal-to-noise ratio, S max is the maximum amplitude of the signal applied to the analog input of the analog-to-digital converter; S min is the amplitude of the minimum resolvable signal relative to the noise floor.

[0016] By adopting the above technical solution, the performance of the single-channel dual-gain system is evaluated based on the correlation between the signal-to-noise ratio and the signal amplitude constructed based on formula (4).

[0017] In a preferred example of the present application, the signal amplitude is compared with the first gain threshold and the second gain threshold respectively to obtain a comparison result, and the corresponding analog input gain terminal is automatically switched based on the comparison result, including: According to the preset measurement requirements, determine the switching threshold between the high gain mode and the low gain mode of the single-channel measurement system; based on the characteristics of the signal to be measured, preliminarily evaluate the signal amplitude range and select the initial gain mode for signal acquisition; During the signal acquisition process, the signal amplitude is detected in real time. When the signal amplitude exceeds the optimal measurement range of the current gain mode, it automatically switches to another gain mode. The signals near the gain mode switching point are fused and processed, and the discontinuity caused by the gain switching is corrected using a preset correction algorithm to obtain continuous signal measurement results.

[0018] By adopting the above technical scheme, the present invention can ensure that the system can maintain the best measurement accuracy and dynamic range under different signal strengths by reasonably setting the gain mode switching threshold. Based on real-time detection of signal amplitude and automatic switching of gain modes, it can ensure that the system always operates within the optimal measurement range, which is conducive to avoiding signal saturation or distortion; and through fusion processing and correction algorithms, the discontinuity near the gain switching point can be eliminated to ensure the continuity and accuracy of the signal measurement results.

[0019] In a preferred example of the present application: the method further includes: Based on the calculated signal-to-noise ratios of the signals under different gain modes, comparing changes in the signal-to-noise ratios of the signals before and after the gain switching, and calculating the optimal gain switching time in combination with the continuity requirement of the signal; According to the change in signal amplitude after gain switching, the gain correction factor is calculated and applied to obtain the final high-precision measurement result.

[0020] By adopting the above technical solution, the gain correction factor is a coefficient used to correct the discontinuity caused by gain switching; by calculating the signal-to-noise ratio under different gain modes, the signal quality in each mode can be evaluated. When the signal amplitude is close to the switching threshold, the change in the signal-to-noise ratio before and after the gain switching is calculated, and the moment when the signal-to-noise ratio change is the smallest and meets the continuity requirement is selected as the gain switching moment; by calculating and applying the gain correction factor, the discontinuity near the gain switching point can be eliminated.

[0021] In the second aspect, the invention objective of the present application is achieved by adopting the following technical solutions: A single-channel dual-gain high-precision measurement system is applied to the single-channel dual-gain high-precision measurement method as described above, and the system comprises: An oversampling rate setting module, used to set the oversampling rate, and to achieve a signal-to-noise ratio of a preset high value when oversampling the analog input signal based on the oversampling rate; there is an associated mapping between the oversampling rate and the signal sampling frequency and the Nyquist frequency; A converter merging module, for merging two analog-to-digital converter channels to sample the same analog input signal; the two analog-to-digital converter channels are each provided with a programmed gain amplifier, configured to receive input signals of different magnitudes, and use different gain levels to extend the signal capture range of the analog-to-digital converter; The signal sampling execution module is used to perform a signal sampling operation based on the oversampling rate and a signal input range of different values ​​when executing signal sampling.

[0022] In the third aspect, the invention objective of the present application is achieved by adopting the following technical solutions: A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned single-channel dual-gain high-precision measurement method are implemented.

[0023] In a fourth aspect, the invention objective of the present application is achieved by adopting the following technical solutions: A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned single-channel dual-gain high-precision measurement method are implemented.

[0024] In summary, the present application includes at least one of the following beneficial technical effects: 1. The present invention provides a single-channel dual-gain high-precision signal measurement method. In order to achieve the purpose of being able to simultaneously measure the nominal condition and fault condition of the signal, provide a wider signal measurement range, and improve the accuracy of signal analysis, the present invention uses an analog-to-digital converter (such as AD7616) to set an oversampling rate to oversample the analog input signal to achieve a signal-to-noise ratio as high as a preset high value (such as the signal-to-noise ratio of a 16-bit converter system using AD7616 reaches 92.9dB), and the oversampling rate is used to represent the correlation mapping between the signal sampling frequency and the Nyquist frequency; in practical applications, appropriately increasing the sampling rate can reduce the power of the noise in the system, and oversampling does not affect the power of the signal, so oversampling achieves an improvement in the signal-to-noise ratio under the condition of reducing the noise power and not affecting the signal power, so as to ensure that the sampling measurement accuracy reaches a higher signal-to-noise ratio; at the same time, by connecting two analog-to-digital converters Merge to sample the same analog input signal, and achieve a larger dynamic range by using different gains. Specifically, achieving the highest DR (dynamic range) through single-channel dual gain means using different gain settings within a single channel to expand the signal range that the ADC (analog-to-digital converter) can capture, thereby improving the overall dynamic range, which is suitable for applications that simultaneously measure large-range and small-range signals; wherein the channels of the analog-to-digital converter are all provided with programmed gain amplifiers, which are configured to receive input signal sampling operations of different numerical values, that is, by configuring the voltage range through a smaller ADC channel, it is possible to detect system overvoltage and overcurrent conditions, and by configuring the voltage input range through a larger ADC channel, it is possible to capture the range amplitude of the fault condition, so that the present invention enables smaller input signals and larger input signals to be simultaneously resolved to the required measurement accuracy through a higher signal-to-noise ratio, a wider dynamic range configuration, and a measurement method; 2. A programmable gain amplifier (PGA) is an amplifier whose gain can be controlled by an external signal or a program controller, so as to adjust the method multiple according to the precision measurement requirements. The present invention applies PGA to adjust the gain of the input signal of the analog-to-digital converter (ADC), which is conducive to ensuring that the input signal is within the linear range of the analog-to-digital converter; the first gain threshold and the second gain threshold are set reference values, and adaptive parameter definition can be performed according to the parameters of the current single-channel dual-gain system. The present invention determines whether and how to adjust the gain of the programmable gain amplifier by comparing the amplitude of the input signal with the gain threshold; Fast Fourier Transform (FFT) is used to analyze the signal spectrum after sampling and determine the amplitude of the signal. The present invention can accurately evaluate the strength of the signal through FFT and gain calculation, and adjust the gain accordingly to ensure that the signal is always in the optimal processing state without overload or distortion; 3. The gain correction factor is a coefficient used to correct the discontinuity caused by gain switching. By calculating the signal-to-noise ratio under different gain modes, the signal quality in each mode can be evaluated. When the signal amplitude is close to the switching threshold, the change in the signal-to-noise ratio before and after the gain switching is calculated, and the moment when the signal-to-noise ratio change is the smallest and meets the continuity requirements is selected as the gain switching moment. By calculating and applying the gain correction factor, the discontinuity near the gain switching point can be eliminated. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a schematic diagram of the application of over-range signals in the prior art; Figure 2 It is a single-channel conditioning circuit diagram in the prior art that configures a sampling channel with a single channel and a single gain as a signal detection; Figure 3 This is a flow chart of a single-channel dual-gain high-precision measurement method in an embodiment of the present application; Figure 4 It is a double sampling setting connection diagram for monitoring a certain phase of a three-phase power system in a single-channel dual-gain high-precision measurement method in one embodiment of the present application; Figure 5 This is a flow chart of step S222 in a single-channel dual-gain high-precision measurement method in one embodiment of the present application; Figure 6 It is a schematic diagram of a device in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The following is combined with Figure 3-6 This application is described in further detail.

[0027] In the existing technology Figure 1 and Figure 2 Based on, in one embodiment, referring to Figure 3 and Figure 4 ,like Figure 3 and Figure 4 As shown, the present application discloses a single-channel dual-gain high-precision measurement method, which specifically includes the following steps: S1: Set the oversampling rate. When the analog input signal is oversampled based on the oversampling rate, a signal-to-noise ratio of a preset high value is achieved. There is a correlation mapping between the oversampling rate and the signal sampling frequency and the Nyquist frequency.

[0028] In this embodiment, if the preset high value is 92.9 dB, the signal-to-noise ratio values ​​of different single-channel dual-gain systems can be defined by oneself.

[0029] Specifically, there is an associated mapping between the oversampling rate and the signal sampling frequency and the Nyquist frequency, including: Based on formula (1), the oversampling rate OSR and the signal sampling frequency f are characterized s , Nyquist frequency f m : White noise power in a single channel measurement system Calculated based on formula (2): In the formula, e rms is the average power of the noise. From formula (2), we can see that increasing OSR can reduce the power of the noise in the system. Since oversampling does not affect the power of the signal, oversampling can improve the signal-to-noise ratio while reducing the noise power and not affecting the signal power.

[0030] In practical applications, the oversampling rate can be determined based on formula (3): f os =4 w *f s (3) In the formula, f os is the oversampling frequency, W is the additional number of bits of resolution; the oversampling rate OSR is 4, and W is 1.

[0031] S2: Two analog-to-digital converter channels are combined to sample the same analog input signal; both channels of the two analog-to-digital converters are provided with programmed gain amplifiers, configured to receive input signals of different numerical magnitudes, and use different gain levels to extend the signal capture range of the analog-to-digital converters.

[0032] In this embodiment, the analog-to-digital converter is the AD7616, which has a programmed gain amplifier (PGA) per channel that can be configured to accept input signals of ±2.5 V, ±5 V, or ±10 V. Combining two AD7616 channels to sample the same input signal and use different gains is the key to improving the dynamic range.

[0033] Specifically, the single-channel dual-gain combined with oversampling technology is used to successfully improve the system resolution and effective dynamic range.

[0034] For example, using AD7616 in a single-channel dual-gain system, the signal-to-noise ratio values ​​that can be achieved when an oversampling rate of 4 and an oversampling rate of 0 are shown in Table 1: Table 1. SNR (signal-to-noise ratio) achieved by oversampling.

[0035] Furthermore, based on formula (4), the correlation between the signal-to-noise ratio and the signal amplitude of the analog input signal is constructed: SNR=20*log 10 (S max / S min ) (4) In the formula, SNR is the signal-to-noise ratio, S max is the maximum amplitude of the signal applied to the analog input of the analog-to-digital converter; S min is the amplitude of the minimum resolvable signal relative to the noise floor.

[0036] S3: When executing signal sampling, a signal sampling operation is performed based on an oversampling rate and a signal input range of different values.

[0037] For example, based on Figure 4 The dual gain sampling setting in Figure 4 A typical dual sampling setup is shown. This connection is a typical connection for monitoring one phase of a three-phase power system. The ADC channels can be allocated as shown in Table 2 below to monitor the three phases. Phase aisle ADC A range (V) ADC B range (V) A V0A / V0B ±2.5 ±10 B V1A / V1B ±2.5 ±10 C V2A / V2B ±2.5 ±10

[0038] Table 2. ADC channel configuration If two input ranges of ±10V and ±2.5V are used for sampling, the highest DR (dynamic range) that can be achieved is formula (5): Specifically, by using a smaller ±2.5V input range setting, overvoltage and overcurrent conditions can be detected by monitoring the A output of the ADC; with this method, the full-scale amplitude range of the ±2.5V range setting is used to protect the dynamic range; then switch to monitoring the larger ±10V input range to capture the nature and amplitude of the fault condition; this method eliminates the need for users to apply dynamic input range adjustment before the ADC, and the channel density of the AD7616 makes dual sampling a cost-effective choice; and the derivation of formula (5) proves that using a dual sampling setting and 4 times OSR, the dynamic range of the AD7616 can be increased to 101dB to meet high-precision measurement requirements.

[0039] In one embodiment, after step S2, a single-channel dual-gain high-precision measurement method further includes: S21: Setting a first gain threshold and a second gain threshold and associating them with two analog-to-digital converters in a one-to-one correspondence.

[0040] In this embodiment, the first gain threshold can be set to 1.4 times the rated power, and the second gain threshold can be set to 1.5 times the rated power; after the two analog-to-digital converters are merged, they are distinguished by the A end and the B end of the ADC; the A end of the ADC is also called the small end, and the B end is called the large end.

[0041] Specifically, the single-channel dual-gain system is provided with two different gains, the small end or the large end, and the small end or the large end can be selected as the default state of the single-channel dual-gain system after the system is initialized. For example, after the system initialization is completed, the default state is at the A end (i.e., the small end) of the ADC; after the analog input signal is processed by the signal amplification and filtering conditioning circuit at the front end of the ADC, the gain threshold is used to dynamically adjust the gain of the single-channel dual-gain system, thereby ensuring the sampling accuracy while preventing the ADC input from exceeding the range.

[0042] S22: Dynamically adjust the gain value of the single-channel dual-gain system through the first gain threshold and the second gain threshold.

[0043] For example, after the system is initialized, it defaults to the A end (i.e., the small end) of the ADC. If the ADC calculation result is between 0 and 1.4 times the rated value, the gain remains unchanged. If it is outside this range, it switches to the B end (i.e., the large end) of the ADC to prevent the ADC from over-ranging.

[0044] S221: After performing a signal sampling operation based on the oversampling rate and the signal input range of different values, performing a fast Fourier transform and gain calculation on the sampled input signal to obtain a signal amplitude.

[0045] In this embodiment, a fast Fourier transform (FFT) is used to calculate a discrete Fourier transform (DFT), which can convert a signal in the time domain to the frequency domain; S222: Compare the signal amplitude with the first gain threshold and the second gain threshold respectively to obtain a comparison result, and automatically switch the corresponding analog input gain terminal based on the comparison result.

[0046] In this embodiment, the first gain threshold and the second gain threshold are set reference values ​​for determining whether the gain of the PGA needs to be adjusted.

[0047] Specifically, first, a suitable oversampling rate is set according to the target signal-to-noise ratio and signal characteristics; then, a first gain threshold and a second gain threshold are set based on the expected input signal range, and the two thresholds correspond to the gain settings of the two analog-to-digital converter channels respectively; the analog input signal is oversampled using the set oversampling rate, and at the same time, the two ADC channels use different gain levels to sample the same signal; the sampled data is fast Fourier transformed to calculate the amplitude of the signal. Then, the calculated signal amplitude is compared with the preset first gain threshold and second gain threshold, and the corresponding PGA gain is automatically adjusted according to the comparison result.

[0048] Specifically, when performing the PGA gain adjustment logic, when the signal amplitude is lower than a certain threshold, it may mean that the signal is too weak, and the PGA gain should be increased. Conversely, if the signal amplitude exceeds another higher threshold, it means that the signal may be close to saturation, and the PGA gain should be reduced.

[0049] In one embodiment, if Figure 5 As shown, in step S222, the signal amplitude is compared with the first gain threshold and the second gain threshold respectively to obtain a comparison result, and the corresponding analog input gain end is automatically switched based on the comparison result, including: S201: According to the preset measurement requirements, determine the switching threshold between the high gain mode and the low gain mode of the single-channel measurement system.

[0050] Specifically, the gain threshold is a set reference value used to determine whether the gain of the analog-to-digital converter (ADC) needs to be adjusted; high gain mode and low gain mode are two operating modes of the ADC, corresponding to different gain settings respectively; the high gain mode is used to process weak signals, and the low gain mode is used to process stronger signals. By switching the gain mode, the dynamic range of the system can be expanded.

[0051] Furthermore, the gain mode switching threshold is determined based on the maximum input range and minimum resolvable signal amplitude of the system, and the switching threshold between the high gain mode and the low gain mode is determined through experiments or simulations; for example, assuming that the maximum input range of the system is ±10V and the minimum resolvable signal amplitude is 10μV, the upper limit of the high gain mode can be set to 1V and the lower limit of the low gain mode can be set to 2V.

[0052] S202: Based on the characteristics of the signal to be measured, preliminarily evaluate the signal amplitude range and select an initial gain mode for signal acquisition.

[0053] Specifically, by monitoring the signal amplitude, it is possible to determine in real time whether the signal exceeds the optimal measurement range of the current gain mode; based on the characteristics of the signal to be measured, the signal amplitude range is preliminarily evaluated, and the initial gain mode is selected for signal acquisition. For example, if the signal is expected to be weak, a high gain mode can be selected; if the signal is expected to be strong, a low gain mode can be selected.

[0054] S203: During the signal acquisition process, the signal amplitude is detected in real time, and when the signal amplitude exceeds the optimal measurement range of the current gain mode, it is automatically switched to another gain mode.

[0055] In this embodiment, during the signal acquisition process, the signal amplitude is detected in real time. When the signal amplitude exceeds the optimal measurement range of the current gain mode, it automatically switches to another gain mode. For example, when the signal amplitude exceeds the upper limit of the high gain mode, it switches to the low gain mode; when the signal amplitude is lower than the lower limit of the low gain mode, it switches to the high gain mode. Real-time detection and automatic switching of gain modes can ensure that the system always works within the optimal measurement range to avoid signal saturation or distortion.

[0056] S204: performing fusion processing on the signal near the gain mode switching point, using a preset correction algorithm to correct the discontinuity caused by the gain switching, and obtaining a continuous signal measurement result.

[0057] Specifically, the gain mode switching point is the point that triggers the gain mode switching when the signal amplitude reaches a certain threshold; the preset correction algorithms include smoothing filtering method, linear interpolation method, spline interpolation method and gain correction factor method.

[0058] In one embodiment, a single-channel dual-gain high-precision measurement method further includes: S10: Based on the calculated signal-to-noise ratios of the signals in different gain modes, compare the signal-to-noise ratio changes of the signals before and after the gain switching, and calculate the optimal gain switching time in combination with the continuity requirement of the signal.

[0059] In this embodiment, the signal-to-noise ratio SNR is the ratio of the signal to the noise, usually expressed in decibels (dB), which is an important indicator for measuring signal quality; the gain switching moment is the time point when the signal amplitude reaches a certain threshold, triggering the gain mode switching; using a standard signal source and a noise source, respectively, the signal is collected in a high gain mode and a low gain mode, and the signal-to-noise ratio is calculated. An oscilloscope, a spectrum analyzer, or a software tool (such as MATLAB) can be used for measurement and calculation.

[0060] Specifically, the signal is collected in high-gain mode and low-gain mode respectively, and the signal-to-noise ratio (SNR) of the signal in each mode is calculated by formula (4) to evaluate the signal quality in each mode; then, the signal-to-noise ratio of the signal is recorded before and after the gain switching, and its changes are compared. According to the change of the signal-to-noise ratio, the necessity and effect of the gain switching are evaluated. Next, the switching threshold between the high-gain mode and the low-gain mode is determined according to the signal characteristics and system requirements. During the signal acquisition process, the signal amplitude is monitored in real time. When the signal amplitude is close to the switching threshold, the change of the signal-to-noise ratio before and after the gain switching is calculated. The moment when the signal-to-noise ratio change is the smallest and meets the continuity requirement is selected as the gain switching moment. The optimal gain switching moment can be obtained by combining the continuity requirement of the signal and using an embedded processor (such as FPGA or DSP) to achieve real-time monitoring and calculation.

[0061] S20: Calculate and apply a gain correction factor according to the change in signal amplitude after gain switching to obtain a final high-precision measurement result.

[0062] In this embodiment, the gain correction factor is a coefficient used to correct the discontinuity caused by gain switching. Specifically, the gain correction factor is calculated according to the change in signal amplitude before and after gain switching. The gain correction factor G corr It can be expressed as G corr =S h / S l , where S h is the signal amplitude in high gain mode, S l is the signal amplitude in low gain mode. Applying the correction factor is to apply the calculated gain correction factor to the signal near the gain switching point. By calculating and applying the gain correction factor, the discontinuity near the gain switching point can be eliminated.

[0063] It should be understood that the serial numbers of the steps in the above embodiments do not imply a sequence of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0064] In one embodiment, a single-channel dual-gain high-precision measurement system is provided, and the single-channel dual-gain high-precision measurement system corresponds to the single-channel dual-gain high-precision measurement method in the above embodiment.

[0065] A single-channel dual-gain high-precision measurement system includes an oversampling rate setting module, a converter merging module and a signal sampling execution module. The detailed description of each functional module is as follows: An oversampling rate setting module is used to set the oversampling rate, and when the analog input signal is oversampled based on the oversampling rate, a signal-to-noise ratio of a preset high value is achieved; there is a correlation mapping between the oversampling rate and the signal sampling frequency and the Nyquist frequency; a converter merging module is used to merge two analog-to-digital converter channels to sample the same analog input signal; the channels of the two analog-to-digital converters are both provided with programmed gain amplifiers, which are configured to receive input signals of different numerical values ​​and use different gain levels to expand the signal capture range of the analog-to-digital converters; The signal sampling execution module is used to perform signal sampling operations based on the oversampling rate and the signal input range of different values ​​when executing signal sampling.

[0066] For the specific definition of a single-channel dual-gain high-precision measurement system, please refer to the definition of a single-channel dual-gain high-precision measurement method in the above text, which will not be repeated here; each module in the above-mentioned single-channel dual-gain high-precision measurement system can be fully or partially implemented by software, hardware and their combination; the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of the above modules.

[0067] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store oversampling rates and gain levels. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a high-precision measurement method for single-channel dual gain is implemented.

[0068] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: S1: Set the oversampling rate. When the analog input signal is oversampled based on the oversampling rate, a signal-to-noise ratio of a preset high value is achieved. There is a correlation mapping between the oversampling rate and the signal sampling frequency and the Nyquist frequency. S2: merging two analog-to-digital converter channels to sample the same analog input signal; both channels of the two analog-to-digital converters are provided with programmed gain amplifiers, configured to receive input signals of different magnitudes, and using different gain levels to extend the signal capture range of the analog-to-digital converters; S3: When executing signal sampling, a signal sampling operation is performed based on an oversampling rate and a signal input range of different values.

[0069] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: S1: Set the oversampling rate. When the analog input signal is oversampled based on the oversampling rate, a signal-to-noise ratio of a preset high value is achieved. There is a correlation mapping between the oversampling rate and the signal sampling frequency and the Nyquist frequency. S2: merging two analog-to-digital converter channels to sample the same analog input signal; both channels of the two analog-to-digital converters are provided with programmed gain amplifiers, configured to receive input signals of different magnitudes, and using different gain levels to extend the signal capture range of the analog-to-digital converters; S3: When executing signal sampling, a signal sampling operation is performed based on an oversampling rate and a signal input range of different values.

[0070] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0071] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0072] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments may still be modified, or some of the features thereof may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A high-precision measurement method for single-channel dual-gain, characterized in that: include: Setting an oversampling rate, and achieving a signal-to-noise ratio of a preset high value when oversampling the analog input signal based on the oversampling rate; There is a correlation mapping between the oversampling rate and the signal sampling frequency and the Nyquist frequency; Combining two analog-to-digital converter channels to sample the same analog input signal; both channels of the two analog-to-digital converters are provided with programmed gain amplifiers configured to receive input signals of different magnitudes and use different gain levels to extend the signal capture range of the analog-to-digital converters; When performing signal sampling, the signal sampling operation is performed based on the oversampling rate and signal input ranges of different values.

2. A single-channel dual-gain high-precision measurement method according to claim 1, characterized in that: The two channels of the analog-to-digital converters are each provided with a programmed gain amplifier, configured to receive input signals of different numerical values, and use different gain levels to expand the signal capture range of the analog-to-digital converter, and further comprising: Setting a first gain threshold and a second gain threshold and associating them with two analog-to-digital converters in a one-to-one correspondence; Dynamically adjust the gain value of the single-channel dual-gain system by using the first gain threshold and the second gain threshold; The dynamically adjusting the gain value of the single-channel measurement system by using the first gain threshold and the second gain threshold comprises: After performing a signal sampling operation based on the oversampling rate and the signal input ranges of different values, performing a fast Fourier transform and gain calculation on the sampled input signal to obtain a signal amplitude; The signal amplitude is compared with the first gain threshold and the second gain threshold respectively to obtain a comparison result, and the corresponding analog input gain terminal is automatically switched based on the comparison result.

3. A single-channel dual-gain high-precision measurement method according to claim 1, characterized in that: There is an associated mapping between the oversampling rate and the signal sampling frequency and the Nyquist frequency, including: Based on formula (1), the oversampling rate OSR and the signal sampling frequency f are characterized s , Nyquist frequency f m : White noise power in a single channel measurement system Calculated based on formula (2): In the formula, e rms is the average power of the noise.

4. A single-channel dual-gain high-precision measurement method according to claim 3, characterized in that: The oversampling ratio is determined based on formula (3): f os =4 w *f s (3) In the formula, f os is the oversampling frequency, W is the additional number of bits of resolution; the oversampling rate OSR is 4.

5. A single-channel dual-gain high-precision measurement method according to claim 4, characterized in that: The analog-to-digital converter is AD7616; W takes a value of 1; and / or, The method also includes: Based on formula (4), the correlation between the signal-to-noise ratio and the signal amplitude of the analog input signal is constructed: SNR=20*log 10 (S max / S min ) (4) In the formula, SNR is the signal-to-noise ratio, S max is the maximum amplitude of the signal applied to the analog input of the analog-to-digital converter; S min is the amplitude of the minimum resolvable signal relative to the noise floor.

6. A single-channel dual-gain high-precision measurement method according to claim 2, characterized in that: The step of comparing the signal amplitude with the first gain threshold and the second gain threshold respectively to obtain a comparison result, and automatically switching the corresponding analog input gain terminal based on the comparison result, comprises: According to preset measurement requirements, determining a switching threshold between a high gain mode and a low gain mode of a single-channel measurement system; Based on the characteristics of the signal to be measured, the signal amplitude range is preliminarily evaluated and the initial gain mode is selected for signal acquisition; During the signal acquisition process, the signal amplitude is detected in real time. When the signal amplitude exceeds the optimal measurement range of the current gain mode, it automatically switches to another gain mode. The signals near the gain mode switching point are fused and processed, and the discontinuity caused by the gain switching is corrected using a preset correction algorithm to obtain continuous signal measurement results.

7. A single-channel dual-gain high-precision measurement method according to claim 6, characterized in that: The method further comprises: Based on the calculated signal-to-noise ratios of the signals under different gain modes, comparing changes in the signal-to-noise ratios of the signals before and after the gain switching, and calculating the optimal gain switching time in combination with the continuity requirement of the signal; According to the change in signal amplitude after gain switching, the gain correction factor is calculated and applied to obtain the final high-precision measurement result.

8. A single-channel dual-gain high-precision measurement system, characterized in that: A high-precision measurement method for a single-channel dual-gain according to any one of claims 1 to 7, the system comprising: An oversampling rate setting module, used to set the oversampling rate, and to achieve a signal-to-noise ratio of a preset high value when oversampling the analog input signal based on the oversampling rate; there is an associated mapping between the oversampling rate and the signal sampling frequency and the Nyquist frequency; A converter merging module, for merging two analog-to-digital converter channels to sample the same analog input signal; the two analog-to-digital converter channels are each provided with a programmed gain amplifier, configured to receive input signals of different magnitudes, and use different gain levels to extend the signal capture range of the analog-to-digital converter; The signal sampling execution module is used to perform a signal sampling operation based on the oversampling rate and a signal input range of different values ​​when executing signal sampling.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the single-channel dual-gain high-precision measurement method as claimed in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of a single-channel dual-gain high-precision measurement method as claimed in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • High performance voice frequency amplifying circuit

    CN101924525A

  • Audio amplification circuit

    CN103138695A

  • High level capable audio amplification circuit

    US20110026739A1

  • Gain ranging analog-to-digital converter with error correction

    US6271780B1

  • Multi-path analog-to-digital and digital-to-analog conversion of PDM signals

    US9871530B1

Cited By

  • Embedded current waveform analysis method and system for frequency converter and medium

    CN120971787A

  • Variable frequency inverter embedded current waveform analysis method, system and medium

    CN120971787B