A method and system for automatically adjusting peak EQ

CN116722839BActive Publication Date: 2026-09-22SICHUAN HUSHAN ELECTRIC APPLIANCE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310380872.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-11
Publication Date
2026-09-22
Estimated Expiration
2043-04-11

AI Technical Summary

Technical Problem

[0008]本发明所要解决的技术问题是现有手动调整峰值EQ过程繁琐、计算效率低,而根据目标频率响应曲线自动调整FIR滤波器系数的方法又不适应于自动调整峰值EQ,且不便于二次调整等问题

Benefits of technology

[0058]本发明一种自动调整峰值EQ的方法及系统,第一创造性地使用峰/谷搜索方法并利用其高度和宽度初始化一系列峰值EQ,大大减少了EQ调整的计算时间,并且为随后的梯度下降收敛方法提供基础,避免梯度下降的随机性造成发散或者得出不合理的峰值EQ参数。第二,由于初始化的峰值EQ的频率响应并不理想,本发明提出一种简单的办法优化已初始化的峰值EQ,即使用带动量梯度下降法更新峰值EQ的参数;在梯度下降更新EQ参数过程中,每一次循环都需要计算所有峰值EQ的总频率响应,为了减少此步骤所使用的时间,本发明又提出使用并行FFT法最大化提高处理器运行效率。第三,为进一步提高此方法的收敛性,又以带动量梯度下降方法替代传统梯度下降,并进行了梯度裁剪,使得更新的EQ参数不至于与初始化的EQ参数偏离过大,以至于结果发散或造成不符合要求的参数值。结果输出的参数能能够进行二次调整,大大提升用户使用体验。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116722839B_ABST
    Figure CN116722839B_ABST
Patent Text Reader

Abstract

The application discloses a kind of method and system of automatically adjusting peak EQ, comprising: S1: the target frequency response curve of equalizer is determined, and a series of peak EQ is initialized using the height and width of peak and / or valley in target frequency response curve;S2: the total frequency response of all peak EQ is calculated, and error is calculated according to total frequency response and target frequency response;Target frequency response is obtained according to target frequency response curve;S3: according to error, the gradient of system function coefficient of peak EQ is calculated, and the gradient is clipped to obtain the gradient after clipping;S4: the parameter of peak EQ is updated using momentum gradient descent method, until the maximum convergence step is reached, and the parameter of peak EQ is checked and the parameter of peak EQ is output;Otherwise, return to step S2.The application designs peak EQ to avoid the cumbersome of designing phase response, and the calculation efficiency is high, and in principle can meet the demand of various frequency responses to user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of peak EQ adjustment technology, and specifically to a method and system for automatically adjusting peak EQ. Background Technology

[0002] A peak equalizer (peaking EQ, also known as a bell equalizer or bell filter) is an equalization filter that boosts or attenuates a certain gain at a specified frequency. It is a type of parametric equalizer, implemented using an IIR (infinite impulse response) filter, and is widely used in audio and other signal processing fields. Users or engineers only need to specify three parameters of the peak EQ: center frequency, gain, and Q value to adjust the response at a specific frequency. Due to its stability, users or engineers can easily use multiple peak EQs to adjust the response across the entire frequency range. The system function of the peak EQ in the analog domain is given by the following equation:

[0003]

[0004] Where s is a point in the simulation domain. g is the peak EQ gain, and Q is the peak EQ Q value.

[0005] Manually adjusting the peak EQ to bring the frequency response closer to the target curve is a very tedious process. First, a peak position and peak gain must be manually determined from the target curve. Then, the Q value of the peak EQ is repeatedly adjusted to achieve a suitable peak width at that point. Next, the position, gain, and peak width of the next peak are determined, and this process is repeated until all the peak EQ values ​​approximate the target curve. During this process, adjusting a peak at one position may add a peak at another location on the spectrum, significantly increasing the difficulty of manually adjusting the EQ.

[0006] Automatically adjusting the FIR (finite impulse response) filter coefficients based on the target frequency response curve can be achieved using algorithms such as least squares FIR. However, this method is not convenient for secondary adjustments, and it is quite difficult for engineers or users to fine-tune the filter based on the obtained FIR results.

