Amplitude-frequency fading compensation method, device, equipment and signal generation system
The operational amplifier-based compensation method addresses amplitude-frequency distortion in signal generators by adjusting gain coefficients for precise amplitude control, offering a simple, resource-efficient, and flexible solution with high accuracy.
Patent Information
- Application Number
- CN202411254470.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-27
AI Technical Summary
Existing amplitude-frequency distortion in signal generators due to the zero-order hold characteristic of DACs and analog circuit components leads to amplitude-frequency attenuation, with traditional compensation methods being cumbersome, resource-intensive, or inflexible.
A method using an operational amplifier to adjust gain coefficients based on a frequency sweep signal, measuring amplitudes, and determining target gain coefficients to compensate for amplitude-frequency fading, employing segmented gain functions for precise adjustment.
The method provides simple, resource-efficient, and flexible amplitude-frequency compensation with high accuracy, maintaining signal amplitudes at target levels.
Smart Images

Figure CN119210439A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to an amplitude-frequency fading compensation method, device, equipment, signal generating system and readable storage medium. Background Art
[0002] A digital to analog converter (DAC) can convert input discrete digital waveform data into a continuous analog signal. It is often used in signal generators to convert digital signals generated by a direct digital synthesizer (DDS) at the digital end into analog signals.
[0003] However, when the DAC is working, due to its own zero-order hold characteristic, it will introduce amplitude-frequency distortion. The specific phenomenon is that the amplitude of the output signal changes with the increase of frequency. In addition, in the signal generator, the components on the analog circuit will also affect the amplitude flatness of the output signal. The two act together on the output signal, causing the signal to produce amplitude-frequency attenuation, such as Figure 1 shown.
[0004] Traditionally, digital filters or analog filters are used to filter the output signal. The amplitude-frequency response characteristics of the filter complement the original amplitude-frequency distortion characteristics, so that the signal passes through the filter to compensate for the amplitude-frequency fading. However, the pre-compensation digital filter method requires solving the filter coefficients based on the amplitude-frequency fading curve. The coefficient solution method is relatively cumbersome, and the filter effect is related to its order. High-order filters have good filtering effects, but consume more resources. The post-compensation analog filter method has poor flexibility because the amplitude-frequency compensation characteristics are fixed by hardware, and the differences in the characteristics of the analog components themselves will also lead to unstable compensation effects. Summary of the invention
[0005] The present application provides an amplitude-frequency fading compensation method, device, equipment, signal generating system and readable storage medium, which have a simple compensation method, small resource occupation, high flexibility and good compensation effect.
[0006] A method for compensating for amplitude-frequency fading is applied to a signal generator, wherein the signal generator comprises a direct digital frequency synthesizer, a digital-to-analog converter and an operational amplifier connected in sequence, and the method for compensating for amplitude-frequency fading comprises:
[0007] Controlling the direct digital frequency synthesizer to output a frequency sweep signal;
[0008] measuring the signal amplitude of the frequency sweep signal at each sample frequency after being amplified by the operational amplifier;
[0009] Adjusting the gain coefficient of the operational amplifier, and when the amplitude of each signal reaches a preset amplitude, obtaining a gain coefficient function based on the sample frequency and the adjusted gain coefficient;
[0010] Determining a target sample gain coefficient at a target frequency based on the gain coefficient function, and determining a target gain coefficient according to the target sample gain coefficient, the preset amplitude and the target amplitude; wherein the target gain coefficient is equal to the product of a quotient of the target amplitude and the preset amplitude and the target sample gain coefficient;
[0011] The operational amplifier is controlled to amplify the amplitude of the target signal output by the digital-to-analog converter according to the target gain coefficient.
[0012] In one embodiment, the gain coefficient function includes a multi-segment segmented gain function, and the method further includes:
[0013] Acquire an amplitude-frequency characteristic curve of the swept frequency signal according to the signal amplitude of the swept frequency signal at each of the sample frequencies, and segment the amplitude-frequency characteristic curve based on a dichotomy method;
[0014] The step of adjusting the gain coefficient of the operational amplifier, when adjusting until each signal amplitude reaches a preset amplitude, obtaining a gain coefficient function based on the sample frequency and the adjusted gain coefficient comprises:
[0015] Adjusting the gain coefficient of the operational amplifier for each segmented sub-curve obtained by segmentation, and when the signal amplitudes on each sub-curve are adjusted to reach a preset amplitude, obtaining the segmented gain function based on the sample frequency on each sub-curve and the adjusted gain coefficients;
[0016] Determining the sample target gain coefficient at the target frequency based on the gain coefficient function includes:
[0017] Determining a target segmented gain function in each segmented gain function according to the frequency range of the sub-curve in which the target frequency falls;
[0018] Based on the target segmental gain function, the target sample gain coefficient corresponding to the target frequency is determined.
[0019] In one embodiment, obtaining the segmented gain function based on the sample frequency on each of the sub-curves and the adjusted gain coefficients comprises:
[0020] Obtaining an intermediate gain function based on the sample frequency of each of the sub-curves and the adjusted gain coefficient;
[0021] Determine a plurality of test frequencies within the frequency range of each of the sub-curves, and for each of the plurality of test frequencies of the sub-curve, determine a test gain coefficient at each of the test frequencies based on the intermediate gain function corresponding to the sub-curve;
[0022] Controlling the direct digital frequency synthesizer to output a test frequency sweep signal at each test frequency, and controlling the operational amplifier to amplify the test frequency sweep signal according to the corresponding test gain coefficient;
[0023] If the amplitude of the amplified test frequency sweep signal is within a preset fluctuation range, the intermediate gain function is used as the segmented gain function;
[0024] If the amplitude of the amplified test swept frequency signal exceeds the preset fluctuation range, the sub-curve is segmented based on the binary method, and the step of adjusting the gain coefficient of the operational amplifier for each segmented sub-curve is returned to until all the intermediate gain functions are used as the segmented gain functions.
[0025] In one embodiment, adjusting the gain coefficient of the operational amplifier for each segment of the sub-curve obtained by segmentation includes:
[0026] Respectively obtaining multiple groups of slope values of each of the sub-curves obtained by segmentation;
[0027] If the variance of the slope values of each group of the sub-curve does not exceed the preset threshold, the gain coefficient of the operational amplifier is adjusted according to the numerical change trend of the linear function; if the variance of the slope values of each group of the sub-curve exceeds the preset threshold, the gain coefficient of the operational amplifier is adjusted according to the numerical change trend of the quadratic function.
[0028] In one embodiment, obtaining the intermediate gain function based on the sample frequency of each sub-curve and the adjusted gain coefficient comprises:
[0029] If the variance of the slope values of each group of the sub-curve does not exceed the preset threshold, the linear function is used as the fitting function to fit the sample frequency and the adjusted gain coefficient to obtain the intermediate gain function; if the variance of the slope values of each group of the sub-curve exceeds the preset threshold, the quadratic function is used as the fitting function to fit the sample frequency and the adjusted gain coefficient to obtain the intermediate gain function.
[0030] In one embodiment, the step of respectively obtaining the multiple groups of slope values of each of the sub-curves obtained by segmentation includes:
[0031] For each of the sub-curves, selecting a plurality of reference frequencies in the frequency range of the sub-curve, wherein each of the reference frequencies is used to divide the frequency range of the sub-curve into equal steps;
[0032] The position points corresponding to the reference frequencies on the sub-curve are determined, and the slopes between each group of adjacent position points are obtained to obtain multiple groups of slope values.
[0033] In one embodiment, the method further comprises: if the signal amplitude still does not reach the preset amplitude when the gain coefficient of the operational amplifier is adjusted to the coefficient threshold, adjusting the preset amplitude.
[0034] In one embodiment, the direct digital frequency synthesizer is further connected to the operational amplifier, and controlling the operational amplifier to amplify the amplitude of the target signal output by the digital-to-analog converter according to the target gain coefficient includes:
[0035] The target gain coefficient is output to the direct digital frequency synthesizer, and the direct digital frequency synthesizer is controlled to transmit the target gain coefficient to the operational amplifier in advance for a preset time period, so that the operational amplifier amplifies the amplitude of the target signal output by the digital-to-analog converter according to the target gain coefficient.
[0036] An amplitude-frequency fading compensation device is applied to a signal generator, and the amplitude-frequency fading compensation device comprises:
[0037] An output control module, used for controlling the direct digital frequency synthesizer to output a frequency sweep signal;
[0038] An amplitude measurement module, used to measure the signal amplitude of the frequency sweep signal at each sample frequency after being amplified by an operational amplifier;
[0039] A gain adjustment module, used for adjusting the gain coefficient of the operational amplifier, and obtaining a gain coefficient function based on a sample frequency and the adjusted gain coefficient when the amplitude of each signal reaches a preset amplitude;
[0040] A determination module, configured to determine a target sample gain coefficient at a target frequency based on the gain coefficient function, and determine the target gain coefficient according to the target sample gain coefficient, the preset amplitude and the target amplitude; wherein the target gain coefficient is equal to the product of a quotient of the target amplitude and the preset amplitude and the target sample gain coefficient;
[0041] The amplification control module is used to control the operational amplifier to amplify the amplitude of the target signal output by the digital-to-analog converter according to the target gain coefficient.
[0042] An amplitude-frequency fading compensation device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the methods of claims 1 to 8 when executing the computer program.
[0043] A signal generating system comprises an amplitude-frequency fading compensation device and a signal generator.
[0044] A computer-readable storage medium stores a computer program, which implements the steps of the above method when executed by a processor.
[0045] The above-mentioned compensation is performed by using an operational amplifier instead of a filter. First, the direct digital frequency synthesizer is controlled to output a swept frequency signal. Then, the signal amplitude of the swept frequency signal at each sample frequency is measured after being amplified by the operational amplifier. The gain coefficient of the operational amplifier is adjusted to obtain a gain coefficient function when the signal amplitude reaches a preset amplitude. Then, the target sample gain coefficient at the target frequency is determined based on the gain coefficient function. Then, the target gain coefficient that can make the signal amplitude reach the target amplitude can be determined according to the target sample gain coefficient, the preset amplitude and the target amplitude. Finally, the operational amplifier is controlled to amplify the amplitude of the target signal output by the digital-to-analog converter according to the target gain coefficient, so as to realize compensation of the target signal so that the amplitude of the target signal reaches the target amplitude. The compensation method is simple and can be realized by only an operational amplifier. It occupies less resources. Moreover, since the gain coefficient of the operational amplifier is easy to adjust, it has high flexibility and good compensation effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is the amplitude-frequency characteristic curve of the traditional signal generator;
[0047] Figure 2 A schematic diagram of a flow chart of an amplitude-frequency fading compensation method according to an embodiment of the present application;
[0048] Figure 3 This is a structural block diagram of a signal generator according to an embodiment of the present application;
[0049] Figure 4 A schematic diagram of a compensation curve of an amplitude-frequency fading compensation method according to an embodiment of the present application;
[0050] Figure 5 This is a structural block diagram of an amplitude-frequency fading compensation device according to an embodiment of the present application. DETAILED DESCRIPTION
[0051] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0053] It should be noted that all directional indications in the embodiments of the present application (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly. The connection can be a direct connection or an indirect connection.
[0054] In addition, in this application, descriptions such as "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0055] Figure 2 FIG. 1 is a flow chart of an amplitude-frequency fading compensation method according to an embodiment of the present invention. The method is applied to a signal generator, such as Figure 3 As shown, the signal generator includes a direct digital frequency synthesizer 101, a digital-to-analog converter 102 and an operational amplifier 103 connected in sequence, and the method includes steps S110 to S150, as shown in FIG. Figure 1 shown.
[0056] Step S110, controlling the direct digital frequency synthesizer to output a swept frequency signal.
[0057] It can be understood that in order to solve the defects of using filters for compensation, based on the adjustable gain of the operational amplifier, after the digital-to-analog converter performs digital-to-analog conversion on the target signal output by the direct digital frequency synthesizer, the operational amplifier can be used to amplify the target signal to achieve compensation of the target signal.
[0058] Among them, the direct digital frequency synthesizer can control the frequency range, number and duration of each frequency of the output signal. Since the frequency of the target signal is uncertain, in order to realize the compensation of the target signal, it is necessary to know the gain coefficient of the operational amplifier when compensating the target signal at each frequency. Therefore, the direct digital frequency synthesizer can first output a swept frequency signal, wherein the swept frequency signal is a signal whose frequency is repeatedly scanned within a certain range over time; for example, the direct digital frequency synthesizer can be set according to the needs so that the swept frequency signal is output according to multiple sample frequencies, wherein the number and specific values of the sample frequencies can be set according to the needs.
[0059] Step S120, measuring the signal amplitude of the frequency sweep signal at each sample frequency after being amplified by the operational amplifier.
[0060] The operational amplifier can amplify the swept frequency signal according to the default gain coefficient. In this process, the operational amplifier keeps the default gain coefficient unchanged, so for the amplified swept frequency signal, the amplitude amplification factor at each sample frequency is the same. It can be understood that the amplitude amplification factor can be greater than 1 or less than 1.
[0061] Step S130, adjusting the gain coefficient of the operational amplifier, and when the amplitude of each signal reaches a preset amplitude, obtaining a gain coefficient function based on the sample frequency and the adjusted gain coefficient.
[0062] Among them, the preset amplitude can be set manually; since the signal amplitude of the swept frequency signal tends to attenuate as the sample frequency increases, the adjusted gain coefficient may be different for the signal amplitude at different sample frequencies. The sample frequency, signal amplitude and gain coefficient correspond one to one. After obtaining the adjusted gain coefficients, a gain coefficient function can be obtained by fitting the sample frequency and the corresponding gain coefficient. According to the gain coefficient function, a one-to-one correspondence between the frequency and the gain coefficient can be obtained.
[0063] Step S140, determining the target sample gain coefficient at the target frequency based on the gain coefficient function, and determining the target gain coefficient according to the target sample gain coefficient, the preset amplitude and the target amplitude; wherein the target gain coefficient is equal to the quotient of the target amplitude and the preset amplitude multiplied by the target sample gain coefficient.
[0064] When the direct digital frequency synthesizer outputs a signal of the target frequency, in order to compensate the signal through the operational amplifier, it is necessary to obtain the target gain coefficient at the target frequency. In this regard, the target sample gain coefficient at the target frequency can be determined based on the gain coefficient function. Since the gain coefficient function is obtained based on the gain coefficient when the signal amplitude reaches the preset amplitude, after obtaining the target sample gain coefficient, the quotient of the target amplitude and the preset amplitude can be calculated first, and then the product of the quotient and the target sample gain coefficient can be calculated. The gain coefficient obtained in this way is the gain coefficient when the signal amplitude reaches the target amplitude, that is, the target gain coefficient. For example, if the gain coefficient function is expressed as g(f) and the target frequency is f0, then the target sample gain coefficient can be expressed as g(f0), and if the preset amplitude is Vm and the target amplitude is V0, then the target gain G0 can be expressed as V0 / Vm*g(f0).
[0065] Step S150 , controlling the operational amplifier to amplify the amplitude of the target signal output by the digital-to-analog converter according to the target gain coefficient.
[0066] After obtaining the target gain coefficient, when the direct digital frequency synthesizer outputs the target signal and the output is converted by the digital-to-analog converter, the operational amplifier can be controlled to amplify the amplitude of the output target signal according to the target gain coefficient, thereby achieving amplitude compensation of the target signal so that the amplitude of the target signal reaches the target amplitude.
[0067] by Figure 4 For example, assume that the curve of the target signal before compensation is L1, the curve of the target gain coefficient obtained according to the above method is L2, and the curve of the target signal after compensation is L3. By compensation, its amplitude can be maintained near the target value.
[0068] In this way, by using an operational amplifier instead of a filter for compensation, the direct digital frequency synthesizer is first controlled to output a swept frequency signal, and then the signal amplitude of the swept frequency signal at each sample frequency after being amplified by the operational amplifier is measured, and the gain coefficient of the operational amplifier is adjusted to obtain a gain coefficient function when the signal amplitude reaches a preset amplitude, and then the target sample gain coefficient at the target frequency is determined based on the gain coefficient function, and then the target gain coefficient that can make the signal amplitude reach the target amplitude can be determined according to the target sample gain coefficient, the preset amplitude and the target amplitude, and finally the operational amplifier is controlled to amplify the amplitude of the target signal output by the digital-to-analog converter according to the target gain coefficient, so as to realize compensation of the target signal so that the amplitude of the target signal reaches the target amplitude. This compensation method is simple, can be realized by only an operational amplifier, occupies less resources, and because the gain coefficient of the operational amplifier is easy to adjust, it has high flexibility and good compensation effect.
[0069] In one embodiment, the gain coefficient function includes a plurality of segmented gain functions, and the method further includes: obtaining an amplitude-frequency characteristic curve of the swept frequency signal according to the signal amplitude of the swept frequency signal at each sample frequency, and segmenting the amplitude-frequency characteristic curve based on a dichotomy method; adjusting the gain coefficient of the operational amplifier, and when the signal amplitude is adjusted to reach a preset amplitude, obtaining the gain coefficient function based on the sample frequency and the adjusted gain coefficient includes: adjusting the gain coefficient of the operational amplifier for each segmented sub-curve obtained by segmentation, and when the signal amplitude on each sub-curve is adjusted to reach a preset amplitude, obtaining the segmented gain function based on the sample frequency on each sub-curve and the adjusted gain coefficients; determining the target gain coefficient at the target frequency based on the gain coefficient function includes: determining the target segmented gain function in each segmented gain function according to the frequency range of the sub-curve in which the target frequency falls; and determining the target sample gain coefficient corresponding to the target frequency based on the target segmented gain function.
[0070] After obtaining the swept frequency signal, the amplitude-frequency characteristic curve of the swept frequency signal can be obtained according to the signal amplitude of the swept frequency signal at each sample frequency. It can be understood that the amplitude-frequency characteristic curve is used to characterize the change of the amplitude of the swept frequency signal with the sample frequency, which can be obtained by fitting multiple groups of sample frequencies and corresponding signal amplitudes. When the frequency step between sample frequencies is small, it can also be obtained by directly connecting the position points where the signal amplitude is located on the frequency-amplitude coordinate axis; then the amplitude-frequency characteristic curve is segmented based on the dichotomy method, wherein a single segmentation can be performed based on the dichotomy method to divide the amplitude-frequency characteristic curve into two segments of equal frequency length; for example, the frequency range of the swept frequency signal is 100MHz to 500MHz, and the two segments obtained by segmentation are The frequency ranges of the sub-curves are 100MHz to 300MHz and 300MHz to 500MHz respectively; in one embodiment, multiple segmentations can also be performed based on the binary method. For example, the above example is continued to be used for secondary segmentation, and the amplitude-frequency characteristic curve is divided into four sub-curves, and the frequency ranges of each sub-curve are 100MHz to 200MHz, 200MHz to 300MHz, 300MHz to 400MHz, and 400MHz to 500MHz respectively; in one embodiment, the number of segmentations may be related to the frequency range of the amplitude-frequency characteristic curve; if the frequency range of the curve is larger, the number of segmentations may be more, and if the frequency range of the curve is smaller, the number of segmentations may be less.
[0071] The gain coefficient function may also include multiple segmented gain functions, which correspond to each sub-curve of the amplitude-frequency characteristic curve respectively. The specific acquisition process is: adjust the gain coefficient of the operational amplifier for each sample frequency under any sub-curve obtained by segmentation, so that the signal amplitude corresponding to each sample frequency reaches a preset amplitude, and then obtain the segmented gain function of the sub-curve based on each sample frequency and the adjusted gain coefficients, wherein the segmented gain function can be obtained by fitting based on multiple groups of sample frequencies and corresponding gain coefficients; based on the above method, the segmented gain functions of all sub-curves can be obtained.
[0072] It can be understood that in addition to the amplitude-frequency attenuation caused by the roll-off characteristics of the digital-to-analog converter, the influence of other hardware in the circuit and the added operational amplifier may cause the amplitude-frequency characteristic curve of the output signal to fluctuate. If the function is directly fitted according to the sample frequency of the entire frequency sweep signal and the adjusted gain coefficient, the fluctuation details may be ignored, resulting in a large error in the target sample gain coefficient obtained according to the gain coefficient function, and the final compensation accuracy is low. Therefore, the amplitude-frequency characteristic curve can be obtained first, and then segmented according to the amplitude-frequency characteristic curve, and finally a segmented gain function corresponding to each sub-curve with more details can be obtained. Furthermore, when performing signal compensation, the frequency range of the sub-curve into which the target frequency of the target signal falls is first determined, and then the segmented gain function of the sub-curve is used as the target segmented gain function, and finally the target sample gain coefficient corresponding to the target frequency is obtained based on the target segmented gain function.
[0073] In some embodiments, the preset amplitude used for each sub-curve may be different. In one embodiment, the preset amplitude of the sub-curve may be related to the fluctuation amplitude of the sub-curve; for example, if the fluctuation amplitude is large, in order to avoid the situation where the gain coefficient cannot reach the preset amplitude even if it is adjusted to the threshold, the preset amplitude may be set to the average of the maximum amplitude and the minimum amplitude of the sub-curve.
[0074] The compensation method is simple, and a multi-segment gain function is obtained by a segmented fitting method. The fitting of the sample frequency and the corresponding gain coefficient is more detailed, the target sample gain coefficient obtained based on the fitting function is more accurate, and the final compensation accuracy is higher.
[0075] In one embodiment, obtaining a segmented gain function based on the sample frequency of each sub-curve and each adjusted gain coefficient includes: obtaining an intermediate gain function based on the sample frequency of each sub-curve and the adjusted gain coefficient; determining a plurality of test frequencies within the frequency range of each sub-curve, and for each plurality of test frequencies of each sub-curve, determining a test gain coefficient at each test frequency based on the intermediate gain function corresponding to the sub-curve; controlling a direct digital frequency synthesizer to output a test swept frequency signal at each test frequency, and controlling an operational amplifier to amplify the test swept frequency signal according to a corresponding test gain coefficient; if the amplitude of the amplified test swept frequency signal is within a preset fluctuation range, using the intermediate gain function as a segmented gain function; if the amplitude of the amplified test swept frequency signal exceeds the preset fluctuation range, segmenting the sub-curve based on a binary method, and returning to the step of adjusting the gain coefficient of the operational amplifier for each segmented sub-curve, until all intermediate gain functions are used as segmented gain functions.
[0076] It can be understood that, considering that the volatility of the sub-curve may be large, if the segmented gain function is directly fitted based on the sample frequency of each sub-curve and the adjusted gain coefficient, the precision of the fitted segmented gain function may be low, resulting in low final compensation precision. Therefore, the intermediate gain function can be fitted according to the sample frequency of each sub-curve and the adjusted gain coefficient, and then each intermediate gain function can be verified. If it meets the requirements, it can be used as a segmented gain function. If it does not meet the requirements, the corresponding sub-curve can be segmented again, and then the gain coefficient of the operational amplifier can be adjusted in the above manner to obtain the intermediate gain function of the newly segmented sub-curve, and then verified again by testing the gain coefficient until the intermediate gain function of the sub-curve obtained by the new segment meets the requirements, and finally the segmented gain function of all sub-curves is obtained.
[0077] Specifically, after obtaining the intermediate gain function of each sub-curve, multiple test frequencies are determined within the frequency range of each sub-curve, wherein the number and intervals of the test frequencies can be set independently, and then the test gain coefficient at each test frequency is determined based on the corresponding intermediate gain function, and then the direct digital frequency synthesizer is driven to output a test sweep signal at each test frequency, and at the same time, the operational amplifier is controlled to perform amplification compensation at the corresponding test frequency according to the corresponding test gain coefficient. In theory, the signal amplitude of the compensated test sweep signal at each test frequency will be maintained within a smaller fluctuation range. Therefore, whether the intermediate gain function meets the requirements can be determined based on whether the amplitude of the compensated test sweep signal is within the preset fluctuation range.
[0078] Among them, whether the amplitude of the compensated test sweep frequency signal is within the preset fluctuation range can be determined by calculating whether the difference between the maximum value and the minimum value of each amplitude is lower than the difference threshold value. If it is lower than the difference threshold value, it indicates that it is within the preset fluctuation range, otherwise it exceeds the preset fluctuation range. In some embodiments, whether the amplitude of the test sweep frequency signal is within the preset fluctuation range can be determined by calculating the variance of the signal amplitude at each test frequency. If the variance is lower than the variance threshold value, it indicates that it is within the preset fluctuation range, otherwise it exceeds the preset fluctuation range.
[0079] The above method of obtaining the intermediate gain function and verifying it, and continuing to segment the sub-curve corresponding to the failed intermediate gain function when the verification fails, until the intermediate gain function of the new sub-curve passes the verification, is simple and easy to implement to improve the compensation accuracy.
[0080] In one embodiment, adjusting the gain coefficient of the operational amplifier for each segmented sub-curve includes: respectively obtaining multiple groups of slope values of each segmented sub-curve; if the variance of each group of slope values of the sub-curve does not exceed a preset threshold, adjusting the gain coefficient of the operational amplifier according to the numerical change trend of the linear function; if the variance of each group of slope values of the sub-curve exceeds a preset threshold, adjusting the gain coefficient of the operational amplifier according to the numerical change trend of the quadratic function.
[0081] It can be understood that each group of slope values of the sub-curve can represent the fluctuation trend of the sub-curve, that is, it can also represent the fluctuation trend of the intermediate gain function. Therefore, when the intermediate gain function is obtained by adjusting the gain coefficient of the operational amplifier, the gain coefficient of the operational amplifier can be adjusted according to the fluctuation trend.
[0082] Specifically, if the variance of each group of slope values of the sub-curve does not exceed the preset threshold, it indicates that the fluctuation trend of the sub-curve is relatively simple. At this time, the gain coefficient of the operational amplifier can be adjusted according to the numerical change trend of the linear function. First, determine whether the gain coefficient is an increasing or decreasing trend, and then adjust the gain coefficient according to the monotonically increasing or decreasing trend; if the variance of each group of slope values of the sub-curve exceeds the preset threshold, it indicates that the fluctuation trend of the sub-curve is relatively complex. At this time, the gain coefficient of the operational amplifier can be adjusted according to the numerical change trend of the quadratic function.
[0083] In this way, the fluctuation trend of the sub-curve is determined by each group of slope values of the sub-curve, and the gain coefficient of the operational amplifier is adjusted using the corresponding function change trend, which can quickly determine the gain coefficient when the signal amplitude reaches the preset amplitude, thereby improving the adjustment efficiency.
[0084] In one embodiment, obtaining an intermediate gain function based on the sample frequency and the adjusted gain coefficient of each sub-curve includes: if the variance of each group of slope values of the sub-curve does not exceed a preset threshold, fitting the sample frequency and the adjusted gain coefficient with a linear function as a fitting function to obtain the intermediate gain function; if the variance of each group of slope values of the sub-curve exceeds a preset threshold, fitting the sample frequency and the adjusted gain coefficient with a quadratic function as a fitting function to obtain the intermediate gain function.
[0085] It can be understood that when fitting the sample frequency and the adjusted gain coefficient of each sub-curve, the simpler the fitting function used, the simpler the process of obtaining the target sample gain coefficient according to the intermediate gain function obtained by fitting, but there may be a defect of low precision; and the more complex the fitting function used, the higher the precision of the target sample gain coefficient obtained later, but the process of obtaining the target sample gain coefficient will become complicated. In this regard, based on the characteristics that the change trend of the sub-curve is opposite to the numerical change trend of the intermediate gain function, multiple groups of slope values of each sub-curve can be obtained first. If the variance of each group of slope values of the sub-curve exceeds the preset threshold, it indicates that the fluctuation trend of the sub-curve is relatively complex, and the fitting error of the intermediate gain function using a simple function is large. Therefore, in order to improve the accuracy, a quadratic function can be used for fitting; and if the variance of each group of slope values of the sub-curve does not exceed the preset threshold, it indicates that the fluctuation trend of the sub-curve is relatively simple, and the fitting of the intermediate gain function using a simple function will not have a large error problem. Therefore, in order to simplify the calculation process, a linear function can be used for fitting.
[0086] In some embodiments, in addition to the quadratic function, an exponential, logarithmic or more complex function may be used as the fitting function, and the specific function to be used may be determined according to the variation characteristics of the sub-curve. In some embodiments, the slope value of the sub-curve may be obtained by the slope of the tangent line where the coordinate point on the sub-curve is located.
[0087] In one embodiment, obtaining multiple groups of slope values for each sub-curve includes: for each sub-curve, selecting multiple reference frequencies in the frequency range of the sub-curve, wherein each reference frequency is used to divide the frequency range of the sub-curve in equal steps; determining the position points corresponding to each reference frequency on the sub-curve, obtaining the slopes between each group of adjacent position points, and obtaining multiple groups of slope values.
[0088] The number of reference frequencies may be determined according to the frequency range of the sub-curve; if the frequency range is wide, the number of reference frequencies may be increased, and if the frequency range is narrow, the number of reference frequencies may be reduced.
[0089] It can be understood that in order to obtain multiple groups of slope values of the sub-curve, multiple position points that divide the frequency range of the sub-curve into equal steps can be selected on the sub-curve, and then two adjacent position points are taken as a group to obtain the slope between each group of position points. By selecting position points that divide the frequency range of the sub-curve into equal steps, the selected position points can cover the entire frequency range, retaining the consideration of the overall change trend of the sub-curve, and better reflecting the overall characteristics of the sub-curve.
[0090] In one embodiment, the method further comprises: if the signal amplitude still does not reach the preset amplitude when the gain coefficient of the operational amplifier is adjusted to the coefficient threshold, adjusting the preset amplitude.
[0091] It can be understood that the gain coefficient of the operational amplifier has a specific coefficient threshold range. If the preset amplitude is set too large or too small at the beginning, the gain coefficient may not reach the preset amplitude even if it is adjusted to the coefficient threshold. Therefore, in this case, the preset amplitude can be adjusted accordingly so that the coefficient threshold range of the operational amplifier can meet the requirements. This adjustment method is simple and does not require any changes to the hardware.
[0092] In one embodiment, controlling the operational amplifier to amplify the amplitude of a target signal output by the digital-to-analog converter according to a target gain coefficient includes: outputting the target gain coefficient to a direct digital frequency synthesizer, and controlling the direct digital frequency synthesizer to transmit the target gain coefficient to the operational amplifier for a preset time in advance, so that the operational amplifier amplifies the amplitude of the target signal output by the digital-to-analog converter according to the target gain coefficient.
[0093] It can be understood that, firstly, the target signal output by the direct digital frequency synthesizer depends on the clock in the direct digital frequency synthesizer. If the operational amplifier is directly controlled to adjust the gain, the signal and the adjustment may be out of sync due to clock inconsistency. Therefore, after obtaining the target gain coefficient, the target gain coefficient can be transmitted to the direct digital frequency synthesizer, and then the direct digital frequency synthesizer transmits it to the operational amplifier at a specific time, so that the signal output and signal adjustment can be achieved under the same clock. Secondly, after the direct digital frequency synthesizer transmits the target gain coefficient to the operational amplifier, the operational amplifier needs to write the data into its register before amplification. This process will cause a delay in the compensation of the operational amplifier. Therefore, the direct digital frequency synthesizer can be controlled to transmit the target gain coefficient to the operational amplifier in advance for a preset time, thereby improving the accuracy of the compensation of the target signal.
[0094] In this way, using a direct digital frequency synthesizer to control the operational amplifier compensation can avoid the defect that the signal output and amplification processing are not synchronized due to clock differences. At the same time, since the advance time is set, the accuracy of the target signal compensation can be further improved.
[0095] In some embodiments, in the gain control process of other operational amplifiers, such as the gain control process of the operational amplifier when the signal amplitude reaches a preset amplitude, and the gain control process of the operational amplifier when amplifying a test swept frequency signal, a direct digital frequency synthesizer can also be used to achieve advance control of the operational amplifier compensation.
[0096] An embodiment of the present invention further provides an amplitude-frequency fading compensation method, which is applied to a signal generator. The method includes steps a(1) to a(15).
[0097] Step a(1), controlling the direct digital frequency synthesizer to output a swept frequency signal.
[0098] Step a(2), measuring the signal amplitude of the frequency sweep signal at each sample frequency after being amplified by the operational amplifier.
[0099] Step a(3), obtaining an amplitude-frequency characteristic curve of the swept frequency signal according to the signal amplitude of the swept frequency signal at each sample frequency, and segmenting the amplitude-frequency characteristic curve based on a dichotomy method.
[0100] Step a(4): for each sub-curve obtained by segmentation, multiple reference frequencies are selected in the frequency range of the sub-curve, wherein each reference frequency is used to divide the frequency range of the sub-curve into equal steps.
[0101] Step a(5), determining the position points corresponding to each reference frequency on the sub-curve, obtaining the slopes between each group of adjacent position points, and obtaining multiple groups of slope values.
[0102] Step a(6): if the variance of the slope values of each group of sub-curves does not exceed the preset threshold, the gain coefficient of the operational amplifier is adjusted according to the numerical change trend of the linear function; if the variance of the slope values of each group of sub-curves exceeds the preset threshold, the gain coefficient of the operational amplifier is adjusted according to the numerical change trend of the quadratic function.
[0103] Step a(7), when the amplitude of each signal on each sub-curve is adjusted to reach a preset amplitude, if the variance of each group of slope values of the sub-curve does not exceed the preset threshold, a linear function is used as a fitting function to fit the sample frequency and the adjusted gain coefficient to obtain an intermediate gain function; if the variance of each group of slope values of the sub-curve exceeds the preset threshold, a quadratic function is used as a fitting function to fit the sample frequency and the adjusted gain coefficient to obtain an intermediate gain function. If the signal amplitude still does not reach the preset amplitude when the gain coefficient of the operational amplifier is adjusted to the coefficient threshold, the preset amplitude is adjusted.
[0104] Step a(8), determining a plurality of test frequencies within the frequency range of each sub-curve, and determining a test gain coefficient at each test frequency for each sub-curve based on an intermediate gain function corresponding to the sub-curve.
[0105] Step a(9), controlling the direct digital frequency synthesizer to output a test frequency sweep signal at each test frequency, and controlling the operational amplifier to amplify the test frequency sweep signal according to a corresponding test gain factor.
[0106] Step a(10): if the amplitude of the amplified test frequency sweep signal is within a preset fluctuation range, the intermediate gain function is used as the segmented gain function.
[0107] Step a(11): if the amplitude of the amplified test sweep signal exceeds the preset fluctuation range, the sub-curve is segmented based on the dichotomy method, and the process returns to step a(4) until all intermediate gain functions are used as segmented gain functions.
[0108] Step a(12), determining a target segmented gain function according to the frequency range of the sub-curve within which the target frequency falls.
[0109] Step a(13), based on the target segmented gain function, determine the target sample gain coefficient corresponding to the target frequency.
[0110] Step a(14), determining a target gain coefficient according to the target sample gain coefficient, the preset amplitude and the target amplitude, wherein the target gain coefficient is equal to the product of the quotient of the target amplitude and the preset amplitude and the target sample gain coefficient.
[0111] Step a (15), outputting the target gain coefficient to the direct digital frequency synthesizer, and controlling the direct digital frequency synthesizer to transmit the target gain coefficient to the operational amplifier in advance for a preset time, so that the operational amplifier amplifies the amplitude of the target signal output by the digital-to-analog converter according to the target gain coefficient.
[0112] It should be understood that, although the above steps are displayed in sequence as indicated by arrows, and the steps in step a(1) to step a(15) are displayed in sequence as indicated by numbers, these steps are not necessarily executed in sequence in the order indicated by arrows or numbers. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the above steps may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
[0113] The following is a brief description of the amplitude-frequency fading compensation method.
[0114] 1. Obtain multiple segmented gain functions corresponding to different frequency ranges
[0115] First, the direct digital frequency synthesizer is controlled to output a swept frequency signal. The frequency range and frequency step of the swept frequency signal can be determined by itself. If a higher compensation accuracy is required, a smaller frequency step can be used. Then, the signal amplitude of the swept frequency signal at each sample frequency is measured after being amplified by the operational amplifier. Based on the corresponding relationship between the signal amplitude and the sample frequency, an amplitude-frequency characteristic curve of the swept frequency signal can be generated. Then, the amplitude-frequency characteristic curve is segmented to obtain at least two sub-curves. For each sub-curve, multiple position points can be selected on the sub-curve, wherein the frequency corresponding to each position point is divided into the frequency range of the sub-curve in equal steps, and then the slope between the two position points is obtained according to the coordinates of the two adjacent position points, thereby obtaining multiple groups of slope values of the sub-curve. If the variance of each group of slope values of the sub-curve does not exceed the preset threshold, it indicates that the fluctuation trend of the sub-curve is relatively complex. At this time, the gain coefficient of the operational amplifier can be adjusted according to the numerical change trend of the linear function, and the sample frequency and the adjusted gain coefficient are fitted with the linear function as the fitting function to obtain an intermediate gain function; if the variance of each group of slope values of the sub-curve exceeds the preset threshold, the gain coefficient of the operational amplifier is adjusted according to the numerical change trend of the quadratic function, and the sample frequency and the adjusted gain coefficient are fitted with the quadratic function as the fitting function to obtain an intermediate gain function. During the gain coefficient adjustment, if the signal amplitude still does not reach the preset amplitude when the gain coefficient of the operational amplifier is adjusted to the coefficient threshold, the preset amplitude is adjusted.
[0116] After obtaining the intermediate gain function of each sub-curve, it is necessary to verify whether each intermediate gain function can be used as a segmented gain function to determine the target gain coefficient of the target signal.
[0117] Specifically, multiple test frequencies can be determined within the frequency range of each sub-curve, and then the test gain coefficient at each test frequency can be determined based on the intermediate gain function corresponding to the sub-curve. Finally, the direct digital frequency synthesizer is controlled to output the test swept frequency signal at each test frequency, and the operational amplifier is controlled to amplify the test swept frequency signal according to the corresponding test gain coefficient.
[0118] Theoretically, the signal after amplification and compensation by the operational amplifier will be maintained near the target value. Therefore, by determining whether the amplitude of the amplified test sweep signal is within the preset fluctuation range, it can be determined whether the compensation of the set of test gain coefficients meets the requirements. If it meets the requirements, it means that the intermediate gain function based on which the set of test gain coefficients are obtained meets the accuracy requirements. If it exceeds the preset fluctuation range, the sub-curve is segmented based on the dichotomy method, and multiple groups of slope values of the new sub-curve are obtained based on the same method as above, and then the intermediate gain function of the new sub-curve is obtained by adjusting the operational amplifier gain coefficient, and then the test sweep signal is used for verification, and this process is repeated until the segmented gain functions of all sub-curves in the amplitude-frequency characteristic curve are finally obtained.
[0119] 2. Compensation based on the corresponding segmented gain function
[0120] When the desired output signal is a target signal of a target amplitude and a target frequency, the target segmented gain function can be first determined based on the frequency range of the sub-curve in which the target frequency falls, and then the target sample gain coefficient corresponding to the target frequency can be determined based on the target segmented gain function. Further, the target gain coefficient is obtained according to the target sample gain coefficient, the preset amplitude and the target amplitude, wherein the target gain coefficient is equal to the quotient of the target amplitude and the preset amplitude, multiplied by the target sample gain coefficient.
[0121] The target gain coefficient is then output to a direct digital frequency synthesizer, and the direct digital frequency synthesizer is controlled to transmit the target gain coefficient to an operational amplifier in advance for a preset period of time. Finally, the operational amplifier amplifies the amplitude of the target signal output by the digital-to-analog converter according to the target gain coefficient, thereby achieving accurate compensation of the target signal.
[0122] The embodiment of the present invention further provides an amplitude-frequency fading compensation device, which is applied to a signal generator. The device can adopt a software module or a hardware module, or a combination of the two to become a part of a computer device. The amplitude-frequency fading compensation device specifically includes an output control module, an amplitude measurement module, a gain adjustment module, a determination module and an amplification control module; the output control module is used to control the direct digital frequency synthesizer to output a swept frequency signal; the amplitude measurement module is used to measure the signal amplitude of the swept frequency signal at each sample frequency after being amplified by the operational amplifier; the gain adjustment module is used to adjust the gain coefficient of the operational amplifier, and when the amplitude of each signal reaches a preset amplitude, a gain coefficient function is obtained based on the sample frequency and the adjusted gain coefficient; the determination module is used to determine a target sample gain coefficient at a target frequency based on the gain coefficient function, and determine the target gain coefficient according to the target sample gain coefficient, the preset amplitude and the target amplitude; wherein the target gain coefficient is equal to the quotient of the target amplitude and the preset amplitude, multiplied by the target sample gain coefficient; the amplification control module is used to control the operational amplifier to amplify the amplitude of the target signal output by the digital-to-analog converter according to the target gain coefficient.
[0123] In one embodiment, the gain coefficient function includes a plurality of segmented gain functions, and the compensation device further includes: a segmentation module, which is used to obtain the amplitude-frequency characteristic curve of the swept frequency signal according to the signal amplitude of the swept frequency signal at each sample frequency, and segment the amplitude-frequency characteristic curve based on the dichotomy method; the gain adjustment module is also used to adjust the gain coefficient of the operational amplifier for each sub-curve obtained by the segmentation, and when the signal amplitude on each sub-curve is adjusted to reach a preset amplitude, the segmented gain function is obtained based on the sample frequency on each sub-curve and the adjusted gain coefficients; determining the target gain coefficient at the target frequency based on the gain coefficient function includes: determining the target segmented gain function according to the frequency range of the sub-curve in which the target frequency falls; and determining the target sample gain coefficient corresponding to the target frequency based on the target segmented gain function.
[0124] In one embodiment, the gain adjustment module is also used to obtain an intermediate gain function based on the sample frequency of each sub-curve and the adjusted gain coefficient; determine multiple test frequencies within the frequency range of each sub-curve, and for each sub-curve, determine the test gain coefficient at each test frequency based on the intermediate gain function corresponding to the sub-curve; control the direct digital frequency synthesizer to output a test sweep signal at each test frequency, and control the operational amplifier to amplify the test sweep signal according to the corresponding test gain coefficient; if the amplitude of the amplified test sweep signal is within a preset fluctuation range, the intermediate gain function is used as a segmented gain function; if the amplitude of the amplified test sweep signal exceeds the preset fluctuation range, the sub-curve is segmented based on the binary method, and return to the step of adjusting the gain coefficient of the operational amplifier for each segmented sub-curve obtained, until all intermediate gain functions are used as segmented gain functions.
[0125] In one embodiment, the gain adjustment module is also used to respectively obtain multiple groups of slope values of each sub-curve obtained by segmentation; if the variance of each group of slope values of the sub-curve does not exceed a preset threshold, the gain coefficient of the operational amplifier is adjusted according to the numerical change trend of the linear function; if the variance of each group of slope values of the sub-curve exceeds a preset threshold, the gain coefficient of the operational amplifier is adjusted according to the numerical change trend of the quadratic function.
[0126] In one embodiment, the gain adjustment module is also used for: if the variance of each group of slope values of the sub-curve does not exceed a preset threshold, then a linear function is used as a fitting function to fit the sample frequency and the adjusted gain coefficient to obtain an intermediate gain function; if the variance of each group of slope values of the sub-curve exceeds a preset threshold, then a quadratic function is used as a fitting function to fit the sample frequency and the adjusted gain coefficient to obtain an intermediate gain function.
[0127] In one embodiment, the gain adjustment module is also used to select multiple reference frequencies in the frequency range of the sub-curve for each sub-curve, wherein each reference frequency is used to divide the frequency range of the sub-curve with equal steps; determine the position points corresponding to each reference frequency on the sub-curve, obtain the slope between each group of adjacent position points, and obtain multiple groups of slope values.
[0128] In one embodiment, the gain adjustment module is further configured to: if the signal amplitude still does not reach the preset amplitude when the gain coefficient of the operational amplifier is adjusted to the coefficient threshold, adjust the preset amplitude.
[0129] In one embodiment, the direct digital frequency synthesizer is also connected to an operational amplifier, and the amplification control module is used to: output a target gain coefficient to the direct digital frequency synthesizer, and control the direct digital frequency synthesizer to transmit the target gain coefficient to the operational amplifier in advance for a preset period of time, so that the operational amplifier amplifies the amplitude of the target signal output by the digital-to-analog converter according to the target gain coefficient.
[0130] For the specific definition of the amplitude-frequency fading compensation device, please refer to the definition of the amplitude-frequency fading compensation method above, which will not be repeated here. Each module in the above-mentioned amplitude-frequency fading compensation device can be implemented in whole or in part by software, hardware and a combination thereof. 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 operations corresponding to the above modules.
[0131] In one embodiment, an amplitude-frequency fading compensation device is provided. The amplitude-frequency fading compensation device may be a terminal device, and its internal structure diagram may be as shown in FIG. Figure 5As shown. The amplitude-frequency fading compensation device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the amplitude-frequency fading compensation device is used to provide computing and control capabilities. The memory of the amplitude-frequency fading compensation device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the amplitude-frequency fading compensation device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an amplitude-frequency fading compensation method is implemented. The display screen of the amplitude-frequency fading compensation device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the amplitude-frequency fading compensation device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the shell of the amplitude-frequency fading compensation device, or an external keyboard, touchpad or mouse, etc.
[0132] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present application, and does not constitute a limitation on the amplitude-frequency fading compensation device to which the scheme of the present application is applied. The specific amplitude-frequency fading compensation device may include more or fewer components than those shown in the figure, or combine certain amplitude-frequency fading compensation components, or have a different component arrangement.
[0133] An embodiment of the present invention further provides an amplitude-frequency fading compensation device, comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of any of the above method embodiments when executing the computer program.
[0134] The embodiment of the present invention further provides a signal generating system, which includes an amplitude-frequency fading compensation device and a signal generator.
[0135] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of any of the above method embodiments when executed by a processor.
[0136] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.
[0137] Those of ordinary skill 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 in 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 at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0138] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for compensating amplitude-frequency fading, characterized in that: Applied to a signal generator, the signal generator includes a direct digital frequency synthesizer, a digital-to-analog converter and an operational amplifier connected in sequence, and the amplitude-frequency fading compensation method includes: Controlling the direct digital frequency synthesizer to output a frequency sweep signal; measuring the signal amplitude of the frequency sweep signal at each sample frequency after being amplified by the operational amplifier; Adjusting the gain coefficient of the operational amplifier, and when the amplitude of each signal reaches a preset amplitude, obtaining a gain coefficient function based on the sample frequency and the adjusted gain coefficient; Determining a target sample gain coefficient at a target frequency based on the gain coefficient function, and determining the target gain coefficient according to the target sample gain coefficient, the preset amplitude and the target amplitude; wherein the target gain coefficient is equal to the product of the quotient of the target amplitude and the preset amplitude and the target sample gain coefficient; The operational amplifier is controlled to amplify the amplitude of the target signal output by the digital-to-analog converter according to the target gain coefficient.
2. The amplitude-frequency fading compensation method according to claim 1, characterized in that: The gain coefficient function includes a multi-segment segmented gain function, and the method further includes: Acquire an amplitude-frequency characteristic curve of the swept frequency signal according to the signal amplitude of the swept frequency signal at each of the sample frequencies, and segment the amplitude-frequency characteristic curve based on a dichotomy method; The step of adjusting the gain coefficient of the operational amplifier, when adjusting until each signal amplitude reaches a preset amplitude, obtaining a gain coefficient function based on the sample frequency and the adjusted gain coefficient comprises: Adjusting the gain coefficient of the operational amplifier for each segmented sub-curve obtained by segmentation, and when the signal amplitudes on each sub-curve are adjusted to reach a preset amplitude, obtaining the segmented gain function based on the sample frequency on each sub-curve and the adjusted gain coefficients; Determining the target sample gain coefficient at the target frequency based on the gain coefficient function includes: Determining a target segmented gain function in each segmented gain function according to the frequency range of the sub-curve in which the target frequency falls; Based on the target segmental gain function, the target sample gain coefficient corresponding to the target frequency is determined.
3. The amplitude-frequency fading compensation method according to claim 2, characterized in that: The obtaining of the segmented gain function based on the sample frequency on each of the sub-curves and the adjusted gain coefficients comprises: Obtaining an intermediate gain function based on the sample frequency of each of the sub-curves and the adjusted gain coefficient; Determine a plurality of test frequencies within the frequency range of each of the sub-curves, and for each of the plurality of test frequencies of the sub-curve, determine a test gain coefficient at each of the test frequencies based on the intermediate gain function corresponding to the sub-curve; Controlling the direct digital frequency synthesizer to output a test frequency sweep signal at each test frequency, and controlling the operational amplifier to amplify the test frequency sweep signal according to the corresponding test gain coefficient; If the amplitude of the amplified test frequency sweep signal is within a preset fluctuation range, the intermediate gain function is used as the segmented gain function; If the amplitude of the amplified test swept frequency signal exceeds the preset fluctuation range, the sub-curve is segmented based on the binary method, and the step of adjusting the gain coefficient of the operational amplifier for each segmented sub-curve is returned to until all the intermediate gain functions are used as the segmented gain functions.
4. The amplitude-frequency fading compensation method according to claim 3, characterized in that: The step of adjusting the gain coefficient of the operational amplifier for each segment of the sub-curve obtained by segmentation comprises: Respectively obtaining multiple groups of slope values of each of the sub-curves obtained by segmentation; If the variance of the slope values of each group of the sub-curves does not exceed a preset threshold, adjusting the gain coefficient of the operational amplifier according to the numerical variation trend of the linear function; If the variance of the slope values of each group of the sub-curve exceeds the preset threshold, the gain coefficient of the operational amplifier is adjusted according to the value change trend of the quadratic function.
5. The amplitude-frequency fading compensation method according to claim 4, characterized in that: The obtaining of the intermediate gain function based on the sample frequency of each sub-curve and the adjusted gain coefficient comprises: If the variance of the slope values of each group of the sub-curve does not exceed the preset threshold, fitting the sample frequency and the adjusted gain coefficient using the linear function as a fitting function to obtain the intermediate gain function; If the variance of the slope values of each group of the sub-curve exceeds the preset threshold, the sample frequency and the adjusted gain coefficient are fitted using the quadratic function as a fitting function to obtain the intermediate gain function.
6. The amplitude-frequency fading compensation method according to claim 4, characterized in that: The plurality of groups of slope values of the sub-curves obtained by segmentation include: For each of the sub-curves, selecting a plurality of reference frequencies in the frequency range of the sub-curve, wherein each of the reference frequencies is used to divide the frequency range of the sub-curve into equal steps; The position points corresponding to the reference frequencies on the sub-curve are determined, and the slopes between each group of adjacent position points are obtained to obtain multiple groups of slope values.
7. The amplitude-frequency fading compensation method according to claim 1, characterized in that: The method further comprises: If the signal amplitude still does not reach the preset amplitude when the gain coefficient of the operational amplifier is adjusted to the coefficient threshold, the preset amplitude is adjusted.
8. The amplitude-frequency fading compensation method according to claim 1, characterized in that: The direct digital frequency synthesizer is also connected to the operational amplifier, and the control of the operational amplifier to amplify the amplitude of the target signal output by the digital-to-analog converter according to the target gain coefficient includes: The target gain coefficient is output to the direct digital frequency synthesizer, and the direct digital frequency synthesizer is controlled to transmit the target gain coefficient to the operational amplifier in advance for a preset time period, so that the operational amplifier amplifies the amplitude of the target signal output by the digital-to-analog converter according to the target gain coefficient.
9. An amplitude-frequency fading compensation device, characterized in that: Applied to a signal generator, the amplitude-frequency fading compensation device comprises: An output control module, used for controlling the direct digital frequency synthesizer to output a frequency sweep signal; An amplitude measurement module, used to measure the signal amplitude of the frequency sweep signal at each sample frequency after being amplified by the operational amplifier; A gain adjustment module, used for adjusting the gain coefficient of the operational amplifier, and obtaining a gain coefficient function based on a sample frequency and the adjusted gain coefficient when the amplitude of each signal reaches a preset amplitude; A determination module, configured to determine a target sample gain coefficient at a target frequency based on the gain coefficient function, and determine the target gain coefficient according to the target sample gain coefficient, the preset amplitude and the target amplitude; wherein the target gain coefficient is equal to the product of a quotient of the target amplitude and the preset amplitude and the target sample gain coefficient; The amplification control module is used to control the operational amplifier to amplify the amplitude of the target signal output by the digital-to-analog converter according to the target gain coefficient.
10. An amplitude-frequency fading compensation device, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
11. A signal generating system, characterized in that: The system comprises an amplitude-frequency fading compensation device and a signal generator.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Sensor compensation method, signal acquisition system and readable storage medium
CN120721140A
