Low-order fir wideband flatness calibration method based on frequency response gradient non-uniform sampling
Patent Information
- Application Number
- CN202610998222.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-06
- Publication Date
- 2026-10-23
AI Technical Summary
然而,当功率曲线仅在局部区域剧烈波动时,均匀采样策略难以根据频谱局部特征自适应调整拟合关注度
本发明通过对待校准设备的实测输出功率曲线与目标平坦输出功率之间的差值进行处理,得到补偿频率响应曲线,并在平滑处理后计算频域响应梯度,使频响曲线中局部变化剧烈的频率区域能够被识别出来;本发明根据频域响应梯度构建采样密度函数及累积分布函数,并据此生成非均匀频率采样网格,使频域响应梯度较大的区域具有更高的频点密度,而频域响应梯度较小的区域保持相对较低的频点密度,以使得在后续构建线性相位FIR滤波器基矩阵并求解滤波器系数时,局部畸变区域能够在系数求解过程中占据更多的拟合约束,从而在预设低阶FIR滤波器阶数条件下提高对局部窄带起伏的补偿能力,减少因采用高阶FIR滤波器带来的硬件乘法器资源占用和处理延迟。同时,本发明通过采样密度函数和累积分布函数自动生成非均匀频率采样网格,无需人工针对不同频段设置权重,能够提高宽带平坦度校准过程的自动化程度,非常适用于宽带雷达收发信机、宽带通信设备、信号发生器等设备的出厂校准或运行校准场景。
Smart Images