[0007] Traditional IIR filter design requires both phase response design and amplitude response design, which not only increases the design difficulty, but also means that there may not be a corresponding IIR for the designed response. Designing the peak EQ as part of the IIR design can avoid the tediousness of designing the phase response. Summary of the Invention

[0008] The technical problem this invention aims to solve is that existing methods for manually adjusting peak EQ are cumbersome and computationally inefficient, while the methods for automatically adjusting FIR filter coefficients based on the target frequency response curve are not suitable for automatically adjusting peak EQ and are inconvenient for secondary adjustments. The purpose of this invention is to provide a method and system for automatically adjusting peak EQ, which avoids the cumbersome design of phase response, achieves high computational efficiency, and in principle can meet users' needs for various frequency responses.

[0009] This invention is achieved through the following technical solution:

[0010] In a first aspect, the present invention provides a method for automatically adjusting peak EQ, the method comprising:

[0011] S1: Determine the target frequency response curve of the equalizer, and initialize a series of peak EQs using the height and / or width of the peaks and / or valleys in the target frequency response curve, so that the number of peak EQs reaches the maximum value.

[0012] S2: Calculate the total frequency response of all peak EQs and calculate the error between the total frequency response and the target frequency response; the target frequency response is obtained from the target frequency response curve.

[0013] S3: Based on the error, calculate the gradient of the system function coefficients of the peak EQ, and clip the gradient to obtain the clipped gradient;

[0014] S4: Based on the clipped gradient, update the parameters of the peak EQ using the momentum gradient descent method until the maximum number of convergence steps is reached or the error is less than the tolerance. Then check the parameters of the peak EQ and output the parameters of the peak EQ; otherwise, return to step S2 to continue execution.

[0015] Further, in step S1, a series of peak EQs are initialized using the height and / or width of the peaks and / or valleys in the target frequency response curve, including:

[0016] S11. Identify all peaks from the target frequency response curve and determine the center frequency of each peak.

[0017] S12, Calculate an evaluation height, the evaluation height is h. eval =h-rel h ·pro, where h is the peak height, pro is the peak significance, and rel h The value range is (0,1); peak significance is determined by the difference between the peak height h and a maximum local minimum near the peak.

[0018] S13, determine the curve opening width based on the evaluation height, and define it as the peak width;

[0019] S14: The product of peak height and peak width is used as the size of the peak. Calculate the size of all the peaks that have been found and find the maximum value.

[0020] S15, reverse the sign of the target frequency response curve to obtain the reversed target frequency response curve; find all valleys from the reversed target frequency response curve using the method of finding peaks, determine the center frequency of the valleys, repeat steps S12-S14 to determine the valley depth, valley width, and valley size of all valleys, and find the maximum value of the valley size.

[0021] S16, compare the largest peak and the deepest valley to obtain the largest peak / deepest valley;

[0022] S17. Initialize the parameters of the peak EQ with the peak height / valley depth and peak width / valley width of the largest peak / deepest valley to obtain the frequency response of the initialized peak EQ.

[0023] S18, Subtract the frequency response of the initialized peak EQ from the target frequency response curve to obtain the new target frequency response;

[0024] S19. Repeat steps S11-S18 until the number of peak EQs reaches the maximum value.

[0025] Furthermore, the parameters of the peak EQ in step S17 include frequency, gain, and Q value.

[0026] Furthermore, the system function H(z) for the initialized peak EQ is:

[0027]

[0028]

[0029]

[0030] Where h is the peak height / valley depth, x is the center frequency of the peak / valley, z is the variable on the complex plane, and Q is the Q value of the peak EQ.

[0031] Furthermore, in step S2, a parallel FFT method is used to calculate the total frequency response of all peak EQs, including:

[0032] A. Based on the target frequency response curve, take frequency sampling points at equal intervals from 0 to 2π.

[0033] B. Pad the numerator and denominator coefficients of the system function of each peak EQ with zeros, and perform parallel FFT on the two zero-padding sequences; the system function of the peak EQ is the frequency response of the peak EQ.

[0034] C, take the modulus and find the quotient of the two: the modulus of the FFT of the numerator coefficients of the system function of each peak EQ divided by the modulus of the FFT of the denominator coefficients of the system function of the peak EQ is the frequency response of each peak EQ at the selected equally spaced frequency points.

