A test and correction device and method
By using polynomial functions for pre-correction and post-correction in the test system, the signal distortion problem caused by nonlinearity of the test system in the prior art is solved, and the extremely low distortion effect in high-fidelity sound signal testing is achieved.
Patent Information
- Application Number
- CN202210361356.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-07
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-04-07
AI Technical Summary
The prior art is difficult to effectively improve the nonlinearity of the test system, resulting in signal distortion problems. Especially in high-fidelity acoustic signal testing, simple segmentation functions and correction circuits are difficult to meet the requirements of extremely low distortion.
A test correction device is adopted, which includes a signal generation module, a signal acquisition module and a signal processing module. Through the pre-correction and post-correction module, the signal is corrected by a polynomial function to reduce the nonlinear distortion of the system.
Through pre-correction and post-correction of polynomial function, the harmonic distortion of the test system is significantly reduced, the test accuracy is improved, and the extremely low distortion requirements of high-fidelity sound signal testing can be met.
Smart Images

Figure CN114691437B_ABST
Abstract
Description
Technical Field
[0001] The present invention is applied to the technical field of acoustic signal testing and correction, and particularly relates to a testing and correction device and method. Background Art
[0002] With the development of society and the advancement of technology, almost all consumer electronic products have sound-related functions, such as the microphone of a mobile phone can receive sound signals and the speaker can emit sound. Users' demand for high-fidelity sound is becoming more and more intense. High-fidelity sound signals require a test system with extremely low distortion to ensure the accuracy of the test results. Taking electroacoustic test instruments as an example, the dynamic range of the measured electrical signal is required to exceed 120dB, and it is required to have sufficiently low distortion, such as harmonic distortion less than 0.0001%. Usually, sound cards with electroacoustic measurements are used to measure audio amplifiers, high-fidelity chips, speakers, microphones and other products that need to be measured to reduce the total harmonic distortion (THD).
[0003] Since electronic components, especially semiconductor components, have strong nonlinearity, no matter how the system design is optimized, it is impossible to completely eliminate the impact it brings. System nonlinearity is the main cause of signal distortion. If the distortion is to be low enough, the nonlinearity of the system must be improved. The transmission characteristic curve is usually used to describe the nonlinearity of the circuit. By constantly changing the input of the circuit or device, and recording the output value corresponding to each input value, the input value is the x-axis, the output value is the y-axis, and then a curve is obtained. This curve is the transmission characteristic curve of the device.
[0004] Usually, a correction circuit is added to the nonlinear link or a higher performance component is selected. The correction circuit needs to be combined with the actual nonlinear design of the corresponding circuit and is not easy to adjust. For digital instruments, a correction algorithm can be introduced to improve the nonlinearity. After obtaining the curve, a function expression y=h(x) can be used to describe this curve, but it is very difficult to obtain this expression accurately. If the Taylor series expansion of this function is considered, a polynomial function will be obtained, and the coefficients of the polynomial function can be directly fitted to the curve. Using a finite order polynomial function to approximate h(x) can make the fitting error small enough. Test instruments often use piecewise linear functions, but for instruments such as electroacoustic test instruments that have extremely low distortion requirements, simple piecewise functions can no longer meet the requirements. It can only ensure that the error of the endpoint is minimized or the mean square error in the correction interval is minimized, and nonlinearity cannot be completely corrected. In the segmented calibration method, a straight line is used to fit between the endpoints, which is different from the inherent curve of the system, so new distortion is introduced; and the segmented interval or the number of segments of the approximate broken line will directly affect the final correction result. At the same time, the system transfer characteristics are mostly based on static input, without considering the delay in the system's response to the AC signal, and the distortion caused by the delay cannot be eliminated. Summary of the invention
[0005] The technical problem to be solved by the present invention is to overcome the deficiencies of the prior art and provide a test correction device and method which can improve the nonlinearity of a test system and reduce the harmonic distortion of the system.
[0006] The technical solution adopted by the present invention is: the test correction device includes a signal generating module, a signal acquisition module and a signal processing module, the signal generating module and the signal acquisition module are both connected to the signal processing module, the output end of the signal generating module is connected to the input end of the acoustic object to be measured, the input end of the signal acquisition module is connected to the output end of the acoustic object to be measured, the signal processing module includes a pre-correction module and a post-correction module, the input end of the pre-correction module is connected to the input signal port, the output end of the pre-correction module is connected to the input end of the signal generating module, and the output end of the post-correction module is connected to the output signal port , the input end of the post-correction module is connected to the output end of the signal acquisition module, the test correction device also includes a waveform generation module, a waveform analysis module and a THD analysis module, the input end of the THD analysis module is short-circuited between the output end of the signal generation module and the input end of the signal acquisition module, the output end of the THD analysis module is connected to the pre-correction module and the post-correction module, the waveform generation module is connected to the waveform analysis module, the waveform generation module is connected to the pre-correction module through the input signal port, and the waveform analysis module is connected to the post-correction module through the output signal port.
[0007] It can be seen from the above scheme that the signal generation module and the signal acquisition module are structures in the sound card of electroacoustic measurement, and the signal processing module is used to pre-correct or post-correct the signal generation module and the signal acquisition module, thereby reducing the nonlinear distortion of the test system during the test and improving the test accuracy. Among them, the signal generation module and the signal acquisition module can work separately and perform correction separately. When the signal generation module works, the signal waveforms after and before conversion are respectively collected by the THD analysis module and the waveform analysis module, thereby obtaining the harmonic parameters in the signal generation module, and the correction function in the pre-correction module is adjusted by feeding back the harmonic parameters to the pre-correction module to achieve the effect of correcting the signal generation module, and the post-correction of the signal acquisition module is performed in the same way. At the same time, the waveform analysis module and the THD analysis module are set, and are respectively connected to the rear ends of the signal generation module and the signal acquisition module, and the waveform analysis module and the waveform generation module realize the collection of the input and output signals of the signal conversion module, ensure the accuracy and reliability of the collected signal data, and obtain the correction parameters through the input and output signals. Then, the harmonic distortion of the test system is reduced. The waveform generation module is used to generate the sine signal, sweep amplitude, and sweep frequency signals commonly used in acoustic testing, and to send the waveform file to the signal generation module. The waveform analysis module saves the signal collected by the signal acquisition module in a specific format, and is used to receive the digital signal processed by the measurement part, and analyze and measure the indicators of the converted digital signal, such as amplitude, frequency, harmonics, noise, etc. The signal generation module completes the conversion from digital quantity to actual analog quantity, outputs electrical signals such as voltage or current, and the analog back end conditions the electrical signal output by the digital-to-analog conversion into an electrical signal of appropriate size. The analog front end of the signal acquisition module conditions the amplitude of the input electrical signal to an amplitude suitable for analog-to-digital conversion, converts the input single-ended or differential signal into a differential signal suitable for analog-to-digital conversion, and converts the input analog signal into the corresponding digital quantity by analog-to-digital conversion. The THD analysis module is a THD analyzer, which separates the harmonics and fundamental waves of the analog signal or the corresponding digital quantity, and gives the THD calculation result, which is used when correction is needed, such as factory debugging and periodic calibration.
[0008] A preferred solution is that the pre-correction module and the post-correction module receive the correction parameters output by the THD analysis module, and perform pre-correction on the input signal and post-correction on the output signal respectively.
[0009] A further preferred solution is that the signal acquisition module includes a connected digital-to-analog converter and an analog back end, the digital-to-analog converter converts the input digital signal into an analog signal, and the analog back end conditions and outputs the analog signal, the signal acquisition module includes an analog front end and an analog-to-digital converter, the analog front end receives the physical signal and converts it into an analog signal, and the analog-to-digital converter converts the analog signal into a digital signal and outputs it.
[0010] The measurement and correction method of the test and correction device comprises the following steps:
[0011] Step S1, first, initialize the polynomial correction function set in the pre-correction module and the post-correction module, set the coefficient of the first-order term in the correction function to 1, and set the coefficients of the other terms to 0, and at the same time short-circuit the output end of the signal generation module and the input end of the signal acquisition module;
[0012] Step S2, determining the orders M and N of the polynomials in the pre-correction function and the post-correction function, wherein the orders M and N are set by the user or determined by an automatic selection method, wherein the automatic selection method is that the waveform generation module generates a sine wave of a certain frequency, performs preliminary signal analysis on the output ends of the signal generation module and the signal acquisition module, and obtains the reference amplitudes r of the harmonics of the output end signals of the signal generation module and the signal acquisition module respectively. k and analytical amplitude z k , obtaining the orders M1 and N1 of the highest harmonics in the output signal amplitudes of the signal generating module and the signal acquiring module, setting the order M1 to the value of the order M of the pre-correction function, and setting the order N1 to the value of the order N of the post-correction function;
[0013] Step S3, initialize the coefficients of each order of the pre-correction function, adjust the value of the number of terms M2 of the pre-correction function according to the order M, and set the error e k1 The waveform generation module generates a sine wave of a certain frequency, performs signal analysis on the output end of the signal generation module and the input signal port, and obtains the reference amplitude r of each harmonic of the analog signal output after pre-correction. k1 And the analysis amplitude z of each harmonic of the output signal of the input signal port k1 , the reference amplitude r k1 and analytical amplitude z k1 Make a difference to get the current error e k1 The value of the error e k1 Calculate the new coefficient b of each order m1 The value of the pre-correction function is updated with the coefficients b of each order. m The value of b m1, and repeat the analysis and coefficient update of step S3 until the error e k1 The value of is less than the set threshold or exceeds the set number of calculation cycles, then the coefficients b of each order obtained in the last cycle are output. m The value of the pre-correction function is the coefficient b of each order m ;
[0014] Step S4: Initialize the coefficients of each order of the post-correction function, adjust the number of terms N2 of the post-correction function according to the order N, and set the error e k2 The waveform generation module generates a sine wave of a certain frequency, performs signal analysis on the output end of the signal generation module and the output end of the post-correction module, and obtains the reference amplitude r of each harmonic of the analog signal output by the signal generation module. k2 and the analysis amplitude z of each harmonic of the measurement signal output by the post-correction module after correction k2 , the reference amplitude r k2 and analytical amplitude z k2 Make a difference to get the current error e k2 The value of the error e k2 Calculate the new coefficient c of each order n1 The value of the updated correction function coefficient c n The value of n1 , and repeat the analysis and coefficient update of step S4 until the error e k2 If the value is less than the set threshold or exceeds the set number of calculation cycles, the coefficients c of each order obtained in the previous cycle are output. n The value of is used as the coefficient c of each term of the post-correction function n ;
[0015] Step S5: Complete the number of terms M2 and the coefficients b of each term of the pre-correction function. m , and the number of terms N2 and the coefficients c of the post-correction function n Correction.
[0016] As can be seen from the above scheme, the nonlinearity of the device is corrected by a polynomial function to improve the THD performance of the device, wherein the correction function is first initialized to make the coefficient of the first order term 1, and the coefficients of the other terms are all set to 0, thereby realizing the transmission of the unprocessed signal to the signal generation module and the signal acquisition module, respectively performing signal analysis on the two output nodes to obtain the amplitude of each harmonic, and obtaining the order M1 and N1 of the highest harmonic in the amplitude of the two nodes by analysis, thereby determining the high-order terms with greater impact on the signal, and ignoring the high-order terms at the rear by retaining the high-order terms with greater impact, thereby obtaining the most suitable polynomial calibration function. After determining the order, the pre-correction module is adjusted first, and the current error is calculated by analyzing the amplitude of each harmonic of the input and output waveforms of the signal generation module, and then the coefficients of each order term are calculated according to the current error, so as to realize the adjustment of the pre-correction function, and the most accurate coefficients of each order term are obtained by comparing the set threshold and the number of cycles and set in the pre-correction module, thereby completing the pre-correction adjustment of the signal generation module. Similarly, the post-correction adjustment of the signal acquisition module is performed. Then the correction function is adjusted to effectively reduce the harmonic distortion of the test system.
[0017] A preferred solution is that the automatic selection method in step S2 includes the following specific steps:
[0018] Step S2.1, the waveform generation module generates a sine wave G of a certain frequency and outputs it to the pre-correction module;
[0019] Step S2.2: The pre-correction module corrects the sine wave G through the initialized correction function and outputs it to the signal generation module; the THD analysis module collects the analog waveform W output by the signal generation module, analyzes the analog waveform W and outputs the reference amplitude r of each harmonic. k ;
[0020] Step S2.3: The waveform analysis module analyzes the measured value S of the signal acquisition module and outputs the analysis amplitude z of each harmonic. k ;
[0021] Step S2.4, obtain the reference amplitude r of each harmonic k The highest harmonic order M1 and the analytical amplitude z of each harmonic are obtained k The highest harmonic order is N1.
[0022] A preferred solution is that step S3 includes the following specific steps:
[0023] Step S3.1, initialize the coefficients of each order of the pre-correction function, adjust the number of terms M2 of the pre-correction function according to the order M, and set the error e k1 The number of calculation cycles of the threshold value and the coefficients of each order of the pre-correction function;
[0024] Step S3.2, the waveform generation module generates a sine wave of a certain frequency, and the pre-correction module corrects the sine wave according to the updated pre-correction function and outputs it to the signal generation module;
[0025] Step S3.3: The THD analysis module collects and analyzes the analog waveform output by the signal generation module to obtain the reference amplitude r of each harmonic of the analog signal output after pre-correction. k1 ;
[0026] Step S3.4: The waveform analysis module collects and analyzes the sine wave generated by the waveform generation module to obtain the analysis amplitude z of each harmonic of the sine wave. k1 ;
[0027] Step S3.5: Set the reference amplitude r k1 and analytical amplitude z k1 Make a difference to get the current error e k1 The value of the error e k1 Calculate the new coefficient b of each order m1 The value of the pre-correction function is updated with the coefficients b of each order. m The value of b m1 , and return to step S3.2 to loop through steps S3.2-S3.5 until the error e k1 The value is less than the set threshold or exceeds the set number of calculation cycles;
[0028] Step S3.6: Output the coefficients b of each order obtained in the last cycle m The value of the pre-correction function is the coefficient b of each order m .
[0029] A preferred solution is that step S4 includes the following specific steps:
[0030] Step S4.1, initialize the coefficients of each order of the post-correction function, adjust the number of terms N2 of the post-correction function according to the order N, and set the error e k2 The number of calculation cycles of the threshold value and the coefficients of each order of the post-correction function;
[0031] Step S4.2, the waveform generating module generates a sine wave of a certain frequency, the pre-correction module corrects the sine wave according to the pre-correction function updated in step S3 and outputs it to the signal generating module, the signal acquisition module acquires the analog waveform generated by the signal generating module, and the post-correction module performs post-correction on the measurement signal acquired by the signal acquisition module and outputs it;
[0032] Step S4.3: The THD analysis module collects and analyzes the analog waveform output by the signal generation module to obtain the reference amplitude r of each harmonic of the analog signal output after pre-correction. k2 ;
[0033] Step S4.4: The waveform analysis module collects and analyzes the measurement signal corrected by the post-correction module to obtain the analysis amplitude z of each harmonic of the corrected measurement signal. k2 ;
[0034] Step S4.5: Set the reference amplitude r k2 and analytical amplitude z k2 Make a difference to get the current error e k2 The value of the error e k2 Calculate the new coefficient c of each order n1 The value of the updated correction function coefficient c n The value of n1 , and return to step S4.2 to loop through steps S4.2-S4.5 until the error e k2 The value is less than the set threshold or exceeds the set number of calculation cycles;
[0035] Step S4.6: Output the coefficients c of each order obtained in the last cycle n The value of is used as the coefficient c of each term of the post-correction function n .
[0036] A preferred solution is that step S3 updates the order M and the coefficient b m The pre-correction function is , where D is the output value of the pre-correction module, G is the waveform value generated by the waveform generation module, and the step S4 updates the order N and the coefficient c n The post-correction function is , where S is the measurement correction value output by the pre-correction module, and A is the output value of the signal acquisition module.
[0037] A preferred solution is that after obtaining the error value in step S3 and step S4, new coefficients of each order term are calculated by LMS algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 is a connection relationship diagram of the test and correction device;
[0039] Figure 2 It is a flow chart of the use of the correction function;
[0040] Figure 3 is a schematic diagram of signal transmission of the measurement correction method;
[0041] Figure 4 is a workflow diagram of the measurement correction method. DETAILED DESCRIPTION
[0042] like Figure 1 As shown, in this embodiment, the test correction device includes a signal generating module 1, a signal acquisition module 2 and a signal processing module, the signal generating module 1 and the signal acquisition module 2 are both connected to the signal processing module, the output end of the signal generating module 1 is connected to the input end of the acoustic object under test, the input end of the signal acquisition module 2 is connected to the output end of the acoustic object under test, the signal processing module includes a pre-correction module 3 and a post-correction module 4, the input end of the pre-correction module 3 is connected to the input signal port, the output end of the pre-correction module 3 is connected to the input end of the signal generating module 1, the output end of the post-correction module 4 is connected to the output signal port, and the post The input end of the correction module 4 is connected to the output end of the signal acquisition module 2. The test correction device also includes a waveform generating module 5, a waveform analyzing module 6 and a THD analyzing module 7. The input end of the THD analyzing module 7 is short-circuited between the output end of the signal generating module 1 and the input end of the signal acquisition module 2. The output end of the THD analyzing module 7 is connected to the pre-correction module 3 and the post-correction module 4. The waveform generating module 5 is connected to the waveform analyzing module 6. The waveform generating module 5 is connected to the pre-correction module 3 via the input signal port. The waveform analyzing module 6 is connected to the post-correction module 4 via the output signal port.
[0043] In this embodiment, the pre-correction module 3 and the post-correction module 4 receive the correction parameters output by the THD analysis module 7, and perform pre-correction on the input signal and post-correction on the output signal respectively.
[0044] In this embodiment, the signal acquisition module 2 includes a digital-to-analog converter and an analog back end connected to each other, the digital-to-analog converter converts the input digital signal into an analog signal, and the analog back end conditions and outputs the analog signal. The signal acquisition module 2 includes an analog front end and an analog-to-digital converter, the analog front end receives a physical signal and converts it into an analog signal, and the analog-to-digital converter converts the analog signal into a digital signal and outputs it.
[0045] The existence of nonlinearity in circuits is a common phenomenon, and the transfer characteristic curve is usually used to describe the nonlinearity of the circuit. By constantly changing the input of the circuit or device, and recording the output value corresponding to each input value, with the input value as the x-axis and the output value as the y-axis and then plotting, a curve can be obtained, which is the transfer characteristic curve of the device. After obtaining the curve, a function expression y=h(x) can be used to describe the curve, but it is very difficult to obtain this expression accurately. If you consider performing a Taylor series expansion on this function, you will get a polynomial function, and the coefficients of the polynomial function can be directly fitted to the curve. Using a finite order polynomial function to approximate h(x) can make the fitting error small enough.
[0046] Now let's do a qualitative analysis and assume that the polynomial expression of the transfer function is as follows:
[0047] ; where a1, a2 to an are the coefficients of each term.
[0048] Assume the input is , substitute into the polynomial function, ignore the coefficients above 3 for the convenience of analysis, and you can get the output expression: ; The first item is the DC component, the second item is the fundamental signal, and the last two items are the 2nd and 3rd harmonics.
[0049] By observing the coefficients of each component, we can see that the coefficients of the even-order terms will affect the amplitudes of the DC component and even-order harmonics, while the coefficients of the odd-order terms will only affect the amplitudes of the fundamental wave and odd-order harmonics. After substituting the amplitudes of each harmonic into the THD calculation formula, we get ;
[0050] It can be seen that THD is also affected by the amplitude of the input signal. If the coefficients above the second order are all 0, that is, the transmission characteristic is a first-order function, then the system has no harmonic distortion.
[0051] Now let's do a quantitative analysis, assuming that the coefficients are as follows, and change the coefficient of the third-order term, and substitute it into the THD formula to get:
[0052] ; If the coefficient of the third-order term is less than the coefficient of the second-order term, it is mainly the second-order term that affects the THD value. For most devices, their linearity is already very good, such as 0.1%, and it can be simply assumed that their second-order term coefficient is also less than 0.1%. If you want to improve its THD, you must find a way to reduce the second-order term coefficient to below 0.1%, that is, make the system characteristics as linear as possible.
[0053] For most test systems, piecewise functions are often used to approximate the transfer function of the system. This approach uses a finite broken line to approximate the curve, which can meet basic application requirements. However, for acoustic test instruments, the nonlinearity of the selected components themselves is already very small, and a simple linear function can no longer meet its THD requirements. As mentioned earlier, the transfer characteristics of the system can be approximated by a polynomial, and similarly, its inverse function can also be approximated by a polynomial. Although there is a certain error in using a finite polynomial function to approximate the ideal correction function, it can be seen from the previous analysis that the main factors affecting the THD test results are the higher-order terms with larger coefficients, such as the quadratic terms in the previous example.
[0054] By observing the harmonic composition of the output signal, we can decide which high-order terms need to be retained. The high-order terms that need to be retained are those with obvious spectral lines in the output signal spectrum and are integer multiples of the fundamental wave. For example, if the 2nd and 3rd harmonics are obvious, the 2nd and 3rd terms need to be retained, and other high-order terms can be ignored. In this way, the order of the correction function can be determined.
[0055] like Figure 2 As shown in the figure, the use of correction functions usually takes two forms. If the signal is processed by the correction function before entering the actual signal device, it is called the pre-correction method, otherwise it is the post-correction method. The signal measurement or acquisition device uses the post-correction method, and the correction function is placed in the post position. The distorted signal measured by the measurement device passes through a specific post-correction function to parse out the original input signal. The signal generation device uses the pre-correction method, and the correction function is placed in the front position, so that the signal input to the generation device has a certain degree of controllable distortion. If the distortion direction is just opposite to the distortion caused by the nonlinearity of the system, the actual output analog signal distortion will be offset, thereby improving the harmonic distortion of the output signal.
[0056] The coefficients of each order in the correction function can be obtained by curve fitting when obtaining the device transfer characteristic curve. That is, the output y of the transfer characteristic curve is used as the x of the correction function, and the input x of the transfer characteristic curve is used as the output y of the correction function. The fitted function is the inverse function of the transfer characteristic curve. It is also possible to give each coefficient an initial value, and continuously adjust each coefficient through an adaptive learning algorithm while observing the change in the THD value of the system. When the THD value tends to a constant value, stop adjusting the coefficient, and you can get the optimal value of the correction coefficient under the specified order. This method does not require obtaining the transfer function of the device in advance.
[0057] The coefficients of each order term in the correction function can be obtained by curve fitting when acquiring the transmission characteristic curve of the device. That is, the output y of the transmission characteristic curve is used as the x of the correction function, and the input x of the transmission characteristic curve is used as the output y of the correction function. The fitted function is the inverse function of the transmission characteristic curve. By continuously adjusting each coefficient through the measurement correction method, while observing the change of the THD value of the system, when the THD value tends to a constant value, stop adjusting the coefficient, and you can get the optimal value of the correction coefficient under the specified order. This method does not need to obtain the transfer function of the signal generation module 1 and the signal acquisition module 2 in advance.
[0058] like Figure 3 and Figure 4 As shown, in this embodiment, the measurement correction method includes the following steps:
[0059] Step S1, first, initialize the polynomial correction function set in the pre-correction module 3 and the post-correction module 4, set the coefficient of the first-order term in the correction function to 1, and set the coefficients of the other terms to 0, and at the same time short-circuit the output end of the signal generation module 1 and the input end of the signal acquisition module 2;
[0060] Step S2, determining the orders M and N of the polynomials in the pre-correction function and the post-correction function, wherein the orders M and N are set by a user or determined by an automatic selection method, wherein the automatic selection method is that the waveform generation module (5) generates a sine wave of a certain frequency, performs preliminary signal analysis on the output ends of the signal generation module (1) and the signal acquisition module (2), and obtains reference amplitudes r of the harmonics of the output end signals of the signal generation module (1) and the signal acquisition module (2). k and analytical amplitude z k , obtaining the orders M1 and N1 of the highest harmonics in the output signal amplitudes of the signal generating module (1) and the signal collecting module (2), setting the order M1 to the value of the order M of the pre-correction function, and setting the order N1 to the value of the order N of the post-correction function;
[0061] Step S3, initialize the coefficients of each order of the pre-correction function, adjust the value of the number of terms M2 of the pre-correction function according to the order M, and set the error e k1 The waveform generation module (5) generates a sine wave of a certain frequency, performs signal analysis on the output end of the signal generation module (1) and the input signal port, and obtains the reference amplitude r of each harmonic of the analog signal output after pre-correction. k1 And the analysis amplitude z of each harmonic of the output signal of the input signal port k1 , the reference amplitude r k1 and analytical amplitude z k1Make a difference to get the current error e k1 The value of the error e k1 Calculate the new coefficient b of each order m1 The value of the pre-correction function is updated with the coefficients b of each order. m The value of b m1 , and repeat the analysis and coefficient update of step S3 until the error e k1 The value of is less than the set threshold or exceeds the set number of calculation cycles, then the coefficients b of each order obtained in the last cycle are output. m The value of the pre-correction function is the coefficient b of each order m ;
[0062] Step S4: Initialize the coefficients of each order of the post-correction function, adjust the number of terms N2 of the post-correction function according to the order N, and set the error e k2 The waveform generation module (5) generates a sine wave of a certain frequency, performs signal analysis on the output end of the signal generation module (1) and the output end of the post-correction module (4), and obtains the reference amplitude r of each harmonic of the analog signal output by the signal generation module (1). k2 and the analysis amplitude z of each harmonic of the measurement signal output after correction by the post-correction module (4) k2 , the reference amplitude r k2 and analytical amplitude z k2 Make a difference to get the current error e k2 The value of the error e k2 Calculate the new coefficient c of each order n1 The value of the updated correction function coefficient c n The value of n1 , and repeat the analysis and coefficient update of step S4 until the error e k2 If the value is less than the set threshold or exceeds the set number of calculation cycles, the coefficients c of each order obtained in the previous cycle are output. n The value of is used as the coefficient c of each term of the post-correction function n ;
[0063] Step S5: Complete the number of terms M2 and the coefficients b of each term of the pre-correction function. m , and the number of terms N2 and the coefficients c of the post-correction function n Correction.
[0064] The automatic selection method in step S2 includes the following specific steps:
[0065] Step S2.1, the waveform generation module 5 generates a sine wave G of a certain frequency and outputs it to the pre-correction module 3;
[0066] Step S2.2, the pre-correction module (3) corrects the sine wave G through the initialized correction function and outputs it to the signal generation module (1), the THD analysis module (7) collects the analog waveform W output by the signal generation module (1), analyzes the analog waveform W and outputs the reference amplitude r of each harmonic k ;
[0067] Step S2.3: The waveform analysis module (6) analyzes the measurement value S of the signal acquisition module (2) and outputs the analysis amplitude z of each harmonic. k ;
[0068] Step S2.4, obtain the reference amplitude r of each harmonic k The highest harmonic order M1 and the analytical amplitude z of each harmonic are obtained k The highest harmonic order is N1.
[0069] The step S3 includes the following specific steps:
[0070] Step S3.1, initialize the coefficients of each order of the pre-correction function, adjust the number of terms M2 of the pre-correction function according to the order M, and set the error e k1 The number of calculation cycles of the threshold value and the coefficients of each order of the pre-correction function;
[0071] Step S3.2, the waveform generating module (5) generates a sine wave of a certain frequency, and the pre-correction module (3) corrects the sine wave according to the updated pre-correction function and outputs it to the signal generating module (1);
[0072] Step S3.3: The THD analysis module (7) collects and analyzes the analog waveform output by the signal generation module (1) to obtain the reference amplitude r of each harmonic of the analog signal output after pre-correction. k1 ;
[0073] Step S3.4: The waveform analysis module (6) collects and analyzes the sine wave generated by the waveform generation module (5) to obtain the analysis amplitude z of each harmonic of the sine wave. k1 ;
[0074] Step S3.5: Set the reference amplitude r k1 and analytical amplitude z k1 Make a difference to get the current error e k1 The value of the error e k1 Calculate the new coefficient b of each order m1 The value of the pre-correction function is updated with the coefficients b of each order. m The value of b m1 , and return to step S3.2 to loop through steps S3.2-S3.5 until the error ek1 The value is less than the set threshold or exceeds the set number of calculation cycles;
[0075] Step S3.6: Output the coefficients b of each order obtained in the last cycle m The value of the pre-correction function is the coefficient b of each order m .
[0076] The step S4 includes the following specific steps:
[0077] Step S4.1, initialize the coefficients of each order of the post-correction function, adjust the number of terms N2 of the post-correction function according to the order N, and set the error e k2 The number of calculation cycles of the threshold value and the coefficients of each order of the post-correction function;
[0078] Step S4.2, the waveform generating module (5) generates a sine wave of a certain frequency, the pre-correction module corrects the sine wave according to the pre-correction function updated in step S3 and outputs it to the signal generating module (1), the signal acquisition module (2) acquires the analog waveform generated by the signal generating module (1), and the post-correction module (4) performs post-correction on the measurement signal acquired by the signal acquisition module (2) and outputs it;
[0079] Step S4.3: The THD analysis module (7) collects and analyzes the analog waveform output by the signal generation module (1) to obtain the reference amplitude r of each harmonic of the analog signal output after pre-correction. k2 ;
[0080] Step S4.4: The waveform analysis module (6) collects and analyzes the measurement signal corrected by the post-correction module (4) to obtain the analysis amplitude z of each harmonic of the corrected measurement signal. k2 ;
[0081] Step S4.5: Set the reference amplitude r k2 and analytical amplitude z k2 Make a difference to get the current error e k2 The value of the error e k2 Calculate the new coefficient c of each order n1 The value of the updated correction function coefficient c n The value of n1 , and return to step S4.2 to loop through steps S4.2-S4.5 until the error e k2 The value is less than the set threshold or exceeds the set number of calculation cycles;
[0082] Step S4.6: Output the coefficients c of each order obtained in the last cycle n The value of is used as the coefficient c of each term of the post-correction function n .
[0083] In this embodiment, step S3 updates the order M and the coefficient b m The pre-correction function is , wherein D is the output value of the pre-correction module (3), G is the waveform value generated by the waveform generation module (5), and step S4 updates the order N and the coefficient c n The post-correction function is , wherein S is the measurement correction value output by the pre-correction module (3), and A is the output value of the signal acquisition module (2).
[0084] In this embodiment, after the error values are obtained in step S3 and step S4, new coefficients of each order term are calculated by an adaptive iterative algorithm such as LMS algorithm, least squares method or a non-iterative algorithm.
[0085] In step S1, if the signal generating module 1 and the signal collecting module 2 have very obvious nonlinearity, such as inconsistent transmission characteristics under large signal amplitude and small signal amplitude, each signal amplitude can be corrected separately, that is, the amplitude of the signal generation is changed and the above steps are repeated.
[0086] For the signal generation module 1 and the signal acquisition module 2 with certain delay characteristics, a delay compensation term can also be introduced into the polynomial function to improve the correction effect. The polynomial with the delay compensation term is as follows:
[0087] .
[0088] The correction function set in the pre-correction module 3 and the post-correction module 4 can also be:
[0089] Non-memory polynomial ; or a nonlinear tap delay polynomial: .
[0090] The coefficient updating algorithm should not be limited to the LMS algorithm, but other adaptive iterative algorithms or non-iterative algorithms such as the most common least squares method can also be used.
Claims
1. A measurement correction method for a test correction device, the test correction device comprising a signal generating module (1), a signal acquisition module (2) and a signal processing module, the signal generating module (1) and the signal acquisition module (2) are both connected to the signal processing module, the output end of the signal generating module (1) is connected to the input end of the acoustic object to be measured, the input end of the signal acquisition module (2) is connected to the output end of the acoustic object to be measured, the signal processing module comprises a pre-correction module (3) and a post-correction module (4), the input end of the pre-correction module (3) is connected to the input signal port, the output end of the pre-correction module (3) is connected to the input end of the signal generating module (1), the output end of the post-correction module (4) is connected to the output signal port, and the post-correction module ( The input end of the signal generating module (1) is connected to the output end of the signal acquisition module (2), the test and correction device further comprises a waveform generating module (5), a waveform analyzing module (6) and a THD analyzing module (7), the input end of the THD analyzing module (7) is connected between the output end of the signal generating module (1) and the input end of the signal acquisition module (2), the output end of the THD analyzing module (7) is connected to the pre-correction module (3) and the post-correction module (4), the waveform generating module (5) is connected to the waveform analyzing module (6), the waveform generating module (5) is connected to the pre-correction module (3) via the input signal port, and the waveform analyzing module (6) is connected to the post-correction module (4) via the output signal port; characterized in that: The measurement and correction method comprises the following steps: Step S1, first, the polynomial correction function set in the pre-correction module (3) and the post-correction module (4) is initialized, the coefficient of the first-order term in the correction function is set to 1, and the coefficients of the other terms are set to 0, and at the same time, the output end of the signal generation module (1) and the input end of the signal acquisition module (2) are short-circuited; Step S2, determining the orders M and N of the polynomials in the pre-correction function and the post-correction function, wherein the orders M and N are set by a user or determined by an automatic selection method, wherein the automatic selection method is that the waveform generation module (5) generates a sine wave of a certain frequency, performs preliminary signal analysis on the output ends of the signal generation module (1) and the signal acquisition module (2), and obtains reference amplitudes r of the harmonics of the output end signals of the signal generation module (1) and the signal acquisition module (2). k and analytical amplitude z k , obtaining the orders M1 and N1 of the highest harmonics in the output signal amplitudes of the signal generating module (1) and the signal collecting module (2), setting the order M1 to the value of the order M of the pre-correction function, and setting the order N1 to the value of the order N of the post-correction function; Step S3, initialize the coefficients of each order of the pre-correction function, adjust the value of the number of terms M2 of the pre-correction function according to the order M, and set the error e k1 The waveform generation module (5) generates a sine wave of a certain frequency, performs signal analysis on the output end of the signal generation module (1) and the input signal port, and obtains the reference amplitude r of each harmonic of the analog signal output after pre-correction. k1 And the analysis amplitude z of each harmonic of the output signal of the input signal port k1 , the reference amplitude r k1 and analytical amplitude z k1 Make a difference to get the current error e k1 The value of the error e k1 Calculate the new coefficient b of each order m1 The value of the pre-correction function is updated with the coefficients b of each order. m The value of b m1 , and repeat the analysis and coefficient update of step S3 until the error e k1 The value of is less than the set threshold or exceeds the set number of calculation cycles, then the coefficients b of each order obtained in the last cycle are output. m The value of the pre-correction function is the coefficient b of each order m ; Step S4: Initialize the coefficients of each order of the post-correction function, adjust the number of terms N2 of the post-correction function according to the order N, and set the error e k2 The waveform generation module (5) generates a sine wave of a certain frequency, performs signal analysis on the output end of the signal generation module (1) and the output end of the post-correction module (4), and obtains the reference amplitude r of each harmonic of the analog signal output by the signal generation module (1). k2 and the analysis amplitude z of each harmonic of the measurement signal output after correction by the post-correction module (4) k2 , the reference amplitude r k2 and analytical amplitude z k2 Make a difference to get the current error e k2 The value of the error e k2 Calculate the new coefficient c of each order n1 The value of the updated correction function coefficient c n The value of n1 , and repeat the analysis and update coefficients of step S4 until the error e k2 If the value is less than the set threshold or exceeds the set number of calculation cycles, the coefficients c of each order obtained in the previous cycle are output. n The value of is used as the coefficient c of each term of the post-correction function n ; Step S5: Complete the number of terms M2 and the coefficients b of each term of the pre-correction function. m , and the number of terms N2 and the coefficients c of the post-correction function n Correction.
2. The measurement and correction method according to claim 1, characterized in that: The pre-correction module (3) and the post-correction module (4) receive the correction parameters output by the THD analysis module (7), and perform pre-correction on the input signal and post-correction on the output signal respectively.
3. The measurement and correction method according to claim 2, characterized in that: The signal acquisition module (2) comprises a digital-to-analog converter and an analog backend connected to each other, the digital-to-analog converter converts an input digital signal into an analog signal, the analog backend conditions and outputs the analog signal, the signal acquisition module (2) comprises an analog front end and an analog-to-digital converter, the analog front end receives a physical signal and converts it into an analog signal, and the analog-to-digital converter converts the analog signal into a digital signal and outputs it.
4. The measurement and correction method according to claim 1, characterized in that: The automatic selection method in step S2 includes the following specific steps: Step S2.1, the waveform generation module (5) generates a sine wave G of a certain frequency and outputs it to the pre-correction module (3); Step S2.2, the pre-correction module (3) corrects the sine wave G through the initialized correction function and outputs it to the signal generation module (1), the THD analysis module (7) collects the analog waveform W output by the signal generation module (1), analyzes the analog waveform W and outputs the reference amplitude r of each harmonic k ; Step S2.3: The waveform analysis module (6) analyzes the measurement value S of the signal acquisition module (2) and outputs the analysis amplitude z of each harmonic. k ; Step S2.4, obtain the reference amplitude r of each harmonic k The highest harmonic order M1 and the analytical amplitude z of each harmonic are obtained k The highest harmonic order is N1.
5. The measurement and correction method according to claim 1, characterized in that: The step S3 includes the following specific steps: Step S3.1, initialize the coefficients of each order of the pre-correction function, adjust the number of terms M2 of the pre-correction function according to the order M, and set the error e k1 The number of calculation cycles of the threshold value and the coefficients of each order of the pre-correction function; Step S3.2, the waveform generating module (5) generates a sine wave of a certain frequency, and the pre-correction module (3) corrects the sine wave according to the updated pre-correction function and outputs it to the signal generating module (1); Step S3.3: The THD analysis module (7) collects and analyzes the analog waveform output by the signal generation module (1) to obtain the reference amplitude r of each harmonic of the analog signal output after pre-correction. k1 ; Step S3.4: The waveform analysis module (6) collects and analyzes the sine wave generated by the waveform generation module (5) to obtain the analysis amplitude z of each harmonic of the sine wave. k1 ; Step S3.5: Set the reference amplitude r k1 and analytical amplitude z k1 Make a difference to get the current error e k1 The value of the error e k1 Calculate the new coefficient b of each order m1 The value of the pre-correction function is updated with the coefficients b of each order. m The value of b m1 , and return to step S3.2 to loop through steps S3.2-S3.5 until the error e k1 The value is less than the set threshold or exceeds the set number of calculation cycles; Step S3.6: Output the coefficients b of each order obtained in the last cycle m The value of the pre-correction function is the coefficient b of each order m .
6. The measurement and correction method according to claim 1, characterized in that: The step S4 includes the following specific steps: Step S4.1, initialize the coefficients of each order of the post-correction function, adjust the number of terms N2 of the post-correction function according to the order N, and set the error e k2 The number of calculation cycles of the threshold value and the coefficients of each order of the post-correction function; Step S4.2, the waveform generating module (5) generates a sine wave of a certain frequency, the pre-correction module corrects the sine wave according to the pre-correction function updated in step S3 and outputs it to the signal generating module (1), the signal acquisition module (2) acquires the analog waveform generated by the signal generating module (1), and the post-correction module (4) performs post-correction on the measurement signal acquired by the signal acquisition module (2) and outputs it; Step S4.3: The THD analysis module (7) collects and analyzes the analog waveform output by the signal generation module (1) to obtain the reference amplitude r of each harmonic of the analog signal output after pre-correction. k2 ; Step S4.4: The waveform analysis module (6) collects and analyzes the measurement signal corrected by the post-correction module (4) to obtain the analysis amplitude z of each harmonic of the corrected measurement signal. k2 ; Step S4.5: Set the reference amplitude r k2 and analytical amplitude z k2 Make a difference to get the current error e k2 The value of the error e k2 Calculate the new coefficient c of each order n1 The value of the updated correction function coefficient c n The value of n1 , and return to step S4.2 to loop through steps S4.2-S4.5 until the error e k2 The value is less than the set threshold or exceeds the set number of calculation cycles; Step S4.6: Output the coefficients c of each order obtained in the last cycle n The value of is used as the coefficient c of each term of the post-correction function n .
7. The measurement and correction method according to claim 1, characterized in that: The step S3 updates the order M and the coefficient b m The following pre-correction function is , wherein D is the output value of the pre-correction module (3), G is the waveform value generated by the waveform generation module (5), and step S4 updates the order N and the coefficient c n The post-correction function is , wherein S is the measurement correction value output by the pre-correction module (3), and A is the output value of the signal acquisition module (2).
8. The measurement and correction method according to claim 1, characterized in that: After obtaining the error value in step S3 and step S4, new coefficients of each order term are calculated by LMS algorithm.
Citation Information
Patent Citations
Nonlinear correction method for improving spurious-free dynamic range of analog-to-digital converter
CN111654286A
Switching amplifier having digital correction and method therefor
US20020180518A1