Figure CN122969683A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital signal processing technology, and specifically to a low-order FIR broadband flatness calibration method based on non-uniform sampling of frequency response gradient. Background Technology
[0002] Broadband radar transceivers, broadband communication equipment, signal generators, and other electronic devices typically require broadband output power flatness calibration during factory calibration and real-time operation. In practical engineering, the output power of a signal source may exhibit drastic fluctuations or distortions in certain narrowband regions, while remaining relatively flat across wider frequency bands. For applications sensitive to size, power consumption, and cost, such as small and medium-sized UAV payloads, portable radios, and embedded software-defined radio platforms, hardware multipliers and memory resources like FPGAs / DSPs are limited. Therefore, high-precision broadband flatness compensation is necessary under limited hardware resources.
[0003] In engineering implementation, the output power flatness calibration of broadband signal sources mainly employs frequency domain methods: first, the output power curve of the signal source is measured over a broadband range; then, the difference between the ideal output and the measured output is calculated, and a compensation filter is designed accordingly. Existing technologies often use uniform frequency sampling, obtaining the time-domain coefficients of the FIR filter through FFT / IFFT. However, when the power curve fluctuates drastically only in local regions, the uniform sampling strategy struggles to adaptively adjust the fitting focus based on local spectral characteristics. To accurately fit the locally fluctuating spectrum, high-order FIR filters are typically required, resulting in a longer overall filter time-domain impulse response and consuming significant hardware multiplier resources.
[0004] Meanwhile, high-order FIR filters consume significant hardware resources such as multipliers, leading to higher hardware costs and greater signal processing latency, making it difficult to meet the requirements of real-time processing and low-resource platforms. If low-order FIR filters are forcibly used under limited hardware resources, or if high-order FIR coefficients are truncated or windowed, the truncation error can easily spread across the entire frequency band, introducing Gibbs ripple into the originally relatively flat region, resulting in degraded calibration performance and difficulty in preserving accurate compensation capabilities for distorted regions.
[0005] Furthermore, while the weighted least squares method can theoretically improve the fitting accuracy of local frequency bands by setting different weights for different frequency bands, its weight setting usually relies on human experience and requires repeated trial and error adjustments based on the waveform. For real-world signal sources with complex waveforms, variable distortion positions, and multiple fluctuations, the method of manually setting weights lacks universality and robustness, and is also difficult to meet the automated requirements of mass-produced equipment factory calibration or system power-on self-calibration.
[0006] Therefore, under the premise of limited hardware multipliers and memory resources such as FPGAs / DSPs, how to achieve high-precision broadband flatness compensation with lower-order FIR filters, and reduce manual intervention, is a technical problem that urgently needs to be solved in this field, given the characteristics of severe local narrowband fluctuations and relatively flat other frequency bands in broadband frequency response. Summary of the Invention
[0007] The technical problem to be solved by this invention is to provide a low-order FIR broadband flatness calibration method based on non-uniform sampling of frequency response gradient, which adaptively generates a non-uniform frequency sampling grid according to the local variation characteristics of the measured frequency response under the condition of limited hardware resources, so that the fitting constraint of the low-order FIR filter is concentrated in the frequency region with large frequency response distortion, thereby realizing broadband flatness compensation.
[0008] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A low-order FIR broadband flatness calibration method based on non-uniform sampling of frequency response gradient includes the following steps: S1, obtain the measured output power curve of the device to be calibrated within a preset broadband frequency range, and determine the compensation frequency response curve based on the difference between the measured output power curve and the target flat output power. S2, smooth the compensated frequency response curve, and calculate the frequency domain response gradient based on the smoothed compensated frequency response curve. S3, construct a sampling density function and a cumulative distribution function based on the frequency domain response gradient, and generate a non-uniform frequency sampling grid based on the sampling density function and the cumulative distribution function, so that the non-uniform frequency sampling grid has a high frequency point density in the frequency region with a large frequency domain response gradient. S4. Obtain the target compensation response based on the non-uniform frequency sampling grid, and construct the basis matrix corresponding to the linear phase FIR filter of a preset order; S5. Solve and reconstruct the filter coefficients of the linear phase FIR filter based on the target compensation response and the basis matrix, and configure the filter coefficients to the digital signal processing module of the device to be calibrated in order to perform broadband flatness compensation on the output signal of the device to be calibrated.
[0009] Further, in step S2, smoothing the compensated frequency response curve includes: The compensated frequency response curve was obtained by using a Savitzky-Golay polynomial smoothing filter. The window length of the Savitzky-Golay polynomial smoothing filter is used for filtering. and polynomial order According to the frequency sweep step Measure the noise level and the narrowest characteristic width of the in-band ripples of the device to be calibrated. Sure; Among them, the frequency sweep step According to the width of the narrowest feature that can be distinguished The principle is determined by the length of the window. With sweep frequency step The product is not greater than the narrowest feature width. The preset ratio is used, and the window length is increased when the measurement noise increases. and / or reduce the order of the polynomial The window length is reduced when the measurement noise is reduced. and / or increase the order of the polynomial This is used to obtain a smoothed compensated frequency response curve for calculating the frequency domain response gradient.
[0010] Further, in step S2, calculating the frequency domain response gradient based on the smoothed compensated frequency response curve includes: The first-order frequency domain response gradient is calculated using center difference calculation for the internal measurement frequency points in the smoothed compensated frequency response curve. The first-order frequency domain response gradient is calculated using forward differential, backward differential, or boundary extension results based on smoothing at the boundary measurement frequency points. Based on the magnitude of the first-order frequency domain response gradient corresponding to each measurement frequency point The maximum first-order frequency domain response gradient magnitude within the preset wideband frequency range The ratio between them yields the normalized gradient value. ; Below the preset gradient threshold normalized gradient value Set to zero, and adjust the normalized gradient value. The sequence undergoes abnormal peak removal and adjacent high gradient region merging processing; wherein, the abnormal peak removal is used to suppress single-point pseudo gradients formed by sudden interference, and the adjacent high gradient region merging is used to merge multiple measurement frequency points that continuously exceed a preset high gradient threshold into the same high gradient connected region.
[0011] Further, in step S3, constructing the sampling density function and cumulative distribution function based on the frequency domain response gradient includes: The magnitude of the frequency domain response gradient is normalized to obtain the normalized gradient value. According to the normalized gradient value The power function and the fundamental density bias Constructing the sampling density function Wherein, the exponent of the power function The base density bias is used to adjust the sampling density enhancement level in the high gradient frequency region. Used to preserve the base sampling density in the frequency region where the normalized gradient value is zero; For the sampling density function Normalized integration is performed within a preset broadband frequency range to obtain the corresponding cumulative distribution function. The cumulative distribution function It is a monotonically increasing function.
[0012] Further, in step S3, generating a non-uniform frequency sampling grid based on the sampling density function and the cumulative distribution function includes: Obtain the sampling density function value corresponding to the original measurement frequency point. For each sampled density function value Normalization is performed to obtain the discrete probability density. ; for the discrete probability density By performing accumulation processing, the discrete cumulative distribution function is obtained. ; in the discrete cumulative distribution function Multiple interval midpoint quantiles are selected within the range of non-uniform sampling points; the inverse mapping of the discrete cumulative distribution function is solved by the conformal monotonic interpolation algorithm to obtain multiple non-uniform frequency sampling points corresponding to the multiple interval midpoint quantiles, so as to form the non-uniform frequency sampling grid. Among them, the number of non-uniform sampling points Based on the half-order of the linear phase FIR filter and the original number of measurement points The number of non-uniform sampling points is determined. The number of unknown coefficients is greater than that of the linear phase FIR filter, but not greater than the number of original measurement points. The half-order of the linear phase FIR filter The number of unknown coefficients corresponding to the constructed linear-phase FIR filter is determined by the preset order M, which is half the order. Add one.
[0013] Furthermore, in step S3, after generating the non-uniform frequency sampling grid, the post-processing verification of multiple non-uniform frequency sampling points in the non-uniform frequency sampling grid is also included. The post-processing verification includes one or more of the following: minimum interval verification, maximum interval verification, and strict monotonicity verification. The minimum interval verification includes: determining two adjacent non-uniform frequency sampling points. and Is the interval between them smaller than the original sweep frequency step? If so, then remove the corresponding redundant frequency points and adjust the number of non-uniform sampling points. The maximum interval verification includes: determining whether the interval between two adjacent non-uniform frequency sampling points is greater than the narrowest feature width of the in-band ripples of the device to be calibrated. If so, then a supplementary frequency point is inserted between the corresponding two adjacent non-uniform frequency sampling points; the strict monotonicity check includes: determining whether the interval between two adjacent non-uniform frequency sampling points is less than or equal to a preset minimum positive number. If so, then remove the corresponding redundant frequency points and adjust the number of non-uniform sampling points. .
[0014] Further, step S4 includes: Each non-uniform frequency sampling point in the non-uniform frequency sampling grid At this point, the compensated frequency response curve after smoothing is shown. Interpolation is performed to obtain the target compensation response corresponding to each non-uniform frequency sampling point. Convert each non-uniform frequency sampling point into a normalized digital frequency. And according to the normalized digital frequency The preset order M of the linear phase FIR filter and the half-order N determined by the preset order are used to construct the cosine basis matrix. ; Wherein, the cosine basis matrix The number of rows is the number of non-uniform sampling points. The number of columns is the half-order N plus one, and the matrix elements in the cosine basis matrix are determined by the normalized digital frequency and cosine basis function corresponding to each non-uniform frequency sampling point.
[0015] Further, in step S5, solving for the filter coefficients of the linear-phase FIR filter based on the target compensation response and the basis matrix includes: Using the basis matrix as the cosine basis matrix, the target compensation response corresponding to each non-uniform frequency sampling point is used to form the target compensation response vector, and a cosine coefficient vector is constructed. Overdetermined system of equations with unknowns ; For the overdetermined system of equations The cosine coefficients of the linear-phase FIR filter are obtained by performing least-squares solution; wherein, the overdetermined equation system is solved using QR decomposition, and the condition number of the cosine basis matrix is greater than a preset condition number threshold. When the cosine coefficients are solved by the Tikhonov regularization term, the regularization parameter of the Tikhonov regularization term is determined based on the condition number of the cosine basis matrix, the preset condition number threshold, and the average energy of the cosine basis matrix. The causal and symmetric time-domain FIR filter coefficients are reconstructed based on the cosine coefficients. The zero-order cosine coefficient is used as the center tap coefficient, and half of the non-zero-order cosine coefficients are used as two tap coefficients symmetrical with respect to the center tap, resulting in time-domain FIR filter coefficients with subscripts distributed in the range of 0 to 2N, where N is the half-order of the linear phase FIR filter.
[0016] Furthermore, step S5 is followed by: With the same sweep frequency step parameters The device to be calibrated was retested after configuring the filter coefficients to obtain the compensated output power curve. According to the compensated output power curve Flat output power with target Calculate the root mean square of the residuals within the band by the difference between them. When the root mean square of the in-band residuals When the output power exceeds the preset engineering tolerance, the compensated output power curve is used. Instead of the compensated frequency response curve Repeat steps S2 to S5 until the preset convergence condition is met, and output the current filter coefficients as the final calibration result. The preset convergence conditions include one or more of the following: the root mean square of the in-band residual is not greater than the preset engineering tolerance, the improvement of the root mean square of the in-band residual in two consecutive iterations is less than a preset proportion, and the number of iterations reaches a preset upper limit.
[0017] A low-order FIR broadband flatness calibration system based on non-uniform sampling of frequency response gradient includes a microprocessor and a memory interconnected, the microprocessor being programmed or configured to perform the steps of a low-order FIR broadband flatness calibration method based on non-uniform sampling of frequency response gradient.
[0018] Compared with the prior art, the advantages of the present invention are as follows: This invention processes the difference between the measured output power curve of the device to be calibrated and the target flat output power to obtain a compensated frequency response curve. After smoothing, it calculates the frequency domain response gradient, enabling the identification of frequency regions with drastic local changes in the frequency response curve. Based on the frequency domain response gradient, this invention constructs a sampling density function and a cumulative distribution function, and generates a non-uniform frequency sampling grid accordingly. This ensures that regions with larger frequency domain response gradients have higher frequency point densities, while regions with smaller gradients maintain relatively lower frequency point densities. This allows local distortion regions to occupy more fitting constraints during the subsequent construction of the linear phase FIR filter basis matrix and the solution of filter coefficients. This improves the compensation capability for local narrowband fluctuations under the condition of a preset low-order FIR filter, reducing the hardware multiplier resource consumption and processing delay caused by using high-order FIR filters. Furthermore, this invention automatically generates a non-uniform frequency sampling grid through the sampling density function and cumulative distribution function, eliminating the need for manual weighting of different frequency bands. This improves the automation level of the broadband flatness calibration process and is highly suitable for factory calibration or operational calibration scenarios of broadband radar transceivers, broadband communication equipment, signal generators, and other similar devices. Attached Figure Description
[0019] Figure 1 This is a flowchart of a method according to an embodiment of the present invention.
[0020] Figure 2 The above is a simulation verification comparison diagram of the effectiveness of the method in the embodiments of the present invention, showing the frequency response characteristics of a device to be calibrated.
[0021] Figure 3 This is a comparison chart of frequency domain compensation curves to demonstrate the effectiveness of the method in this embodiment of the invention through simulation verification.
[0022] Figure 4 This is a magnified view of the high-frequency compensation curve, used to compare the effectiveness of the method in this embodiment of the invention through simulation.
[0023] Figure 5 This is a comparison chart of in-band calibration residuals to demonstrate the effectiveness of the method in this embodiment of the invention through simulation verification. Detailed Implementation
[0024] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.
[0025] The following is an explanation of the relevant technical terms and concepts involved in this invention: (1) FIR filter (Finite Impulse Response Filter): The impulse response of a filter decays to zero in a finite time, and has the advantages of absolute stability and linear phase.
[0026] (2) Type-I linear phase FIR filter: an odd-order, even-symmetric FIR filter whose frequency response can be expressed as a cosine series. It is the most commonly used type of linear phase FIR filter. The cosine series representation of the Type-I FIR filter is a classic conclusion in digital signal processing. For reference, see Oppenheim's textbook "Discrete-Time Signal Processing".
[0027] (3) Power Flatness: The degree of consistency of the output power of a signal source over a wide bandwidth, usually measured by the maximum deviation or standard deviation of the power curve.
[0028] (4) Savitzky-Golay Filter: A smoothing filter based on local polynomial fitting, which can smooth the signal while preserving its high-frequency characteristics and directly output the derivative value. Proposed by Savitzky and Golay in 1964, it is widely used for smoothing and differentiating spectral data.
[0029] (5) Non-uniform sampling: a sampling method with non-uniform sampling intervals, which can adaptively adjust the sampling density according to the signal characteristics.
[0030] (6) Cumulative Distribution Function (CDF): An important concept in probability theory, defined as the probability that a random variable is less than or equal to a certain value. The CDF is a monotonically increasing function with a range of values [0,1].
[0031] (7) Least Squares Method: A mathematical optimization technique that finds the best function match for data by minimizing the sum of squares of errors.
[0032] (8) Weighted Least Squares (WLS): A generalized form of least squares method that assigns different importance to different data points by introducing a weight matrix.
[0033] (9) Gibbs Phenomenon: An oscillation that occurs near the discontinuity point when using a finite-term Fourier series to approximate a discontinuous function.
[0034] (10) Group Delay: The time delay of each frequency component when the signal passes through the filter, defined as the negative derivative of the phase response with respect to the angular frequency.
[0035] (11) Cosine Basis Matrix: A matrix formed by sampling the cosine function at discrete frequency points, used to express the amplitude response of the FIR filter as a cosine series.
[0036] (12) Overdetermined system: A linear system of equations in which the number of equations exceeds the number of unknowns. It usually does not have an exact solution, but it does have a least squares solution.
[0037] (13) Tikhonov Regularization: A regularization method for solving ill-conditioned linear equations. It prevents high-frequency oscillations in the solution by adding norm constraint terms to the coefficient vector in the objective function.
[0038] (14) QR Decomposition: Decomposes a matrix into the product of an orthogonal matrix Q and an upper triangular matrix R, which is used to stably solve linear least squares problems.
[0039] (15) Probability integral transformation: This is a standard method in probability theory. If the random variable U follows a uniform distribution in [0,1], then the distribution function of F^(-1)(U) is exactly F.
[0040] (16) PCHIP (Piecewise Cubic Hermite Interpolating Polynomial): The piecewise cubic Hermite interpolation polynomial has the greatest feature of maintaining the monotonicity of the original data and does not produce the overshoot phenomenon in traditional cubic spline interpolation.
[0041] The fundamental principle of this invention originates from the frequency domain design method of FIR filters in digital signal processing. FIR filters are widely used in signal processing due to their linear phase characteristics and absolute stability. Traditional frequency domain design methods include the window function method, frequency sampling method, and equiripple optimal approximation method (Parks-McClellan algorithm), etc.
[0042] For a Type-I linear-phase FIR filter, i.e., an odd-order, even-symmetric FIR filter, its frequency response can be expressed as: .in The amplitude response is expressed as a cosine series, where N = (M-1) / 2 is the half-order of the filter and M is the filter order.
[0043] In existing technologies, frequency domain sampling methods specify the target frequency response at uniform sampling points in the frequency domain and obtain the time-domain filter coefficients through inverse discrete Fourier transform (IDFT). When the number of sampling points is greater than the filter order, this method is equivalent to least squares fitting. However, traditional frequency domain sampling methods use a uniform sampling strategy, which cannot adaptively adjust the sampling density according to the spectral characteristics, resulting in insufficient fitting accuracy in local fluctuation regions.
[0044] Another related technique is weighted least squares (WLS), which introduces a weight matrix to assign different importance to the fitting error of different frequency bands. However, the weight setting of WLS depends on human experience and lacks a data-driven adaptive mechanism, making it difficult to cope with the complex and ever-changing actual spectrum.
[0045] To address the aforementioned problems in existing technologies, this invention proposes a non-uniform frequency sampling method based on measured response gradients. By extracting the local rate of change (gradient) of the frequency domain response, the mathematically weighted error is physically transformed into the density distribution of the sampling grid. Through two main steps—adaptive non-uniform sampling and non-uniform sampling IFFT—dense sampling is performed in regions of severe fluctuation, while sparse sampling is performed in flat regions, achieving high-precision calibration of low-order FIR filters and significantly saving hardware resources. This invention solves the problems of insufficient fitting accuracy in locally fluctuating regions and the need for high-order FIR filters in traditional uniform frequency sampling methods.
[0046] like Figure 1 As shown, the low-order FIR broadband flatness calibration method based on non-uniform sampling of frequency response gradient in this embodiment includes the following steps: S1. Obtain the measured output power curve of the device to be calibrated within a preset broadband frequency range, and determine the compensation frequency response curve based on the difference between the measured output power curve and the target flat output power.
[0047] In a specific application embodiment, when measuring the output power curve of a signal source, a spectrum analyzer or power meter can be used to measure the output power curve of the signal source in uniform frequency steps over a wide bandwidth, calculate the difference between it and the target flatness, and obtain the frequency response curve that needs to be compensated. The unit of the compensated frequency response curve is dBm or logarithmic normalized dB, and all subsequent amplitude calculations are performed in the logarithmic domain. Let the original measured power be... The desired flat output power is Then the compensated frequency response curve can be determined. for:
[0048] Subsequent FIR filters were used to fit the data. Designed for the target. Measurement frequency range is... The number of sampling points is The frequency step is The measurement result is the superposition of the true frequency response of the signal source and the measurement noise.
[0049] S2, smooths the compensated frequency response curve, and calculates the frequency domain response gradient based on the smoothed compensated frequency response curve.
[0050] Step S2, smoothing the compensated frequency response curve, includes: The compensated frequency response curve was obtained using a Savitzky-Golay polynomial smoothing filter. The window length of the Savitzky-Golay polynomial smoothing filter is used for filtering. and polynomial order According to the frequency sweep step Measure the noise level and the narrowest characteristic width of the in-band ripples of the device to be calibrated. Sure; Among them, frequency sweep step According to the narrowest feature width that can be distinguished The principle is determined, window length With sweep frequency step The product is not greater than the narrowest feature width. The preset ratio is used, and the window length is increased when measurement noise increases. and / or reduce the polynomial order Reduce the window length when measuring noise. and / or increase the polynomial order This is used to obtain a smoothed compensated frequency response curve for calculating the frequency domain response gradient.
[0051] In specific application embodiments, to suppress the amplification effect of measurement noise on gradient calculation, a Savitzky-Golay polynomial smoothing filter can be used to smooth the compensation frequency response curve. Noise-resistant filtering preprocessing is performed. The SG filter achieves smoothing through local polynomial fitting, suppressing high-frequency noise while preserving the low-frequency characteristics of the signal.
[0052] Window length of Savitzky-Golay polynomial smoothing filter and polynomial order Based on the sweep frequency step Qualitative selection based on the measured noise level. Choose odd numbers, typically ranging from 11 to 31. Physically, The value is the length of the smoothing interval. If this value is too small, noise suppression will be insufficient, and gradient calculation will be dominated by measurement noise. If this value is too large, it will smooth out the real local distortion structure and reduce the calibration resolution.
[0053] In practice, when noise is significant, choose the larger value. To enhance smoothness, a smaller value is used when noise is weak. To preserve fluctuation details. Polynomial order Generally, orders 2 to 5 are used, with lower orders ( It has strong smoothing ability and is suitable for high-noise environments; high-order ( It has higher accuracy in fitting signal details and is suitable for weak distortion scenarios.
[0054] Sweep Step The selection should be based on the principle of being able to distinguish the fastest undulation feature within the band. Let the narrowest feature width of the undulation within the equipment band be denoted as... (i.e., the narrowest frequency span from rising to falling), then The Nyquist condition should be satisfied. Engineering recommendations Pick (Oversampling 4 to 8 times) to ensure that the undulating waveform is fully depicted. Corresponding physical frequency bandwidth It should not exceed Half of it, so as to avoid the smoothing effect from severely obscuring the true undulation features, that is or equivalent .remember Let be the number of sweep points corresponding to the narrowest feature width, then In practice, it is generally selected as... for A balance is struck between preserving detail and suppressing noise.
[0055] When the signal-to-noise ratio is high enough (such as in a standard factory test environment), a typical value can be selected. , If the narrowest undulation width of the equipment , frequency sweep step (correspond (point), then corresponding Approximately The smoothed curve is 3% to 10% smoothed, which neither significantly affects the fluctuation characteristics nor significantly reduces noise. Gradient calculation is then performed on the smoothed curve.
[0056] In step S2, calculating the frequency domain response gradient based on the smoothed compensated frequency response curve includes: The first-order frequency domain response gradient is calculated using center difference calculation for the internal measurement frequency points in the smoothed compensated frequency response curve. The first-order frequency domain response gradient is calculated using forward differential, backward differential, or boundary extension results based on smoothing at the boundary measurement frequency points. Based on the magnitude of the first-order frequency domain response gradient corresponding to each measurement frequency point The maximum first-order frequency domain response gradient magnitude within the preset wideband frequency range The ratio between them yields the normalized gradient value. ; Below the preset gradient threshold normalized gradient value Set to zero, and optionally adjust the normalized gradient value. The sequence undergoes abnormal peak removal and adjacent high gradient region merging. Abnormal peak removal is used to suppress single-point pseudo gradients formed by sudden interference, and adjacent high gradient region merging is used to merge multiple measurement frequency points that continuously exceed a preset high gradient threshold into the same high gradient connected region.
[0057] In a specific application embodiment, the first derivative, i.e., the frequency domain response gradient, is calculated on the smoothed power curve as a measure of the degree of local fluctuation. For internal measurement frequencies, the first-order frequency domain response gradient is calculated using the central difference formula:
[0058] in, This indicates the compensated frequency response curve after smoothing at a specific frequency point. The amplitude value at that point, This represents the sweep step between adjacent original measurement frequency points. For the boundary points at both ends of the sequence ( and The gradient values at the endpoints can be obtained by using first-order forward and backward difference calculations, or by directly utilizing the boundary polynomial extension characteristics of the Savitzky-Golay filter, to ensure that the gradient sequence length is strictly consistent with the number of original measurement points.
[0059] gradient magnitude The larger the value, the more drastic the change in that frequency range, requiring more sampling points. To establish a unified sampling density metric, the gradient magnitude is normalized to the [0,1] interval:
[0060] in, Normalized gradient value It is comparable across different frequency points and can be directly used as the basic input for subsequent sampling density functions.
[0061] To avoid spurious gradient values caused by extremely low noise from participating in sampling density allocation, a gradient threshold is set. (like ),Will The frequency points are considered as zero gradient regions, and only minimal uniform sampling is retained in flat regions.
[0062] In practical engineering, alternatively, measures such as anomaly peak removal and merging of adjacent high-gradient regions can be adopted based on the measured data. If there are sudden interferences in the measurement environment, such as transient or pulse interference during switching, the gradient sequence can be filtered by median or a limiting threshold can be set. For example, g(f) > 3σ can be considered an anomaly, and the frequency points corresponding to the anomaly peaks can be directly excluded from the sampling density calculation to prevent excessive attraction of sampling resources by local single-point noise. When the gradient values of multiple consecutive frequency points exceed a higher threshold, they can be merged into a connected region to uniformly allocate the number of sampling points, avoiding excessive accumulation of sampling points in high-gradient regions. This measure works in conjunction with the minimum frequency interval constraint in subsequent steps to jointly control the discrete quality of the non-uniform grid.
[0063] S3 constructs a sampling density function and a cumulative distribution function based on the frequency domain response gradient, and generates a non-uniform frequency sampling grid based on the sampling density function and the cumulative distribution function, so that the non-uniform frequency sampling grid has a high frequency point density in the frequency region with a large frequency domain response gradient. It abandons the paradigm of manually setting weights and uses the local derivative of the curve itself to directly map to the sampling density of the frequency points.
[0064] In step S3, constructing the sampling density function and cumulative distribution function based on the frequency domain response gradient includes: The magnitude of the frequency domain response gradient is normalized to obtain the normalized gradient value. Based on the normalized gradient value The power function and the fundamental density bias Constructing the sampling density function ; where the power exponent of the power function Used to adjust the sampling density enhancement level in high gradient frequency regions, base density bias Used to preserve the base sampling density in the frequency region where the normalized gradient value is zero; For sampling density function Normalized integration is performed within a preset broadband frequency range to obtain the corresponding cumulative distribution function. Cumulative distribution function It is a monotonically increasing function.
[0065] In a specific application embodiment, firstly, based on the normalized gradient value... Construct the sampling density function:
[0066] in To normalize the gradient magnitude, The power exponent ( ), used for nonlinear amplification of sampling density weights in the high gradient region: The larger the value, the more concentrated the sampling resources become in areas of dramatic fluctuations; It degenerates into a linear form. Based on density bias ( This ensures that even in flat regions where the gradient is zero, a minimum number of sampling points are still maintained.
[0067] The value of is taken with reference to the average level of the normalized gradient, and is generally taken as . This ensures that the basic sampling density in the flat region is approximately 5% to 15% of the sampling density in the region of maximum gradient. A typical engineering example uses this value. , In conventional broadband RF front-end calibration scenarios, a good balance can be achieved between fluctuation fitting accuracy and full-band coverage.
[0068] After normalizing the density function, calculate the cumulative distribution function (CDF):
[0069] CDF is a monotonically increasing function with a value range of [0,1].
[0070] In step S3, generating a non-uniform frequency sampling grid based on the sampling density function and cumulative distribution function includes: Obtain the sampling density function value corresponding to the original measurement frequency point. For each sampled density function value Normalization is performed to obtain the discrete probability density. For discrete probability density By performing accumulation processing, the discrete cumulative distribution function is obtained. In the discrete cumulative distribution function Within the range of values, multiple interval midpoint quantiles are selected according to the number of non-uniform sampling points; the inverse mapping of the discrete cumulative distribution function is solved by the conformal monotonic interpolation algorithm to obtain multiple non-uniform frequency sampling points corresponding to multiple interval midpoint quantiles, so as to form a non-uniform frequency sampling grid. Among them, the number of non-uniform sampling points Based on the half-order of the linear phase FIR filter and the original number of measurement points Determine the number of non-uniform sampling points. The number of unknown coefficients is greater than that of a linear-phase FIR filter, but not greater than the number of original measurement points. Half-order of a linear phase FIR filter The number of unknown coefficients in a linear-phase FIR filter is half-order, determined by the preset order M of the constructed filter. Add one.
[0071] In a specific application embodiment, the specific steps for generating a non-uniform frequency sampling grid are as follows: Original measurements at Uniform frequency points The sampling density value is obtained above. Normalize it to a discrete probability density:
[0072] The discrete cumulative distribution function (CDF) is obtained by summing the results:
[0073] Uniformly select values in the CDF range [0,1]. quantiles:
[0074] Solving the inverse mapping using conformal monotonic interpolation (PCHIP) That is, using Data point interpolation The corresponding frequency value. The midpoint of the interval is used as the reference point. To avoid boundary deviations, combine with PCHIP interpolation to ensure... Strictly monotonically increasing to prevent frequency overlap from causing rank deficiency in the cosine basis matrix. The final result is... This is a non-uniform frequency sampling grid, where frequency points are dense in regions with large gradients (where CDF changes rapidly) and sparse in regions with small gradients.
[0075] Non-uniform sampling point number The selection of must satisfy the following constraints: ① Overdetermined condition: cosine basis matrix The size is ,in It is a half-order number. Must be greater than Otherwise, the system of equations will be underdetermined. In engineering, it is generally taken as... To ensure sufficient over-determination.
[0076] ② Original measurement resolution constraint: Non-uniform frequency points are obtained by performing CDF inverse mapping interpolation on the original uniform measurement grid. The upper limit is limited by the number of original measurement points. Constraints: When there is non-uniform frequency, there will be repetition or excessive interpolation, which will not increase the amount of effective information. Therefore, it is necessary to satisfy the following: .
[0077] ③ Typical selection method: Considering the above constraints, Preferably in Select within the range. For scenarios with relatively gentle fluctuations within the band, select the area near the lower limit (…). Slightly higher For scenes with severe narrowband distortion, the upper bound direction is taken ( near Typical values are preferably taken as follows: In conventional broadband RF calibration scenarios, a good balance can be achieved between sufficient overdetermination and grid density.
[0078] It is understood that this embodiment does not perform binary region segmentation of the gradient into "severely fluctuating regions / flat regions," but instead uses the density function. The normalized gradient values are continuously mapped to the local sampling density, where The flat area is maintained Basic density, The area of violent fluctuations was obtained Maximum density. Each frequency point participates in CDF construction continuously and uniformly according to its gradient value. Gradient threshold. like It is only used to zero out extremely weak pseudo-gradients caused by noise, so as to avoid the sampling density in flat areas being contaminated by the noise floor, rather than to perform regional qualitative segmentation of the spectrum.
[0079] In step S3, after generating the non-uniform frequency sampling grid, the post-processing verification of multiple non-uniform frequency sampling points in the non-uniform frequency sampling grid is also included. The post-processing verification includes one or more of the following: minimum interval verification, maximum interval verification, and strict monotonicity verification. The minimum interval verification includes: determining the difference between two adjacent non-uniform frequency sampling points. and Is the interval between them smaller than the original sweep frequency step? If so, then remove the corresponding redundant frequency points and adjust the number of non-uniform sampling points. Maximum interval verification includes determining whether the interval between two adjacent non-uniform frequency sampling points is greater than the narrowest feature width of the in-band ripples of the device to be calibrated. If so, then insert supplementary frequency points between the corresponding two adjacent non-uniform frequency sampling points; strict monotonicity verification includes: determining whether the interval between two adjacent non-uniform frequency sampling points is less than or equal to a preset minimum positive number. If so, then remove the corresponding redundant frequency points and adjust the number of non-uniform sampling points. .
[0080] In specific application embodiments, since the CDF inverse mapping is a purely mathematical transformation and does not automatically guarantee that the frequency point spacing meets physical constraints, it is also necessary to process the generated data in engineering implementation. The sequence undergoes the following post-processing verification: ① Minimum interval: adjacent non-uniform frequency points and The interval is preferably not less than the original sweep frequency step. ,Right now The original measurement was based on For resolution, lower The spacing cannot provide additional effective physical information. If extreme gradients cause the local frequency spacing to exceed this lower limit, redundant frequencies are removed and dynamically fine-tuned. The value is used to prevent the cosine basis matrix from having highly correlated row vectors, which would lead to a deterioration of the condition number.
[0081] ② Maximum Spacing: Even in a flat region where the gradient is zero, the spacing between adjacent non-uniform frequency points should preferably not exceed the narrowest feature width within the band. ,Right now If the CDF inverse mapping produces a blind zone with excessively large spacing in the flat region, then uniform supplementary frequency points are forcibly inserted in the blind zone to ensure that a complete narrowest fluctuation does not fall between two adjacent frequency points and thus miss sampling.
[0082] Due to sampling density in flat areas Smaller (approaching) Slow CDF growth may lead to multiple uniform quantiles. Mapping to extremely close frequencies, even due to floating-point precision limitations. The frequency overlap phenomenon. The solution is: in the generation After sequencing, perform strict monotonicity verification and deduplication operations—if ( For a very small positive number, such as Then, redundant points are eliminated and dynamic fine-tuning is performed. This operation ensures that the frequency sequence of the input PCHIP interpolation and subsequent construction of the cosine basis matrix is strictly monotonically increasing, completely avoiding the risk of matrix rank deficiency caused by frequency overlap.
[0083] S4: Obtain the target compensation response based on the non-uniform frequency sampling grid, and construct the basis matrix corresponding to the linear phase FIR filter of a preset order. Step S4 includes: Each non-uniform frequency sampling point in the non-uniform frequency sampling grid At this point, the compensated frequency response curve after smoothing is shown. Interpolation is performed to obtain the target compensation response corresponding to each non-uniform frequency sampling point. Convert each non-uniform frequency sampling point into a normalized digital frequency. And based on normalized digital frequency The cosine basis matrix is constructed using the preset order M of the linear phase FIR filter and the half-order N determined by the preset order. ; Among them, the cosine basis matrix The number of rows is the number of non-uniform sampling points. The number of columns is half-order N plus one, and the matrix elements in the cosine basis matrix are determined by the normalized digital frequency and cosine basis function corresponding to each non-uniform frequency sampling point.
[0084] In specific application embodiments, in non-uniform sampling grids After generation, construct the FIR filter according to the following steps: ① Obtain the target response at non-uniform frequency points: at non-uniform frequency points At this point, the measurement curve smoothed by SG is obtained through PCHIP interpolation. Obtain the corresponding target amplitude value. (The target frequency response that the FIR filter needs to fit during flattening calibration) .
[0085] ② Constructing the cosine basis matrix: Normalizing non-uniform frequency points into digital frequencies Construct the cosine basis matrix as follows: : Convert non-uniform frequency points to normalized digital frequencies. ; For baseband or zero-IF calibration architecture The frequency naturally falls within the [0, pi] interval; if the calibration band is a bandpass subband, it needs to be normalized according to the actual system sampling rate. Construct a cosine basis matrix V with a size of K×(N+1), where N=(M-1) / 2 is the half-order of the filter and M is the order of the FIR filter. The matrix elements are: .
[0086] Finally, the overdetermined system of equations was obtained. ,in Let be the vector of cosine coefficients to be determined. By combining a non-uniform sampling grid with least-squares inversion of overdetermined equations, we can achieve the desired result within the constrained... With sufficient hardware resources, the filter's degrees of freedom automatically tilt towards the frequency band where the distortion of the signal source to be compensated is most severe.
[0087] S5. Solve and reconstruct the filter coefficients of the linear phase FIR filter based on the target compensation response and the basis matrix, and configure the filter coefficients to the digital signal processing module of the device to be calibrated in order to perform broadband flatness compensation on the output signal of the device to be calibrated.
[0088] In step S5, the filter coefficients of the linear-phase FIR filter are solved based on the target compensation response and the basis matrix, including: Using the basis matrix as the cosine basis matrix, the target compensation response vector is formed by combining the target compensation responses corresponding to each non-uniform frequency sampling point, and then constructing a target compensation response vector with the cosine coefficient vector. Overdetermined system of equations with unknowns ; For overdetermined systems of equations Least squares are used to obtain the cosine coefficients of the linear-phase FIR filter; among them, QR decomposition is used to solve the overdetermined equations, and the condition number of the cosine basis matrix is greater than a preset condition number threshold. When the cosine coefficients are solved by the Tikhonov regularization term, the regularization parameter of the Tikhonov regularization term is determined based on the condition number of the cosine basis matrix, the preset condition number threshold, and the average energy of the cosine basis matrix. The causal and symmetric time-domain FIR filter coefficients are reconstructed from the cosine coefficients. The zeroth-order cosine coefficient is used as the center tap coefficient, and half of the non-zero-order cosine coefficients are used as two tap coefficients symmetrical about the center tap, resulting in time-domain FIR filter coefficients with subscripts distributed in the range of 0 to 2N, where N is the half-order of the linear phase FIR filter.
[0089] In a specific application example, the FIR coefficients are solved using least squares, and the specific steps are as follows: Normalize non-uniform frequency points into digital frequencies Following step S4, construct the cosine basis matrix V, and finally obtain the overdetermined system of equations: ,in Let be the vector of cosine coefficients to be determined. Since... The system of equations is overdetermined; it can be solved by minimizing... Solve for the following: In regions with large gradients, the CDF inverse mapping concentrates more non-uniform frequency points in this segment, corresponding to a larger number of rows in the cosine basis matrix for this frequency region. This is equivalent to assigning a larger error weight to this region in the least squares objective function. In other words, the denser the frequency points, the larger the proportion of this region in the entire residual sum of squares, driving the filter coefficients to preferentially fit the fluctuation characteristics of this region.
[0090] To avoid directly constructing normal equations during the solution process... To address the resulting ill-conditioned amplification, QR decomposition should be used to directly solve the overdetermined equations. At this point, the density distribution of the non-uniform sampling grid has implicitly achieved a weighting effect in the objective function, and regions with drastic fluctuations naturally receive higher fitting weights due to the large number of equations.
[0091] When the cosine basis matrix condition number When necessary, switch to Tikhonov regularization to ensure numerical stability:
[0092] in This enables adaptive regularization driven by the degree of pathology.
[0093] After obtaining the cosine coefficients of the linear phase FIR filter, based on the cosine coefficients... Reconstruct the time-domain FIR filter coefficients h[n]. For a Type-I linear-phase FIR filter, the time-domain coefficient vector... It can be directly reconstructed using the following formula:
[0094] Due to the half-order The reconstructed time-domain coefficients Its subscripts are naturally distributed in The interval is therefore naturally causal and symmetric, requiring no additional shift operations. The reconstructed filter has strictly linear phase. This causal filter, once deployed in the hardware pipeline, will introduce a fixed group delay. (in (where is the system sampling period). It can be understood that numerical solution strategies using QR decomposition or condition number adaptive triggering with Tikhonov regularization can guarantee numerical stability of the matrix in ill-conditioned cases.
[0095] Finally, the obtained time-domain FIR filter coefficients are configured into the digital signal processing module of the device to be calibrated, such as the FIR convolution module in an FPGA or DSP, to perform broadband flatness compensation on the output signal of the device to be calibrated. This algorithm can be used in offline calibration or power-on self-test calibration pipelines. The coefficients are then embedded into the FPGA / DSP and convolved in real time with O(M) complexity. If only amplitude flatness calibration is required, the target phase can be set to zero; if waveform fidelity is required, group delay compensation or complex response fitting should be used.
[0096] In a further embodiment, step S5 is followed by a closed-loop retest and iterative convergence step, specifically: With the same sweep frequency step parameters The device to be calibrated was retested after configuring the filter coefficients to obtain the compensated output power curve. According to the compensated output power curve Flat output power with target Calculate the root mean square of the residuals within the band by the difference between them. When the root mean square of the residuals within the band When the output power exceeds the preset engineering tolerance, the compensated output power curve will be used. Replacement frequency response curve Repeat steps S2 to S5 until the preset convergence condition is met, and output the current filter coefficients as the final calibration result. The preset convergence conditions include one or more of the following: the root mean square of the in-band residual is not greater than the preset engineering tolerance, the improvement of the root mean square of the in-band residual in two consecutive iterations is less than a preset proportion, and the number of iterations reaches the preset upper limit.
[0097] In a specific application embodiment, after the FIR compensation coefficients reconstructed in step S5 are deployed to the hardware, the output power curve of the signal source is retested with the same frequency sweep parameters. Calculate the root mean square (RMS) of the in-band residuals:
[0098] in and The difference calculation is performed in the logarithmic field (dB / dBm) to make... Directly corresponds to radio frequency engineering specifications (unit: dB).
[0099] like If it exceeds the engineering tolerance (usually taken as 0.05~0.1dB), then... Replace step one As the input curve, subsequent steps two through eight remain unchanged, generating updated FIR coefficients and redeploying the retest. Repeat this process until any of the following convergence conditions are met: ① Engineering tolerance (meeting standards and convergence); ② Two consecutive iterations The improvement is less than 5% (profit saturation convergence); ③ The number of iterations reaches the upper limit (usually 3 to 5 times, to prevent infinite loop).
[0100] If any condition is met, the current FIR coefficients are output as the final calibration result. This closed-loop mechanism can effectively compensate for residual biases introduced by measurement noise or suboptimal SG filter parameters.
[0101] In this embodiment, non-uniform sampling and weighted least squares are equivalent. Let the sampling density within the frequency interval Δω be ρ(ω), then the contribution of the sum of squared errors within this interval is approximately... With weighted least squares objective function By comparison, the implicit weights can be obtained. This means that gradient-driven non-uniform sampling automatically assigns greater weights to regions with large fluctuations, and this weight allocation is entirely data-driven and requires no manual setting.
[0102] In an exemplary application scenario Figures 2-5 This is a simulation comparison chart to verify the effectiveness of the method of the present invention. Among them, Figure 2 This is a frequency response compensation characteristic of a device, showing the fluctuation of the device's output power over a wide bandwidth. Figure 3 The frequency domain compensation curves show the compensation responses obtained by solving for non-uniform frequency sampling grids and conventional frequency domain equal-interval FIR, respectively. Figure 4 This is a partial view of the high-frequency compensation curve, used to compare and display the fitting of the compensation curve in the high-frequency, rapidly fluctuating region. Figure 5 This is used for comparing the in-band residuals after output calibration, and to compare the residual distribution before and after calibration, as well as under different sampling strategies.
[0103] Figure 2 This presentation showcases the full-band RF compensation response of the device under calibration within a bandwidth of approximately 0-500MHz. The blue-background area represents the core bandpass region for evaluation. Noise-injected measured values, SG smoothing values, and noise-free output curves are also provided. It can be seen that the device's frequency response changes relatively slowly from low to mid-frequency, but exhibits significant rapid fluctuations after approximately 350MHz, particularly in the high-frequency range where peaks, troughs, and sharp rises are observed. From... Figure 2 It is known that the target of this invention is not uniform fluctuation across the entire frequency band, but rather the typical broadband flatness problem of "severe fluctuations in local narrow bands and relatively flatness in other frequency bands", which also provides a basis for subsequent non-uniform sampling based on frequency response gradient.
[0104] Figure 3 The broadband calibration responses obtained by the method of this invention and the uniform sampling method were compared under the condition of using 31st-order FIR constraints. The black curve represents the ideal target response, the red curve represents the method of this invention, and the blue dashed line represents the uniform sampling method. Looking at the entire frequency band, the curve of this invention is closer to the ideal target response overall, especially in the high-frequency rapidly fluctuating region, where the red curve can better follow the peak and valley changes of the target response; while the uniform sampling method shows more obvious deviations at local rapidly changing areas. Figure 3 As can be seen, under the same low-order FIR resource constraints, this invention uses non-uniform frequency sampling to make the fitting ability more concentrated in the frequency band with more obvious distortion.
[0105] Figure 4 This is a local magnification of the high-frequency, fast-fluctuation region of approximately 350-480MHz. This region contains distinct rise, fall, trough, and re-rise processes, and is the part of the entire frequency band where low-order FIR fitting requirements are relatively high. Figure 4 The red curve shows peaks around 390MHz, troughs around 440MHz, and rising segments after 460MHz that are closer to the ideal black target response; the blue dashed line deviates significantly at the depth of the troughs and the slope of the rising segments. Figure 4 It can be seen that the present invention can enhance the fitting constraint in the region of rapid frequency response change.
[0106] Figure 5The diagram shows a comparison of the in-band calibration residuals of the method of this invention and the uniform sampling method. It can be seen that the red residual curve of this invention is closer to the zero line overall, with smaller residual fluctuations; the blue dashed residual curve of the uniform sampling method shows greater fluctuations in most frequency bands and significant deviations at high frequencies. Figure 5 As can be seen, under the same low-order FIR constraints, the method of the present invention not only gets closer to the target response in local curve tracking, but also has a lower overall in-band residual.
[0107] The simulation results show that this embodiment combines non-uniform sampling with filtering and fitting. By effectively enhancing the error weight of the distortion region, it can achieve the distortion fitting accuracy that traditional uniform sampling high-order filters can only achieve with a lower-order FIR filter, saving multiplier resources in the underlying hardware and reducing signal transmission delay.
[0108] It should be noted that some technical solutions in this embodiment can also adopt the following alternatives. First, the classic Parks-McClellan, i.e., Remez exchange algorithm, can be used to design the FIR filter. However, this approach usually requires explicit cutoff frequencies for the input passband, stopband, and transition band, as well as error weight values within each band. For irregular fluctuations actually measured from broadband signal sources, their location and width are random, and multiple fluctuations coexist. Using the Remez algorithm requires complex external frequency band cutting and peak search algorithms to determine its parameters, resulting in poor convergence and robustness. Second, gradient calculation can be performed directly using the Savitzky-Golay derivative filter, instead of smoothing first and then differentiating. The SG filter can simultaneously output the smoothed value and the derivative value, completing the smoothing and differentiation operations in one step. Third, the sampling density function can be expressed as the power function of the gradient ρ(f) = | H(f)|^α+β, where α>1 further enhances the sampling density in the fluctuation region, and α<1 results in a relatively smooth sampling distribution.
[0109] Compared with the prior art, the present invention has the following beneficial effects: (1) Significantly saves hardware resources and reduces system latency: This invention combines non-uniform sampling with filtering fitting, and by equivalently enhancing the error weight of the distortion region, only a very low-order FIR filter (e.g., 31st order) is needed to achieve the distortion fitting accuracy that traditional uniform sampling filters of hundreds of orders can achieve. This saves multiplier resources in the underlying hardware by a factor of two and greatly reduces signal transmission delay.
[0110] (2) Complete automation of engineering applications: Compared to the problem of manually setting different frequency band weights by observing waveforms in the classic textbook weighted least squares (WLS), this invention realizes automatic and dynamic adjustment of the compensation center of gravity based on measured data through a fully mathematical analytical process of gradient → density function → inverse mapping CDF. It is suitable for mass equipment factory calibration and system power-on self-calibration.
[0111] (3) Strong noise resistance: Through Savitzky-Golay filtering preprocessing, the amplification effect of measurement noise on gradient calculation is effectively suppressed, which improves the robustness of the algorithm in the actual test environment.
[0112] (4) Good numerical stability: QR decomposition or Tikhonov regularization is used to solve the problem, avoiding coefficient oscillation caused by ill-conditioning of the matrix.
[0113] The system of the present invention corresponds to the method described above and has the same advantages as the method described above.
[0114] The present invention can implement all or part of the processes in the methods of the above embodiments, or it can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. Computer-readable media include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. The memory is used to store computer programs and / or modules. The processor implements various functions by running or executing the computer programs and / or modules stored in the memory, and by calling data stored in the memory. The memory may include high-speed random access memory, as well as non-volatile memory, such as hard disks, RAM, plug-in hard disks, smart media cards (SMC), secure digital (SD) cards, flash cards, at least one disk storage device, flash memory device, or other volatile solid-state storage devices.
[0115] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A low-order FIR broadband flatness calibration method based on non-uniform sampling of frequency response gradient, characterized in that, Including the following steps: S1, obtain the measured output power curve of the device to be calibrated within a preset broadband frequency range, and determine the compensation frequency response curve based on the difference between the measured output power curve and the target flat output power. S2, smooth the compensated frequency response curve, and calculate the frequency domain response gradient based on the smoothed compensated frequency response curve. S3, construct a sampling density function and a cumulative distribution function based on the frequency domain response gradient, and generate a non-uniform frequency sampling grid based on the sampling density function and the cumulative distribution function, so that the non-uniform frequency sampling grid has a high frequency point density in the frequency region with a large frequency domain response gradient. S4. Obtain the target compensation response based on the non-uniform frequency sampling grid, and construct the basis matrix corresponding to the linear phase FIR filter of a preset order; S5. Solve and reconstruct the filter coefficients of the linear phase FIR filter based on the target compensation response and the basis matrix, and configure the filter coefficients to the digital signal processing module of the device to be calibrated in order to perform broadband flatness compensation on the output signal of the device to be calibrated.
2. The low-order FIR broadband flatness calibration method based on non-uniform sampling of frequency response gradient according to claim 1, characterized in that, Step S2, smoothing the compensated frequency response curve includes: The compensated frequency response curve was obtained by using a Savitzky-Golay polynomial smoothing filter. The window length of the Savitzky-Golay polynomial smoothing filter is used for filtering. and polynomial order According to the frequency sweep step Measure the noise level and the narrowest characteristic width of the in-band ripples of the device to be calibrated. Sure; Among them, the frequency sweep step According to the width of the narrowest feature that can be distinguished The principle is determined by the length of the window. With sweep frequency step The product is not greater than the narrowest feature width. The preset ratio is used, and the window length is increased when the measurement noise increases. and / or reduce the order of the polynomial The window length is reduced when the measurement noise is reduced. and / or increase the order of the polynomial This is used to obtain a smoothed compensated frequency response curve for calculating the frequency domain response gradient.
3. The low-order FIR broadband flatness calibration method based on non-uniform sampling of frequency response gradient according to claim 1, characterized in that, In step S2, calculating the frequency domain response gradient based on the smoothed compensated frequency response curve includes: The first-order frequency domain response gradient is calculated using center difference calculation for the internal measurement frequency points in the smoothed compensated frequency response curve. The first-order frequency domain response gradient is calculated using forward differential, backward differential, or boundary extension results based on smoothing at the boundary measurement frequency points. Based on the magnitude of the first-order frequency domain response gradient corresponding to each measurement frequency point The maximum first-order frequency domain response gradient magnitude within the preset wideband frequency range The ratio between them yields the normalized gradient value. ; Below the preset gradient threshold normalized gradient value Set to zero, and adjust the normalized gradient value. The sequence undergoes abnormal peak removal and adjacent high gradient region merging processing; wherein, the abnormal peak removal is used to suppress single-point pseudo gradients formed by sudden interference, and the adjacent high gradient region merging is used to merge multiple measurement frequency points that continuously exceed a preset high gradient threshold into the same high gradient connected region.
4. The low-order FIR broadband flatness calibration method based on non-uniform sampling of frequency response gradient according to claim 1, characterized in that, In step S3, constructing the sampling density function and cumulative distribution function based on the frequency domain response gradient includes: The magnitude of the frequency domain response gradient is normalized to obtain the normalized gradient value. According to the normalized gradient value The power function and the fundamental density bias Constructing the sampling density function Wherein, the exponent of the power function The base density bias is used to adjust the sampling density enhancement level in the high gradient frequency region. Used to preserve the base sampling density in the frequency region where the normalized gradient value is zero; For the sampling density function Normalized integration is performed within a preset broadband frequency range to obtain the corresponding cumulative distribution function. The cumulative distribution function It is a monotonically increasing function.
5. The low-order FIR broadband flatness calibration method based on non-uniform sampling of frequency response gradient according to claim 1, characterized in that, In step S3, generating a non-uniform frequency sampling grid based on the sampling density function and the cumulative distribution function includes: Obtain the sampling density function value corresponding to the original measurement frequency point. For each sampled density function value Normalization is performed to obtain the discrete probability density. ; for the discrete probability density By performing accumulation processing, the discrete cumulative distribution function is obtained. ; in the discrete cumulative distribution function Multiple interval midpoint quantiles are selected within the range of non-uniform sampling points; the inverse mapping of the discrete cumulative distribution function is solved by the conformal monotonic interpolation algorithm to obtain multiple non-uniform frequency sampling points corresponding to the multiple interval midpoint quantiles, so as to form the non-uniform frequency sampling grid. Among them, the number of non-uniform sampling points Based on the half-order of the linear phase FIR filter and the original number of measurement points The number of non-uniform sampling points is determined. The number of unknown coefficients is greater than that of the linear phase FIR filter, but not greater than the number of original measurement points. The half-order of the linear phase FIR filter The number of unknown coefficients corresponding to the constructed linear-phase FIR filter is determined by a preset order M, and is half the order. Add one.
6. The low-order FIR broadband flatness calibration method based on non-uniform sampling of frequency response gradient according to claim 1, characterized in that, In step S3, after generating the non-uniform frequency sampling grid, the post-processing verification of multiple non-uniform frequency sampling points in the non-uniform frequency sampling grid is further included. The post-processing verification includes one or more of the following: minimum interval verification, maximum interval verification, and strict monotonicity verification. The minimum interval verification includes: determining two adjacent non-uniform frequency sampling points. and Is the interval between them smaller than the original sweep frequency step? If so, then remove the corresponding redundant frequency points and adjust the number of non-uniform sampling points. The maximum interval verification includes: determining whether the interval between two adjacent non-uniform frequency sampling points is greater than the narrowest feature width of the in-band ripples of the device to be calibrated. If so, then a supplementary frequency point is inserted between the corresponding two adjacent non-uniform frequency sampling points; the strict monotonicity check includes: determining whether the interval between two adjacent non-uniform frequency sampling points is less than or equal to a preset minimum positive number. If so, then remove the corresponding redundant frequency points and adjust the number of non-uniform sampling points. .
7. The low-order FIR broadband flatness calibration method based on non-uniform sampling of frequency response gradient according to claim 1, characterized in that, Step S4 includes: Each non-uniform frequency sampling point in the non-uniform frequency sampling grid At this point, the compensated frequency response curve after smoothing is shown. Interpolation is performed to obtain the target compensation response corresponding to each non-uniform frequency sampling point. Convert each non-uniform frequency sampling point into a normalized digital frequency. And according to the normalized digital frequency The preset order M of the linear phase FIR filter and the half-order N determined by the preset order are used to construct the cosine basis matrix. ; Wherein, the cosine basis matrix The number of rows is the number of non-uniform sampling points. The number of columns is the half-order N plus one, and the matrix elements in the cosine basis matrix are determined by the normalized digital frequency and cosine basis function corresponding to each non-uniform frequency sampling point.
8. The low-order FIR broadband flatness calibration method based on non-uniform sampling of frequency response gradient according to claim 1, characterized in that, In step S5, solving for the filter coefficients of the linear-phase FIR filter based on the target compensation response and the basis matrix includes: Using the basis matrix as the cosine basis matrix, the target compensation response corresponding to each non-uniform frequency sampling point is used to form the target compensation response vector, and a cosine coefficient vector is constructed. Overdetermined system of equations with unknowns ; For the overdetermined system of equations The cosine coefficients of the linear-phase FIR filter are obtained by performing least-squares solution; wherein, the overdetermined equation system is solved using QR decomposition, and the condition number of the cosine basis matrix is greater than a preset condition number threshold. When the cosine coefficients are solved by the Tikhonov regularization term, the regularization parameter of the Tikhonov regularization term is determined based on the condition number of the cosine basis matrix, the preset condition number threshold, and the average energy of the cosine basis matrix. The causal and symmetric time-domain FIR filter coefficients are reconstructed based on the cosine coefficients. The zero-order cosine coefficient is used as the center tap coefficient, and half of the non-zero-order cosine coefficients are used as two tap coefficients symmetrical with respect to the center tap, resulting in time-domain FIR filter coefficients with subscripts distributed in the range of 0 to 2N, where N is the half-order of the linear phase FIR filter.
9. The low-order FIR broadband flatness calibration method based on non-uniform sampling of frequency response gradient according to claim 1, characterized in that, Step S5 is followed by: With the same sweep frequency step parameters The device to be calibrated was retested after configuring the filter coefficients to obtain the compensated output power curve. According to the compensated output power curve Flat output power with target Calculate the root mean square of the residuals within the band by the difference between them. When the root mean square of the in-band residuals When the output power exceeds the preset engineering tolerance, the compensated output power curve is used. Instead of the compensated frequency response curve Repeat steps S2 to S5 until the preset convergence condition is met, and output the current filter coefficients as the final calibration result. The preset convergence conditions include one or more of the following: the root mean square of the in-band residual is not greater than the preset engineering tolerance, the improvement of the root mean square of the in-band residual in two consecutive iterations is less than a preset proportion, and the number of iterations reaches a preset upper limit.
10. A low-order FIR broadband flatness calibration system based on non-uniform sampling of frequency response gradient, comprising a microprocessor and a memory interconnected, characterized in that, The microprocessor is programmed or configured to perform the steps of the low-order FIR broadband flatness calibration method based on non-uniform sampling of frequency response gradient as described in any one of claims 1 to 9.