[0035] D, multiplying the frequency responses of all peak EQs gives the total frequency response of the multiple peak EQs.

[0036] Furthermore, the formula for calculating the gradient in step S3 is as follows:

[0037]

[0038] c i ={b 0,i ,b 1,i ,b 2,i ,a 0,i ,a 1,i ,a 2,i}

[0039] Where L is the error, H i,k For the i-th peak EQ at the k-th frequency sampling point ω k system functions

[0040]

[0041] Among them, b m,i and a m,i (m=0,1,2) are the constant parameters that determine this linear time-invariant system.

[0042] Furthermore, the expression for the momentum gradient descent method is:

[0043]

[0044] c i =c i +v i

[0045] Where ξ determines the magnitude of momentum, μ is the learning rate, and v i Let L be the gradient of the momentum correction, and L be the error.

[0046] Furthermore, in step 3, the gradient is clipped, limiting it to between the maximum and minimum values.

[0047] Further, step S4 checks and outputs the parameters of the peak EQ, including:

[0048] Check the peak EQ parameters. If the peak EQ parameters are within the preset range, output the peak EQ parameters.

[0049] If the parameters of the peak EQ are not within the preset range, the parameters of the peak EQ will be trimmed, restricted, or discarded.

[0050] Secondly, the present invention provides a system for automatically adjusting peak EQ, the system comprising:

[0051] The initialization unit is used to determine the target frequency response curve of the equalizer and initializes a series of peak EQs using the height and / or width of the peaks and / or valleys in the target frequency response curve, so that the number of peak EQs reaches the maximum value.

[0052] Total frequency response calculation unit, used to calculate the total frequency response of all peak EQs;

[0053] The error calculation unit is used to calculate the error based on the total frequency response and the target frequency response; the target frequency response is obtained from the target frequency response curve.

[0054] The gradient calculation unit is used to calculate the gradient of the system function coefficients with peak EQ based on the error.

[0055] The clipping unit is used to clip the gradient to obtain the clipped gradient;

[0056] The parameter update unit is used to update the parameters of the peak EQ using the momentum gradient descent method based on the clipped gradient, until the maximum number of convergence steps is reached or the error is less than the tolerance; and to check the parameters of the peak EQ and output the parameters of the peak EQ; otherwise, it returns to the total frequency response calculation unit to continue execution.

[0057] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0058] This invention provides a method and system for automatically adjusting peak EQ. Firstly, it innovatively uses a peak / valley search method and initializes a series of peak EQs using their height and width, significantly reducing the computation time for EQ adjustment and providing a foundation for subsequent gradient descent convergence, avoiding divergence or unreasonable peak EQ parameters caused by the randomness of gradient descent. Secondly, since the frequency response of the initialized peak EQ is not ideal, this invention proposes a simple method to optimize the initialized peak EQ, namely, using the momentum gradient descent method to update the peak EQ parameters. During the gradient descent update of EQ parameters, each loop needs to calculate the total frequency response of all peak EQs. To reduce the time used in this step, this invention proposes using a parallel FFT method to maximize processor efficiency. Thirdly, to further improve the convergence of this method, the momentum gradient descent method is replaced with traditional gradient descent, and gradient pruning is performed, ensuring that the updated EQ parameters do not deviate too much from the initialized EQ parameters, thus preventing divergence or unacceptable parameter values. The output parameters can be adjusted a second time, greatly improving the user experience. Attached Figure Description

[0059] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, do not constitute a limitation thereof. In the drawings:

[0060] Figure 1 This is a flowchart of a method for automatically adjusting peak EQ according to the present invention;

[0061] Figure 2 This is a detailed flowchart of a method for automatically adjusting peak EQ according to the present invention;

[0062] Figure 3 This is a schematic diagram of the final output result of Embodiment 1 of the present invention. Figure 1 ;

[0063] Figure 4 This is a schematic diagram of the final output result of Embodiment 1 of the present invention. Figure 2 ;

[0064] Figure 5 This is a system block diagram of an automatic peak EQ adjustment according to the present invention. Detailed Implementation

[0065] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.

[0066] Existing methods for manually adjusting peak EQ are cumbersome and computationally inefficient, while automatic adjustment of FIR filter coefficients based on the target frequency response curve is unsuitable for automatic peak EQ adjustment and is inconvenient for secondary adjustments. This invention presents a method and system for automatically adjusting peak EQ. Automation is achieved through software algorithms, automatically extracting the peak position, gain, and peak width from the target frequency response curve to obtain the peak EQ's frequency, gain, and Q value, thus avoiding the significant time and effort required for manual adjustment. Since all parameters of the peak EQ can be adjusted through a graphical interface, users can further fine-tune the parameters. As an IIR design method, peak EQ design avoids the tediousness of phase response design, boasts high computational efficiency, and in principle can meet users' needs for various frequency responses.

[0067] This invention allows users to directly obtain the parameters of the peak EQ output by inputting their designed target frequency response curve or specifying the frequency response at certain frequency points. Since the peak EQ is used as the design object, the design difficulties caused by complex phase design are avoided. This invention creatively uses a peak / valley search method and initializes a series of peak EQs using their height and width, significantly reducing the computation time for EQ adjustment and providing a foundation for subsequent gradient descent convergence methods, avoiding divergence or unreasonable peak EQ parameters caused by the randomness of gradient descent. On the other hand, since the frequency response of the initialized peak EQ is not ideal, this invention proposes a simple method to optimize the initialized peak EQ, namely, updating the peak EQ parameters using the momentum gradient descent method. During the gradient descent update of EQ parameters, each loop needs to calculate the total frequency response of all peak EQs. To reduce the time used in this step, this invention proposes using a parallel FFT method to maximize processor efficiency. To further improve the convergence of this method, the momentum gradient descent method is used instead of traditional gradient descent, and gradient pruning is performed so that the updated EQ parameters do not deviate too much from the initialized EQ parameters, thus preventing divergence or unacceptable parameter values. The output parameters can be intuitively adjusted using a graphical interface, greatly improving the user experience.

[0068] Example 1

[0069] like Figure 1 As shown, the present invention provides a method for automatically adjusting peak EQ, the method comprising:

[0070] S1: Determine the target frequency response curve of the equalizer, and initialize a series of peak EQs using the height and / or width of the peaks and / or valleys in the target frequency response curve, so that the number of peak EQs reaches the maximum value.

[0071] Specifically, the target frequency response curve of the equalizer is determined. Generally, the ideal frequency response of a loudspeaker is relatively flat. The frequency response of the loudspeaker can be measured in an anechoic chamber or a quasi-anechoic environment, and then inverted. The target frequency response is smoothed as needed, and its maximum and minimum values ​​are limited. In this example, the frequency response of the loudspeaker obtained in a quasi-anechoic environment is used as an example. In order to compensate for the bulges and dips in the frequency response, especially in the mid-frequency range of 100Hz-10000Hz, the sign of the frequency response is reversed, and its value range is limited to -6dB to +6dB.

[0072] Design the target frequency response curve of the equalizer according to actual needs, and use linear interpolation to obtain sufficient sampling points for insufficient sampling points.

[0073] Specifically, a series of peak EQs are initialized using the height and / or width of the peaks and / or valleys in the target frequency response curve, including:

[0074] S11, Identify all peaks from the target frequency response curve and determine the center frequency of each peak; including:

[0075] Compare the increasing and decreasing trends to the left and right of each point on the target frequency response curve to determine the position x of all peaks in the target frequency response. Let the actual height of the peak be h. The relative height of the peak should be the actual height minus the reference height. Generally, the reference value is 0dB, so the relative height of the peak is also h.

[0076] S12, Calculate an evaluation height to evaluate the peak width at this height, the evaluation height is h. eval =h-rel h ·pro, where h is the peak height, pro is the peak significance, and rel h The value range is (0,1); peak significance is determined by the difference between the peak height h and a maximum local minimum near the peak.

[0077] S13, determine the curve opening width based on the evaluation height, and define it as the peak width w;

[0078] S14. The product of peak height and peak width (h·w) is used as the size of the peak. The size of the peak is calculated for all the peaks that have been found, and the maximum value is found.

[0079] S15, reverse the sign of the target frequency response curve to obtain the reversed target frequency response curve; find all valleys from the reversed target frequency response curve using the method of finding peaks, determine the center frequency of the valleys, repeat steps S12-S14 to determine the valley depth, valley width, and valley size of all valleys, and find the maximum value of the valley size.

[0080] S16. Compare the largest peak and the deepest valley, and select the larger one as the largest peak / deepest valley.

[0081] S17. Initialize a peak EQ based on the position x of the largest peak / deepest valley, peak height / valley depth h, and peak width / valley width w. The parameters of the peak EQ include frequency, gain, and Q value. The Q value of the peak EQ is calculated using the following formula:

[0082]

[0083] Where w is the logarithmic scale, and x is the position of the largest peak / deepest valley, which is the center frequency of the peak EQ.

[0084] Thus, the system function H(z) with the initialized peak EQ is obtained as follows:

[0085]

[0086]

[0087]

[0088] Where h is the peak height / valley depth, x is the center frequency of the peak / valley, z is the variable on the complex plane, and Q is the Q value of the peak EQ.

[0089] S18, Subtract the frequency response of the initialized peak EQ from the target frequency response curve to obtain the new target frequency response;

[0090] S19. Repeat steps S11-S18 until the number of peak EQs reaches the maximum value.

[0091] To enable the peak EQ to automatically adjust to the ideal state, the frequency response curve of the target should be clearly defined first, and then the more significant peaks or valleys in the target frequency response curve should be identified, and a series of peak EQs should be initialized with their height and width.

[0092] After initializing a series of peak EQ values ​​in step S1, their frequency response (denoted as |H(ω)|, where ω is the frequency) can well match the target curve (denoted as |H... d (ω)|), but this did not achieve the ideal state and requires further processing. Here, a further solution is proposed: first, determine a |H(ω)| and |H... d The error is expressed in the form of (ω)|), and this error is calculated. Then, the parameters of the initialized peak EQ are further optimized using the gradient descent method to make the total frequency response of the peak EQ close to the target frequency response. The steps are shown in S2 to S4, and are as follows:

[0093] S2: Calculate the total frequency response of all peak EQ values ​​and calculate the error between the total frequency response and the target frequency response; the target frequency response is obtained from the target frequency response curve; including:

[0094] First, let the system function of the i-th peak EQ be:

[0095]

[0096] Secondly, the total frequency response of all peak EQs is calculated using a parallel FFT method, including:

[0097] A. Based on the target frequency response curve, take 2N frequency sampling points with equal intervals from 0 to 2π; the first N points can be used as sampling points for the frequency response.

[0098] B, in [b] 0,i b 1,i b 2,i Add 2N-3 zeros after [a] 0,i a 1,i a 2,i After padding with 2N-3 zeros, i = 0, 1, 2, ..., perform parallel FFT on the two zero-padded sequences;

[0099] C, take the modulus and find the quotient of the two: the modulus of the FFT of the numerator coefficients of the system function of each peak EQ divided by the modulus of the FFT of the denominator coefficients of the system function of the peak EQ is the frequency response of each peak EQ at the selected equally spaced frequency points.

[0100] D, multiply the frequency responses of all peak EQs, and you get the frequency response of the peak EQ at 2N sampling points.

[0101] In principle, the calculation only requires comparing the results of the first N sampling points with the target frequency response. The target frequency response curve can be linearly interpolated at these N sampling points beforehand.

[0102] Furthermore, the error L is calculated based on the total frequency response and the target frequency response.

[0103] The above technical solutions utilize parallel FFT more efficiently than calculating peak EQ one by one because parallel computing makes higher processor utilization.

[0104] S3: Based on the error, calculate the gradient of the system function coefficients of the peak EQ, and clip the gradient to obtain the clipped gradient;

[0105] Specifically, calculating the gradient of the system function coefficients of the peak EQ is equivalent to calculating the gradient of the error between the peak EQ frequency response and the target frequency response, which is obviously:

[0106]

[0107] Right now:

[0108]

[0109] Similarly, there are:

[0110]

[0111] In the formula H i =H i (ω) is the system function of the i-th peak EQ, where ω is the frequency, and b m,i and a m,i (m=0,1,2) are constant parameters that determine the linear time-invariant system.

[0112] Let L, c be the error between the peak EQ frequency response and the target frequency response. i ={b 0,i ,b 1,i ,b 2,i ,a 0,i ,a 1,i ,a 2,i The gradient θL / θc can be easily obtained. i :

[0113]

[0114] Among them, H i,k Let be the system function of the i-th peak EQ at the k-th frequency sampling point.

[0115] Because there may be multiple types of target frequency response curves, and sometimes users are more concerned with the frequency response in a certain frequency band, the superposition of gradients at various frequency points can be non-weighted, as follows:

[0116]

[0117] Among them, W k This is the weighting factor.

[0118] Furthermore, the gradient is clipped to limit it to between the maximum and minimum values. This is to avoid excessively large or small gradients that could cause divergence. Gradient clipping is necessary in this case.

[0119] S4: Based on the clipped gradient, update the peak EQ parameters using the momentum gradient descent method until the maximum number of convergence steps is reached or the frequency response error is less than the tolerance. Then check the peak EQ parameters and output the peak EQ parameters; otherwise, return to step S2 to continue execution.

[0120] Specifically, the expression for the momentum gradient descent method is:

[0121]

[0122] c i =c i +v i

[0123] Where ξ determines the magnitude of momentum, μ is the learning rate, and v i Let L be the gradient of the momentum correction, and L be the error.

[0124] The following equation is derived from the system function of the peak EQ. Solving this equation yields the Q value of the peak EQ, Q. i Gain g i and center frequency x i :

[0125] b 0,i -1 = b 2,i +1=α i A i

[0126] b 1,i =a 1,i =-2cosx i

[0127] a 0,i -1 = a 2,i +1=α i / A i

[0128]

[0129]

[0130] Specifically, the parameters of the peak EQ are checked and output, including:

[0131] Check the peak EQ parameters. If the peak EQ parameters are within the preset range, generally g i The preset range is -20dB to +20dB, Q i The preset range is greater than 0.02, x i If the preset range is between 0 and π, then the parameters of the peak EQ will be output.

[0132] If the parameters of the peak EQ are not within the preset range, the parameters of the peak EQ will be trimmed, restricted, or discarded.

[0133] To further illustrate the technical effects achievable by the solution, this example conducts a simulation experiment, and the final output results are as follows: Figure 3 and Figure 4 As shown, Figure 3 The medium-thick dashed line and the thick solid line are the target frequency response curve and the frequency response curve obtained after automatically adjusting the peak EQ, respectively. It can be seen that the two are quite consistent. The dashed line is the frequency response of each peak EQ. Figure 4 The convergence of gradient descent is shown, indicating that this method further optimizes the initialized peak EQ parameters and achieves good convergence. A summary is as follows:

[0134] Figure 3 The thick dashed line represents the target response curve obtained by inverting the frequency response of the loudspeaker. In order to limit the gain range of the filter, the target response curve has been limited to between -6dB and +6dB.

[0135] The peak EQ was initialized according to the method of the present invention and the peak EQ parameters were further optimized using the gradient descent method to obtain the final frequency response curve as shown by the thick solid line in the figure above. It can be seen that the two basically overlap in the mid-frequency range of 100Hz-10000Hz, indicating that the automatically adjusted EQ parameters can better meet the designed target response.

[0136] Figure 3 Each dotted line in the diagram corresponds to the frequency response of each peak EQ.

[0137] Figure 4 This figure illustrates the convergence of gradient descent, specifically the variation of the error L between the peak EQ frequency response and the target frequency response as a function of the number of iterations. It highlights the effectiveness of the method used in this invention, as shown below:

[0138] A, where the number of iterations is close to 0, represents the error between the initial peak EQ frequency response and the target frequency response. It can be seen that this error is not much different from the final error, indicating that the initialization method effectively makes the peak EQ frequency response approximate the target frequency response, which greatly reduces the number of iterations required for gradient descent and improves computational efficiency.

[0139] B. The number of iterations used in the method of this invention is not large, and after the gradient descent begins, the error between the peak EQ frequency response and the target frequency response is effectively reduced, indicating that the gradient descent method effectively further optimizes the parameters of the peak EQ, and the gradient processing method used makes the error converge quickly.

[0140] It is evident that the method of the present invention further optimizes the initialized peak EQ parameters and can converge well.

[0141] The peak EQ parameter output results in this embodiment are as follows:

[0142]

[0143]

[0144] In this embodiment, the maximum number of peak EQ values ​​is set to 10, and the method of this invention returns the parameters of 10 peak EQ values. It can be seen that the parameters of each peak EQ value are within a reasonable range, indicating that the gradient processing method used in this invention effectively avoids the occurrence of peak EQ parameters that do not meet the requirements. Furthermore, this embodiment demonstrates that using this method to adjust the peak EQ parameters to make its frequency response approximate the designed target frequency response is effective and feasible.

[0145] Example 2

[0146] like Figure 5 As shown, the difference between this embodiment and Embodiment 1 is that this embodiment provides an automatic peak EQ adjustment system, which includes:

[0147] The initialization unit is used to determine the target frequency response curve of the equalizer and initializes a series of peak EQs using the height and / or width of the peaks and / or valleys in the target frequency response curve, so that the number of peak EQs reaches the maximum value.

[0148] Total frequency response calculation unit, used to calculate the total frequency response of all peak EQs;

[0149] The error calculation unit is used to calculate the error based on the total frequency response and the target frequency response; the target frequency response is obtained from the target frequency response curve.

[0150] The gradient calculation unit is used to calculate the gradient of the system function coefficients with peak EQ based on the error.

[0151] The clipping unit is used to clip the gradient to obtain the clipped gradient;

[0152] The parameter update unit is used to update the parameters of the peak EQ using the momentum gradient descent method based on the clipped gradient, until the maximum number of convergence steps is reached or the error is less than the tolerance; and to check the parameters of the peak EQ and output the parameters of the peak EQ; otherwise, it returns to the total frequency response calculation unit to continue execution.

[0153] The execution process of each unit can be carried out according to the method flow steps of automatically adjusting peak EQ in Embodiment 1, and will not be described in detail in this embodiment.

[0154] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for automatically adjusting peak EQ, characterized in that, The method includes: S1: Determine the target frequency response curve of the equalizer, and initialize a series of peak EQs using the height and / or width of the peaks and / or valleys in the target frequency response curve; S2: Calculate the total frequency response of all peak EQs, and calculate the error between the total frequency response and the target frequency response; the target frequency response is obtained from the target frequency response curve. S3: Based on the error, calculate the gradient of the system function coefficients of the peak EQ, and trim the gradient to obtain the trimmed gradient; S4: Based on the clipped gradient, update the parameters of the peak EQ using the momentum gradient descent method until the maximum number of convergence steps is reached, and check the parameters of the peak EQ and output the parameters of the peak EQ; otherwise, return to step S2 to continue execution. Step S1 initializes a series of peak EQs using the height and / or width of the peaks and / or valleys in the target frequency response curve, including: S11, Identify all peaks from the target frequency response curve and determine the center frequency of the peaks; S12, Calculate the evaluation height based on the identified peaks and their significance; peak significance is determined using peak height. Determined by the difference from a maximum locality near the peak; S13, Determine the curve opening width at the evaluation height, and define it as the peak width; S14: The product of peak height and peak width is used as the size of the peak. Calculate the size of all the peaks that have been found and find the maximum value. S15, reverse the sign of the target frequency response curve to obtain the reversed target frequency response curve; find all valleys from the reversed target frequency response curve, determine the center frequency of the valley, repeat steps S12-S14 to determine the valley depth, valley width, and valley size of all valleys, and find the maximum value of the valley size. S16. Compare the largest peak and the deepest valley, and select the larger one as the largest peak / deepest valley. S17. Initialize the parameters of the peak EQ with the peak height / valley depth and peak width / valley width of the largest peak / deepest valley to obtain the frequency response of the initialized peak EQ. S18, Subtract the frequency response of the initialized peak EQ from the target frequency response curve to obtain the new target frequency response; S19. Repeat steps S11-S18 until the number of peak EQs reaches the maximum value.

2. The method for automatically adjusting peak EQ according to claim 1, characterized in that, The parameters of the peak EQ in step S17 include frequency, gain, and Q value.

3. The method for automatically adjusting peak EQ according to claim 1, characterized in that, The system function of the initialized peak EQ for: ; ; ; in, For high peaks / deep valleys, The center frequency of the peak / valley For variables on the complex plane, This is the Q value of the peak EQ.

4. The method for automatically adjusting peak EQ according to claim 1, characterized in that, Step S2 uses a parallel FFT method to calculate the total frequency response of all peak EQs, including: A. Based on the target frequency response curve, take frequency sampling points at equal intervals from 0 to 2π; B, pad the numerator and denominator coefficients of the system function for each peak EQ with zeros, and then perform parallel FFT on the two zero-padded sequences; C, the FFT modulus of the numerator coefficients of the system function of each peak EQ divided by the FFT modulus of the denominator coefficients of the system function of the peak EQ, is the frequency response of each peak EQ at the selected equally spaced frequency points. D, multiplying the frequency responses of all peak EQs gives the total frequency response of the multiple peak EQs.

5. The method for automatically adjusting peak EQ according to claim 1, characterized in that, The formula for calculating the gradient in step S3 is: ; ; in, For error, For the i-th peak EQ at the k-th frequency sampling point System functions; ; in, and These are the constant parameters that determine this linear time-invariant system. .

6. The method for automatically adjusting peak EQ according to claim 5, characterized in that, The expression for the momentum gradient descent method is: ; ; in, Determines the magnitude of momentum. It is the learning rate. To drive the gradient of the correction, This is the error.

7. The method for automatically adjusting peak EQ according to claim 1, characterized in that, In step 3, the gradient is clipped to limit it to between the maximum and minimum values.

8. The method for automatically adjusting peak EQ according to claim 1, characterized in that, Step S4 involves checking and outputting the parameters of the peak EQ, including: Check the parameters of the peak EQ. If the parameters of the peak EQ are within a preset range, output the parameters of the peak EQ. If the parameters of the peak EQ are not within the preset range, the parameters of the peak EQ will be pruned, restricted, or discarded.

9. A system for automatically adjusting peak EQ, characterized in that, The system includes: An initialization unit is used to determine the target frequency response curve of the equalizer and initialize a series of peak EQs using the height and / or width of the peaks and / or valleys in the target frequency response curve, so that the number of peak EQs reaches the maximum value. Total frequency response calculation unit, used to calculate the total frequency response of all peak EQs; An error calculation unit is used to calculate the error based on the total frequency response and the target frequency response; the target frequency response is obtained based on the target frequency response curve. The gradient calculation unit is used to calculate the gradient of the system function coefficients of the peak EQ based on the error. A clipping unit is used to clip the gradient to obtain the clipped gradient; The parameter update unit is used to update the parameters of the peak EQ using the momentum gradient descent method based on the clipped gradient until the maximum number of convergence steps is reached; and to check the parameters of the peak EQ and output the parameters of the peak EQ; otherwise, it returns to the total frequency response calculation unit to continue execution. The initialization unit initializes a series of peak EQs using the height and / or width of the peaks and / or valleys in the target frequency response curve, including: S11, Identify all peaks from the target frequency response curve and determine the center frequency of the peaks; S12, Calculate the evaluation height based on the identified peaks and their significance; peak significance is determined using peak height. Determined by the difference from a maximum locality near the peak; S13, Determine the curve opening width at the evaluation height, and define it as the peak width; S14: The product of peak height and peak width is used as the size of the peak. Calculate the size of all the peaks that have been found and find the maximum value. S15, reverse the sign of the target frequency response curve to obtain the reversed target frequency response curve; find all valleys from the reversed target frequency response curve, determine the center frequency of the valley, repeat steps S12-S14 to determine the valley depth, valley width, and valley size of all valleys, and find the maximum value of the valley size. S16. Compare the largest peak and the deepest valley, and select the larger one as the largest peak / deepest valley. S17. Initialize the parameters of the peak EQ with the peak height / valley depth and peak width / valley width of the largest peak / deepest valley to obtain the frequency response of the initialized peak EQ. S18, Subtract the frequency response of the initialized peak EQ from the target frequency response curve to obtain the new target frequency response; S19. Repeat steps S11-S18 until the number of peak EQs reaches the maximum value.

Citation Information

Patent Citations

  • Coherent light communication system optical signal-to-noise ratio monitoring method based on momentum gradient descent method

    CN110730037A

  • Wire and cable defect detection method and system based on computer vision

    CN114757949A