Multi-mode filter parameter debugging method and device, equipment and storage medium

By designing differentiated optimization strategies and intelligent early-stop mechanisms for FF, FB, and EQ filter modes, the problems of low efficiency and unstable accuracy in multi-mode filter parameter tuning are solved, achieving efficient and accurate filter parameter optimization.

CN121908182AActive Publication Date: 2026-04-21HUAQIN TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUAQIN TECH CO LTD
Filing Date
2026-03-24
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing technologies suffer from low efficiency in parameter tuning, unstable accuracy, and low resource utilization in multi-mode filters, especially in large-scale production.

Method used

A differentiated optimization strategy is adopted, with different optimization objectives and initialization strategies designed for three filter modes: FF, FB, and EQ. Combined with the stochastic gradient descent algorithm and intelligent early stopping mechanism, the filter parameters are optimized until the preset convergence conditions are met.

Benefits of technology

It significantly improves debugging efficiency, enhances product consistency and resource utilization, reduces resource waste caused by invalid calculations, and ensures efficient and accurate debugging of filter parameters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121908182A_ABST
    Figure CN121908182A_ABST
Patent Text Reader

Abstract

The invention provides a multi-mode filter parameter debugging method and device, equipment and a storage medium, and relates to the technical field of audio signal processing. The method comprises the following steps: acquiring target response data, and determining a target filter mode; performing iterative optimization on the to-be-optimized filter parameter group by adopting a differential optimization strategy corresponding to the target filter mode until a corresponding convergence condition is met; the differential optimization strategy comprises the following steps: when a target filter mode is an FF mode, taking reduction of an amplitude error and a phase error as an optimization target; when the target filter mode is an FB mode, taking improvement of the noise reduction depth and meeting of preset stability constraints as optimization targets; when the target filter mode is an EQ mode, taking reduction of an amplitude error as an optimization target; and outputting the optimized filter parameter group as a debugging result. According to the application, by introducing a differentiated optimization strategy and an early stop mechanism, the debugging efficiency is remarkably improved and the resource consumption is reduced on the premise of ensuring the precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of audio signal processing technology, and in particular to a method, apparatus, device and storage medium for adjusting parameters of a multi-mode filter. Background Technology

[0002] With the widespread application of Active Noise Control (ANC) and digital signal processing technologies in audio equipment, modern audio products (such as headphones, hearing aids, and car audio systems) typically integrate multiple types of filters to achieve complex signal processing functions. A typical multi-mode filter system includes feed-forward (FF) filters, feedback (FB) filters, and equalization (EQ) filters. These filters work together to determine the noise reduction depth, system stability, and audio playback quality of the device. However, as product integration increases and production scales expand, achieving efficient and precise design optimization of filter parameters while ensuring performance has become a significant challenge for the industry.

[0003] In related technologies, a fixed-step traversal search strategy is typically used to tune multi-mode filter parameters. Taking active noise control (ANC) tuning in headphones as an example, the tuning system first measures the primary path response and the secondary path response of the speaker unit using acoustic testing equipment. Then, for a preset filter structure, such as a cascaded second-order infinite impulse response (IIR) filter, it performs a point-by-point scan in the parameter space to calculate the error between the frequency response curve and the target curve under different parameter combinations, and finally selects the parameter set with the smallest error as the output. However, in actual production line applications, multi-mode filter parameter tuning suffers from low efficiency, unstable accuracy, and low resource utilization. Summary of the Invention

[0004] This application provides a method, apparatus, device, and storage medium for adjusting the parameters of a multi-mode filter, in order to improve the problems of low efficiency, unstable accuracy, and low resource utilization in the adjustment of multi-mode filter parameters in related technologies.

[0005] Firstly, this application provides a method for tuning the parameters of a multi-mode filter, including:

[0006] Acquire target response data and determine the target filter mode corresponding to the current debugging scenario based on the target response data. The target filter mode includes one of FF mode, FB mode or EQ mode.

[0007] Based on the target filter mode, a differentiated optimization strategy corresponding to the target filter mode is adopted to iteratively optimize the current filter parameter set to be optimized until the preset convergence condition corresponding to the target filter mode is met. The differentiated optimization strategy includes: when the target filter mode is FF mode, the optimization objective is to reduce both amplitude error and phase error; when the target filter mode is FB mode, the optimization objective is to simultaneously improve the noise reduction depth and meet the preset stability constraints; when the target filter mode is EQ mode, the optimization objective is to reduce amplitude error.

[0008] The optimized filter parameter set is output as the debugging result.

[0009] In one possible implementation, based on the target filter mode, a differentiated optimization strategy corresponding to the target filter mode is adopted to iteratively optimize the current filter parameter set to be optimized, including: determining a target initialization strategy from a variety of preset parameter initialization strategies according to the target filter mode, and initializing the current filter parameter set to be optimized according to the target initialization strategy to obtain the initialized filter parameter set; determining the current actual frequency response based on the initialized filter parameter set, and determining the loss value between the current actual frequency response and the target response data according to a preset loss function corresponding to the target filter mode; and updating the initialized filter parameter set using the stochastic gradient descent (SGD) algorithm based on the loss value.

[0010] In one possible implementation, the filter parameter set includes overall gain, center frequency, filter gain, and quality factor. Based on the target filter mode, a target initialization strategy is determined from a set of preset parameter initialization strategies. This includes: when the target filter mode is FF mode, determining the target initialization strategy as a first initialization strategy, the first initialization strategy including: initializing the overall gain based on the average and peak values ​​of the target response data; uniformly sampling in the logarithmic frequency space to initialize the center frequency; initializing the filter gain of each filter based on the amplitude of the target response data at the center frequency; and dynamically initializing the quality factor based on the local amplitude slope of the target response data; when the target filter mode is FB mode, determining the target initialization strategy... The second initialization strategy includes: initializing the overall gain with random values ​​within a preset numerical range; initializing the center frequency by sampling at equal intervals within a preset frequency band; limiting the filter gain of each filter within a preset gain range; and limiting the quality factor within a preset quality factor range. When the target filter mode is EQ mode, the target initialization strategy is determined to be the third initialization strategy, which includes: initializing the overall gain to a preset fixed value; initializing the center frequency by sampling uniformly within the logarithmic frequency space; initializing the filter gain of each filter according to the amplitude of the target response data at the center frequency; and dynamically initializing the quality factor according to the local amplitude slope of the target response data.

[0011] In one possible implementation, the initialized filter parameter set is updated using a stochastic gradient descent algorithm based on the loss value, including: determining the gradient of the loss value with respect to each filter parameter in the initialized filter parameter set using numerical difference; updating each filter parameter using the Adam (Adaptive Moment Estimation) optimizer combined with a dynamic learning rate based on the gradient of each filter parameter; and performing amplitude limiting on the updated filter parameters according to the parameter constraints corresponding to the target filter mode.

[0012] In one possible implementation, the gradient of the loss value with respect to each filter parameter in the initialized filter parameter set is determined using the numerical difference method, including: when the target filter mode is FF mode, the gradient of the loss value with respect to each filter parameter in the initialized filter parameter set is determined using the forward difference method; when the target filter mode is FB mode or EQ mode, the gradient of the loss value with respect to each filter parameter in the initialized filter parameter set is determined using the central difference method.

[0013] In one possible implementation, when the target filter mode is FF mode, the preset convergence conditions include accuracy attainment conditions and continuous no-improvement conditions. Iterative optimization includes: after each iteration, if the amplitude error between the current actual frequency response and the target response data meets the preset amplitude accuracy requirements and the phase error meets the preset phase accuracy requirements, then the accuracy attainment conditions are met, the iteration is stopped, and the current filter parameter set is output as the debugging result; if the amplitude accuracy requirements and phase accuracy requirements are not met simultaneously, and the difference between the current loss value and the historical best loss value is less than the preset loss reduction threshold in a preset number of consecutive iterations, then the continuous no-improvement conditions are met, the iteration is stopped, and the filter parameter set corresponding to the historical best loss value is output as the debugging result.

[0014] In one possible implementation, when the target filter mode is FB mode, the preset convergence conditions include a depth stability attainment condition and a stability adjustment exceeding condition. The iterative optimization includes: after each iteration, if the current closed-loop noise reduction depth reaches the preset target noise reduction depth and the open-loop response meets the preset stability requirements, then the depth stability attainment condition is met, the iteration is stopped, and the current filter parameter set is output as the debugging result; if the open-loop response does not meet the stability requirements, the gain of the responsible filter causing instability is adjusted and the number of adjustments is recorded. If the number of adjustments reaches a preset threshold and the open-loop response still does not meet the stability requirements, then the stability adjustment exceeding condition is met, the iteration is stopped, and the most stable filter parameter set recorded during the adjustment process is output as the debugging result.

[0015] In one possible implementation, when the target filter mode is EQ mode, the preset convergence conditions include amplitude compliance conditions and error stability conditions. The iterative optimization includes: after each iteration, if the average amplitude error between the current actual frequency response and the target response data in the entire frequency band is less than a preset amplitude error threshold, then the amplitude compliance condition is met, the iteration stops, and the current filter parameter set is output as the debugging result; if the average amplitude error is not less than the amplitude error threshold, and the absolute value of the fitting slope of the loss value sequence within the preset sliding window is less than a preset rate of change threshold, then the error stability condition is met, the iteration stops, and the filter parameter set with the smallest loss value within the sliding window is output as the debugging result.

[0016] Secondly, this application provides a multi-mode filter parameter tuning device, comprising:

[0017] The acquisition module is used to acquire target response data and determine the target filter mode corresponding to the current debugging scenario based on the target response data. The target filter mode includes one of feedforward FF mode, feedback FB mode or equalizer EQ mode.

[0018] The filter parameter tuning module is used to iteratively optimize the current filter parameter set according to the target filter mode, using a differentiated optimization strategy corresponding to the target filter mode, until the preset convergence condition corresponding to the target filter mode is met. The differentiated optimization strategies include: when the target filter mode is FF mode, the optimization objective is to simultaneously reduce amplitude error and phase error; when the target filter mode is FB mode, the optimization objective is to simultaneously improve the noise reduction depth and meet preset stability constraints; when the target filter mode is EQ mode, the optimization objective is to reduce amplitude error.

[0019] The output module is used to output the optimized filter parameter set as the debugging result.

[0020] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0021] Memory is used to store instructions executed by the computer;

[0022] A processor is used to execute computer-executable instructions stored in memory to implement the multi-mode filter parameter tuning method of any of the first aspects.

[0023] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed, are used to implement the multi-mode filter parameter tuning method of any one of the first aspects.

[0024] Fifthly, this application provides a computer program product, including a computer program that, when executed, implements the multi-mode filter parameter tuning method of any one of the first aspects.

[0025] The multi-mode filter parameter tuning method, apparatus, device, and storage medium provided in this application

[0026] Acquire target response data and determine the target filter mode corresponding to the current debugging scenario based on the target response data. The target filter mode includes one of FF mode, FB mode, or EQ mode. According to the target filter mode, adopt a differentiated optimization strategy corresponding to the target filter mode to iteratively optimize the current filter parameter set to be optimized until the preset convergence condition corresponding to the target filter mode is met. The differentiated optimization strategy includes: when the target filter mode is FF mode, the optimization goal is to reduce both amplitude error and phase error simultaneously; when the target filter mode is FB mode, the optimization goal is to improve the noise reduction depth and meet the preset stability constraints simultaneously; when the target filter mode is EQ mode, the optimization goal is to reduce amplitude error. The optimized filter parameter set is output as the debugging result.

[0027] In this process, differentiated optimization strategies were designed based on the physical characteristics and optimization requirements of different filter modes, effectively improving the problems of low efficiency, unstable accuracy, and low resource utilization inherent in traditional traversal debugging schemes. Specifically, for the FF mode, by simultaneously optimizing amplitude and phase errors, accurate fitting of the complex frequency response was ensured within the core noise reduction frequency band, significantly shortening debugging time and improving debugging efficiency while maintaining noise reduction effect. For the FB mode, by adopting a strategy of synergistic optimization of noise reduction depth and system stability, the closed-loop noise reduction performance was improved while meeting stability requirements, effectively reducing performance fluctuations caused by improper parameters, significantly improving product consistency, and effectively improving the problem of unstable accuracy. For the balanced EQ mode, by actively ignoring the phase response and focusing on minimizing the amplitude error, the computational load was reduced while maintaining fitting accuracy, accelerating the production line calibration cycle and significantly improving resource utilization. In addition, by introducing an intelligent early stop mechanism, iteration is automatically terminated when the preset convergence condition corresponding to the target filter mode is reached, significantly reducing resource waste caused by invalid calculations and further improving debugging efficiency and resource utilization. Attached Figure Description

[0028] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0029] Figure 1 A flowchart illustrating a multi-mode filter parameter tuning method provided as an exemplary embodiment of this application;

[0030] Figure 2 Another flowchart illustrating the multi-mode filter parameter tuning method provided for an exemplary embodiment of this application;

[0031] Figure 3 Another flowchart illustrating a multi-mode filter parameter tuning method provided for an exemplary embodiment of this application;

[0032] Figure 4 A schematic diagram of the fitting result of the FF filter provided for an exemplary embodiment of this application;

[0033] Figure 5 A schematic diagram of the FB filter fitting results provided for an exemplary embodiment of this application;

[0034] Figure 6 A schematic diagram of EQ filter fitting results provided for an exemplary embodiment of this application;

[0035] Figure 7 A schematic diagram of a multi-mode filter parameter tuning device provided as an exemplary embodiment of this application;

[0036] Figure 8 A schematic diagram of the structure of an electronic device provided as an exemplary embodiment of this application.

[0037] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0038] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0039] The terms “first,” “second,” etc., used in the specification and claims of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, products, or apparatus.

[0040] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0041] In related technologies, when using a fixed-step traversal search strategy to debug multi-mode filter parameters, a significant amount of time is required for parameter scanning, severely impacting debugging efficiency. This is especially true in mass production scenarios, where every additional second of debugging time significantly increases production costs. For FB filters, the lack of targeted modeling of speaker unit characteristics makes parameter debugging prone to getting stuck in local optima, leading to insufficient noise reduction depth or an uneven frequency response curve. The noise reduction performance of the same batch of products may fluctuate considerably, increasing quality control difficulty and after-sales risks. For EQ filters, calibration forces simultaneous optimization of amplitude and phase response, while actual product use only requires adjusting gain characteristics. This over-design not only prolongs calibration time but also increases the performance requirements of testing equipment. Furthermore, the lack of intelligent calibration termination judgment means that existing debugging systems often continue ineffective debugging even when parameters have met standards, further reducing production line throughput. These problems are particularly prominent in the pursuit of high efficiency and low cost in large-scale production.

[0042] To address the aforementioned issues, this application provides a multi-mode filter parameter tuning scheme. By constructing a multi-mode filter parameter optimization framework, differentiated optimization strategies are designed for the characteristic requirements of different filter modes. At the same time, an intelligent early-stop mechanism is introduced, thereby significantly improving tuning efficiency and reducing resource consumption while ensuring accuracy.

[0043] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0044] Figure 1 This is a flowchart illustrating a multi-mode filter parameter tuning method provided for an exemplary embodiment of this application. Figure 1 As shown, the multi-mode filter parameter tuning method includes the following steps:

[0045] S101. Obtain target response data and determine the target filter mode corresponding to the current debugging scenario based on the target response data. The target filter mode includes one of FF mode, FB mode or EQ mode.

[0046] For example, target response data is obtained by measuring with acoustic testing equipment or by reading pre-stored target response data from memory. This target response data is baseline data determined based on current debugging requirements and is used to measure the effectiveness of filter optimization; and different types of filter modes correspond to different types of target response data: for FF mode, the target response data is complex frequency response data containing amplitude and phase information; for FB mode, the target response data contains at least the secondary path response; for EQ mode, the target response data is amplitude-frequency response data containing only amplitude information.

[0047] Accordingly, the target filter mode is determined based on the current debugging scenario, either simultaneously with or after acquiring the target response data. This mode can be determined manually by the user, such as selecting the filter type to be debugged through the debugging software interface; or it can be automatically identified based on the type of target response data. For example, when the target response data contains both amplitude and phase information, the current scenario can be automatically determined to be FF mode; when the target response data contains secondary path responses, the current scenario can be automatically determined to be FB mode; and when the target response data only contains amplitude information, the current scenario can be automatically determined to be EQ mode.

[0048] S102. Based on the target filter mode, adopt a differentiated optimization strategy corresponding to the target filter mode to iteratively optimize the current filter parameter set to be optimized until the preset convergence condition corresponding to the target filter mode is met; wherein, the differentiated optimization strategy includes: when the target filter mode is FF mode, the optimization objective is to reduce both amplitude error and phase error simultaneously; when the target filter mode is FB mode, the optimization objective is to simultaneously improve the noise reduction depth and meet the preset stability constraints; when the target filter mode is EQ mode, the optimization objective is to reduce amplitude error.

[0049] For example, after determining the target filter mode, a differentiated optimization strategy corresponding to that filter mode is used to iteratively optimize the current set of filter parameters to be optimized. This current set of filter parameters to be optimized is a set of parameters describing the filter characteristics, which together determine the filter's frequency response. Correspondingly, the goal of iterative optimization is to continuously adjust the filter parameter set until the difference between the actual frequency response and the target response data meets preset requirements.

[0050] Specifically, when the target filter mode is FF mode, the optimization objective is to simultaneously reduce amplitude error and phase error. Here, amplitude error refers to the deviation between the actual frequency response amplitude and the target amplitude, and phase error refers to the deviation between the actual frequency response phase and the target phase. Since feedforward noise reduction relies on generating an inverse sound wave with the same amplitude and opposite phase as the noise, both amplitude accuracy and phase consistency must be ensured simultaneously to achieve effective noise cancellation. Based on this optimization objective, the iterative optimization process will drive the filter parameters to adjust in the direction that reduces both amplitude error and phase error simultaneously. When the target filter mode is FB mode, the optimization objective is to simultaneously improve the noise reduction depth and meet preset stability constraints. Noise reduction depth refers to the attenuation of the closed-loop response within the core noise reduction frequency band, while stability constraints require the open-loop response to satisfy the Nyquist criterion to reduce system oscillations caused by excessive gain at phase crossover points. Since feedback noise reduction is a closed-loop control system, simply pursuing noise reduction depth may lead to system instability; therefore, system stability must be ensured while improving noise reduction performance. Based on this optimization objective, the iterative optimization process will drive the filter parameters to adjust towards improving noise reduction depth under the supervision of stability constraints. When the target filter mode is EQ mode, the optimization objective is to reduce amplitude error, and phase error is ignored during the optimization process. Since the human ear is not sensitive to phase changes of audio devices within the audible range, equalization calibration only needs to ensure that the gain at each frequency point conforms to the target curve, without considering phase matching. Based on this optimization objective, the iterative optimization process will drive the filter parameters to adjust towards reducing amplitude error, while actively ignoring phase information to reduce computational load.

[0051] Furthermore, during the iterative optimization process, after each update, it is necessary to determine whether the current parameter set satisfies the preset convergence condition corresponding to the target filter mode. This preset convergence condition is the criterion used to determine whether the optimization process should terminate. Different filter modes correspond to different combinations of convergence conditions. When any preset convergence condition is met, the iterative optimization process terminates, and the resulting filter parameter set is the result that satisfies the optimization objective of that mode. Through the above differentiated optimization strategy, different filter modes can be iteratively adjusted under the guidance of their respective optimization objectives, ultimately obtaining a filter parameter set that matches the target response.

[0052] S103. Output the optimized filter parameter set as the debugging result.

[0053] For example, after the iterative optimization terminates, the current optimal filter parameter set is output as the debugging result. This debugging result is the optimized filter parameters, which can be directly used for configuring actual products. Depending on the termination scenario, the output parameter set may correspond to different parameter states: for example, when termination occurs due to accuracy meeting the target, the output is the parameter set of the current iteration; when termination occurs due to continuous lack of improvement or stability adjustment exceeding limits, the output is the best or most stable parameter set from historical records. These parameter sets enable the actual frequency response to be as close as possible to the target response while meeting engineering requirements, thereby achieving efficient and accurate filter debugging.

[0054] The multi-mode filter parameter tuning method provided in this application effectively improves the problems of low efficiency, unstable accuracy, and low resource utilization of traditional traversal tuning schemes by designing differentiated optimization strategies based on the physical characteristics and optimization requirements of different filter modes. Specifically, for FF mode, by simultaneously optimizing amplitude error and phase error, accurate fitting of complex frequency response is ensured within the core noise reduction frequency band, significantly shortening tuning time and improving tuning efficiency while maintaining noise reduction effect. For FB mode, by adopting a strategy of co-optimizing noise reduction depth and system stability, closed-loop noise reduction performance is improved while meeting stability requirements, effectively reducing performance fluctuations caused by improper parameters, significantly improving product consistency, and effectively improving the problem of unstable accuracy. For balanced EQ mode, by actively ignoring phase response and focusing on minimizing amplitude error, the computational load is reduced while maintaining fitting accuracy, accelerating production line calibration cycle and significantly improving resource utilization. In addition, by introducing an intelligent early stop mechanism, iteration is automatically terminated when the preset convergence condition corresponding to the target filter mode is reached, significantly reducing resource waste caused by invalid calculations and further improving tuning efficiency and resource utilization.

[0055] In some embodiments, based on the target filter mode, a differentiated optimization strategy corresponding to the target filter mode is adopted to iteratively optimize the current filter parameter set to be optimized. This includes: determining a target initialization strategy from a variety of preset parameter initialization strategies based on the target filter mode, and initializing the current filter parameter set to be optimized according to the target initialization strategy to obtain an initialized filter parameter set; determining the current actual frequency response based on the initialized filter parameter set, and determining the loss value between the current actual frequency response and the target response data according to a preset loss function corresponding to the target filter mode; and updating the initialized filter parameter set using a stochastic gradient descent algorithm based on the loss value.

[0056] Stochastic gradient descent (SDD) is an iterative optimization algorithm used to find optimal parameters by minimizing a loss function. It is one of the core algorithms in machine learning and deep learning. For example, iterative optimization consists of three core stages: initialization, loss calculation, and parameter update. Specifically, in the initialization stage, a matching initialization strategy is selected based on the target filter mode to assign initial values ​​to the filter parameter set. The purpose of initialization is to make the starting parameters as close as possible to the optimal solution, thereby reducing the number of subsequent iterations and accelerating convergence. Secondly, in the loss calculation stage, the actual frequency response (i.e., filter frequency response) is calculated based on the current filter parameter set, and the difference between the actual frequency response and the target response data is quantified using the loss function corresponding to the target filter mode to obtain the loss value. This loss value is an indicator of the quality of the current parameter set and the basis for subsequent parameter updates. Finally, in the parameter update stage, the filter parameter set is adjusted using the stochastic gradient descent algorithm based on the loss value, gradually reducing the loss value and driving the actual frequency response closer to the target response. These three stages are executed cyclically until the preset convergence condition is met, thus completing the iterative optimization process.

[0057] In the loss calculation stage, the actual frequency response of the current filter parameter set needs to be calculated, and the difference between the actual frequency response and the target response data is quantified using the loss function corresponding to the target filter mode to obtain the loss value. The total frequency response of the filter bank is obtained by cascading multiple second-order IIR filters. The frequency response of each second-order filter can be calculated from its coefficients, which can be obtained by bilinear Z-transform from filter parameters (such as center frequency, gain, quality factor, etc.). The frequency response expression of a single second-order filter is:

[0058]

[0059] in, , , , and These are the coefficients of the filter; The angular frequency is denoted as ω; after multiple second-order filters are cascaded, the total frequency response is the product of the frequency responses of each cascaded filter.

[0060] Accordingly, the loss function is used to quantify the difference between the current actual frequency response and the target response data. Different filter modes employ different forms of loss functions to reflect their differentiated optimization objectives. For the FF mode, considering that the FF mode needs to simultaneously consider amplitude accuracy and phase consistency, its loss function is a weighted combination of amplitude loss terms and phase loss terms, specifically satisfying the following formula:

[0061]

[0062] in, This represents the loss value for FF mode; This is the amplitude error weight, used to balance the importance of amplitude and phase in the optimization process; The amplitude loss term, used to quantify the amplitude error between the actual frequency response and the target response data, satisfies the following formula:

[0063]

[0064] Among them, The total number of frequency points, For the first A frequency point calc and A tar It is frequency The fitted amplitude and the target amplitude, Frequency weights for corresponding frequency points; phase loss term The phase error used to quantify the actual frequency response and the target response data specifically satisfies the following formula:

[0065]

[0066] in, and It is frequency The fitted phase and the target phase, It is the phase weight.

[0067] For the FB mode, it is necessary to simultaneously improve the noise reduction depth and meet stability constraints. Its loss function consists of a depth loss term and a stability loss term, which specifically satisfy the following formula:

[0068]

[0069] in, This represents the loss value for the FB (Fast-Fast) mode. The depth loss term quantifies the difference between the current closed-loop denoising depth and the target denoising depth, and specifically satisfies the following formula:

[0070]

[0071] in, Core noise reduction frequency band Corresponding angular frequency, and They are The average closed-loop depth of the target curve and the fitted curve within the interval; this loss term only produces a positive value when the current depth is lower than the target depth, driving the parameters to adjust in the direction of increasing the noise reduction depth. Stability loss term. Based on the Nyquist criterion, this is used to penalize unstable system states when the open-loop response has a phase crossover point (i.e., ...). And the open-loop gain at that frequency point If the system is deemed unstable, a corresponding penalty term is applied, and the driving parameters are adjusted in a direction that meets the stability requirements.

[0072] For EQ mode, considering that EQ mode only needs to focus on amplitude error, its loss function is composed of a weighted combination of amplitude errors of each frequency band, and phase information is actively ignored during the optimization process:

[0073]

[0074] in, This represents the loss value for the EQ mode. The number of frequency bands to be divided, For the first Mean square amplitude error within each frequency band For the first The weighting coefficients for each frequency band error. By adjusting the weighting coefficients for each frequency band, targeted optimization can be achieved for different frequency regions to meet the accuracy requirements of equalization calibration.

[0075] In this embodiment, a pattern-matching initialization strategy ensures that the starting point of the parameters is close to the optimal solution, which helps reduce invalid iterations and accelerate convergence. Through differentiated loss functions, different filter modes can quantify the difference between the current parameter set and the target response data under their respective optimization objectives, providing accurate gradient directions for subsequent parameter updates and driving the actual frequency response to approach the target response. The stochastic gradient descent algorithm drives parameter updates in the direction of reducing loss, achieving efficient and accurate optimization. This closed loop organically combines initialization, loss calculation, and parameter updates, laying the foundation for rapid convergence and intelligent early stopping, significantly improving the debugging efficiency and optimization quality of multi-mode filter parameters.

[0076] In some embodiments, the filter parameter set includes overall gain, center frequency, filter gain, and quality factor. Based on the target filter mode, a target initialization strategy is determined from a set of preset parameter initialization strategies. This includes: when the target filter mode is FF mode, determining the target initialization strategy as a first initialization strategy, which includes: initializing the overall gain based on the average and peak values ​​of the target response data; uniformly sampling in the logarithmic frequency space to initialize the center frequency; initializing the filter gain of each filter based on the amplitude of the target response data at the center frequency; and dynamically initializing the quality factor based on the local amplitude slope of the target response data; when the target filter mode is FB mode, determining the target initialization strategy as a second initialization strategy... The second initialization strategy includes: initializing the overall gain with random values ​​within a preset numerical range; initializing the center frequency by sampling at equal intervals within a preset frequency band; limiting the filter gain of each filter within a preset gain range; and limiting the quality factor within a preset quality factor range. When the target filter mode is EQ mode, the target initialization strategy is determined to be the third initialization strategy, which includes: initializing the overall gain to a preset fixed value; initializing the center frequency by sampling uniformly within the logarithmic frequency space; initializing the filter gain of each filter according to the amplitude of the target response data at the center frequency; and dynamically initializing the quality factor according to the local amplitude slope of the target response data.

[0077] For example, the filter parameter set includes the overall gain. Center frequency Filter gain and quality factor These variables collectively determine the frequency response characteristics of the filter. Among them, the overall gain... Used to uniformly amplify or attenuate the entire filter bank; center frequency These are the characteristic frequencies corresponding to each filter; filter gain. Used to control the boost or attenuation at each center frequency; quality factor The quality factor determines the sharpness of the filter's frequency response curve; a higher quality factor results in a narrower frequency band for the filter. Accordingly, based on the physical characteristics and optimization requirements of different filter modes, multiple parameter initialization strategies are preset. After determining the target filter mode, a matching target initialization strategy is selected from these preset strategies, allowing the filter parameter set to be optimized from a reasonable starting point, thereby reducing the number of subsequent iterations and accelerating convergence.

[0078] Correspondingly, for the FF mode, the fitting target includes both amplitude and phase, requiring a balance between amplitude accuracy and phase consistency. Based on this, the specific implementation of the first initialization strategy is as follows:

[0079] Overall gain initialization: Overall gain initialization is based on the attenuation characteristics of the target response data and is determined by balancing the average attenuation and peak gain. Specifically, it satisfies the following formula:

[0080]

[0081] in, It is the average decay weight. The average value of the target response data. The peak value of the target response. The clip function limits the calculation result to the maximum gain allowed by the system. Within the specified range, ensure that the overall gain is neither too large nor too small, providing a reasonable starting point for subsequent optimization.

[0082] Center frequency initialization: Center frequency Uniform sampling in the logarithmic frequency space, covering the core optimized frequency band. ]; No. The center frequencies of the filters satisfy the following formula:

[0083]

[0084] in, The number of filters; logarithmic sampling ensures sufficient frequency resolution across the entire optimized frequency band, especially in the low-frequency region, and helps reduce the problem of insufficient low-frequency resolution caused by linear sampling.

[0085] Filter gain initialization: The filter gain of each filter is the target response data at the center frequency. The decibel value at that location is determined based on the target response data at the corresponding center frequency. Initialize the amplitude at point ; the first The filter gain of each filter Satisfy the following formula:

[0086]

[0087] in, For target response data at the center frequency The decibel amplitude at the location; G gain It is the upper limit of the gain of a single filter; the clip function limits the filter gain value to [ Within the specified range, ensure that the initial parameters do not exceed a reasonable range.

[0088] Quality factor initialization: quality factor Dynamic adjustment of the local amplitude slope based on target response data, improving positive gain. The sharpening and peaking effects should specifically satisfy the following formula:

[0089]

[0090]

[0091] in, for The base value; and This is the gain polarity adjustment factor. and yes upper and lower limits of the value range For the target amplitude at frequency point The slope at that point; and These represent the upper and lower limits of the slope. By mapping the current slope to a preset Q-value range, the quality factor can be matched with the local features of the target response data, providing a more accurate initial value for subsequent optimization.

[0092] Accordingly, for the FB mode, the goal is to optimize the closed-loop noise reduction depth while ensuring system stability, such as satisfying the Nyquist criterion. This core relies on the secondary channel response (also known as the feedback transfer function) G(w). Correspondingly, initialization adopts a "safe random" principle to reduce oscillations caused by excessive cross-loop gain. The specific implementation of the second initialization strategy is as follows:

[0093] Overall gain initialization: The overall gain is initialized using random values ​​within a preset range, specifically selected according to a uniform distribution.

[0094]

[0095] in, This is the maximum gain in FB mode; Indicates in [ The random initialization method, which uses a uniformly distributed random number within a certain range, allows the overall gain to be randomly distributed within a safe range, helping to reduce system oscillations caused by excessively large initial values.

[0096] Center frequency initialization: Center frequency exist[ Equal-interval sampling within the frequency band reduces excessive frequency clustering. This equal-interval sampling method allows the filter to be evenly distributed throughout the optimized frequency band, reserving space for possible subsequent frequency point dispersion adjustments.

[0097] Filter gain and quality factor limiting: Limiting the filter gain of each filter. Limited to a preset gain range [ Within, the quality factor Limited to a preset quality factor range [ By setting a clear parameter range, it helps ensure that all initial parameters are within the safe boundaries for stable system operation, reducing the risk of oscillations during subsequent optimization due to parameters exceeding the limits.

[0098] For EQ mode, the target is to fit only the target amplitude response, ignoring the phase, and the core optimization frequency band is []. The specific implementation of the third initialization strategy is as follows:

[0099] Overall gain initialization: Since the EQ mode only needs to fit the amplitude response and does not require phase compensation, the overall gain... Initialize to a preset fixed value. In practice, this fixed value is usually set to zero, i.e. This indicates that no additional overall gain adjustment is required, or the gain of the actual test system can be set to other fixed values.

[0100] Center frequency initialization: Center frequency Uniform sampling is performed within the logarithmic frequency space, covering the target optimized frequency band. Similar to the FF mode, it uses a logarithmic sampling formula:

[0101]

[0102] This logarithmic sampling method ensures sufficient frequency resolution across the entire optimized frequency band, which helps meet the accuracy requirements of equalization calibration.

[0103] Filter gain initialization: The filter gain of each filter is initialized based on the amplitude of the target response data at the corresponding center frequency, using the same initialization logic as FF mode. The amplitude of the target response data at each center frequency is taken as the initial gain and limited to the upper limit of the gain of a single filter.

[0104] Quality factor initialization: quality factor The initialization logic is basically the same as that of the FF mode, dynamically adjusting the local amplitude slope based on the target response data; unlike the FF mode, the EQ mode only relies on amplitude slope information when initializing the quality factor, without considering the phase factor.

[0105]

[0106]

[0107] in, Similarly, based on the determination of local amplitude slope, the local amplitude slope at the center frequency is determined and mapped to a preset value. Within the value range, the initial quality factor of each filter is obtained.

[0108] In this embodiment of the application, through differentiated parameter initialization strategies, different filter modes can obtain reasonable initial parameters under the guidance of their respective optimization objectives, laying a good foundation for subsequent iterative optimization and helping to effectively reduce the number of iterations and accelerate the convergence speed.

[0109] In some embodiments, the initial filter parameter set is updated using a stochastic gradient descent algorithm based on the loss value, including: determining the gradient of the loss value with respect to each filter parameter in the initial filter parameter set using numerical difference; updating each filter parameter using the Adam optimizer combined with a dynamic learning rate based on the gradient of each filter parameter; and performing amplitude limiting on the updated filter parameters according to the parameter constraints corresponding to the target filter mode.

[0110] Among them, the numerical difference method is a numerical calculation method that approximates the derivative by using the difference quotient of function values. When the function expression is complex or cannot be directly differentiated, the approximate value of the derivative is estimated by applying a small perturbation to the independent variable and observing the change in the function value. The Adam optimizer is an adaptive learning rate optimization algorithm based on the estimation of first and second moments. It combines the advantages of momentum and root mean square propagation (RMSProp) and can dynamically adjust the learning rate of each parameter according to the gradient history.

[0111] Correspondingly, during the parameter update process, it is first necessary to determine the gradient of the loss function with respect to each filter parameter. Since it is difficult to directly differentiate between the filter parameters and the loss value, this embodiment uses the numerical difference method to approximate the gradient, that is, to estimate the gradient direction by applying a small perturbation to the parameters and observing the change in the loss value. After obtaining the gradient information, the Adam optimizer is used to update the parameters. The Adam optimizer combines the information of the first moment (momentum) and the second moment (adaptive learning rate), and can dynamically adjust the update step size according to the gradient history, making the convergence process more stable and efficient. At the same time, combined with the dynamic learning rate mechanism, the learning rate is adjusted according to the characteristics of different filter modes. Specifically, for FF mode, the learning rate is increased to accelerate convergence when the error is large, and decreased to avoid oscillation when the error is small; for FB mode, a more conservative learning rate is used to ensure system stability; for EQ mode, the learning rate can be appropriately increased to quickly fit the amplitude gain; after the parameters are updated, the updated parameters also need to be limited according to the parameter constraints corresponding to the target filter mode, for example, by using the preset threshold of each filter mode as a hard constraint to ensure that the parameters are always within the preset effective range and reduce the abnormal filter performance caused by the filter parameters going out of bounds.

[0112] In some embodiments, the numerical difference method is used to determine the gradient of the loss value with respect to each filter parameter in the initialized filter parameter group, including: when the target filter mode is FF mode, the forward difference method is used to determine the gradient of the loss value with respect to each filter parameter in the initialized filter parameter group; when the target filter mode is FB mode or EQ mode, the central difference method is used to determine the gradient of the loss value with respect to each filter parameter in the initialized filter parameter group.

[0113] In the specific implementation process, assume the parameter vector is... The gradient of the loss function with respect to the parameter vector The value is determined using the numerical difference method. The numerical difference method includes two implementations: the forward difference method and the center difference method, each suitable for different filter modes.

[0114] Accordingly, when the target filter mode is FB mode or EQ mode, the central difference method is used to calculate the gradient. The central difference method estimates the derivative by applying positive and negative perturbations to the parameters, and has high accuracy. Specifically, for the parameters... Apply positive and negative perturbations ,gradient Satisfy the following formula:

[0115]

[0116] in, An adaptive step size adjusted according to parameter type; It is a unit vector.

[0117] Correspondingly, when the target filter mode is FF mode, the forward difference method is used, calculating only the loss value after the parameters are positively perturbed, which reduces the computational load by about 50% compared to the center difference method. Specifically, Satisfy the following formula: .

[0118] Furthermore, after obtaining the gradients of each filter parameter, the Adam optimizer is used to update the parameters. The Adam optimizer combines information from the first moment (momentum) and the second moment (adaptive learning rate), enabling it to dynamically adjust the update step size based on gradient history, making the convergence process smoother and more efficient. Correspondingly, the parameter update process of the Adam optimizer is as follows: First, the deviation correction values ​​for the first and second moments are calculated:

[0119]

[0120] in, The number of iterations; m t It is the first moment (momentum), reflecting the historical trend of the gradient direction; The second moment (squared gradient) reflects the historical changes in the gradient magnitude; The first-order moment decay rate; This refers to the second-order moment decay rate. Then, the parameters are updated based on the corrected moment estimate:

[0121]

[0122] in, The learning rate is dynamic and adjusted according to the characteristics of different filter modes: for FF mode, the learning rate is increased to accelerate convergence when the error is large, and the learning rate is decreased to avoid oscillation when the error is small; for FB mode, a more conservative learning rate is used to ensure system stability; for EQ mode, the learning rate can be appropriately increased to quickly fit the amplitude gain.

[0123] Furthermore, after the parameters are updated, they need to be limited according to the parameter constraints corresponding to the target filter mode. Specifically, each parameter is limited to a preset effective range to ensure that the parameters are always within a reasonable range and to reduce filter performance anomalies caused by parameters exceeding limits. Through the complete process of gradient calculation, parameter update, and limiting described above, iterative optimization of the filter parameter set is achieved.

[0124] In this embodiment, differentiated gradient calculation methods are employed for different filter modes, ensuring both accuracy and computational efficiency. Specifically, for the FF mode, the forward difference method is used to calculate the gradient, requiring only the loss value after positive parameter perturbation. Compared to the center difference method, this reduces the computational load by approximately 50%, significantly accelerating the debugging speed of the feedforward filter and better meeting the production line's demand for efficient calibration. For the FB and EQ modes, the center difference method is used to calculate the gradient, obtaining higher-precision gradient estimates by applying positive and negative bidirectional perturbations to the parameters. This helps ensure the system stability of the feedback filter and the fitting accuracy of the equalization filter. This differentiated gradient calculation strategy matches the technical requirements of each filter mode, reducing optimization deviations caused by insufficient accuracy and resource waste caused by over-computation, thereby improving the overall efficiency and reliability of multi-mode filter parameter debugging.

[0125] In some embodiments, when the target filter mode is FF mode, the preset convergence conditions include accuracy attainment conditions and continuous no improvement conditions. Iterative optimization includes: after each iteration, if the amplitude error between the current actual frequency response and the target response data meets the preset amplitude accuracy requirements and the phase error meets the preset phase accuracy requirements, then the accuracy attainment conditions are met, the iteration is stopped, and the current filter parameter set is output as the debugging result; if the amplitude accuracy requirements and phase accuracy requirements are not met simultaneously, and the difference between the current loss value and the historical best loss value is less than the preset loss reduction threshold in a preset number of consecutive iterations, then the continuous no improvement conditions are met, the iteration is stopped, and the filter parameter set corresponding to the historical best loss value is output as the debugging result.

[0126] For example, in the iterative optimization process of FF mode, after each iteration, it is necessary to determine whether the current parameter set meets the preset convergence conditions to reduce invalid iterations and ensure optimization efficiency. These preset convergence conditions include accuracy achievement conditions and continuous no-improvement conditions, each corresponding to different early-stop triggering scenarios. Specifically, the accuracy achievement condition is used to determine whether the current actual frequency response is sufficiently close to the target response data; when the difference between the actual frequency response and the target frequency response meets the preset accuracy requirements, early stopping is directly triggered. Specifically, the accuracy achievement condition includes amplitude accuracy requirements and phase accuracy requirements, both of which must be met simultaneously.

[0127] For example, the amplitude accuracy is within the core frequency band, with an average amplitude difference. and the largest difference They respectively satisfy the following formulas:

[0128]

[0129]

[0130] Among them, M core The number of core frequency band points; when the average amplitude difference And the largest difference When the amplitude accuracy requirement is met, The average amplitude difference threshold, This is the maximum range threshold.

[0131] Correspondingly, phase accuracy is also measured within the core frequency band. Average phase difference Satisfy the following formula:

[0132]

[0133] Among them, when the average phase difference When the phase accuracy requirement is met, This is the average phase difference threshold.

[0134] Correspondingly, when both the amplitude accuracy requirement and the phase accuracy requirement are met, the accuracy compliance condition is determined to be met. At this point, the iterative optimization process terminates, and the current filter parameter set is output as the debugging result.

[0135] Additionally, the condition of no continuous improvement is used to determine whether iterative optimization has entered a plateau, i.e., the loss function does not decrease for a long period of time. When the loss value does not decrease significantly in multiple consecutive iterations, early stopping should be triggered even if the accuracy requirement has not been met to reduce invalid computation. After each iteration, if the current loss L t Compared to the previous best loss L best The difference between (i.e., the historical best loss value) , If the loss reduction threshold is not met, the loss reduction is not significant. In this case, the count of consecutive periods without improvement is incremented by one. If the number of consecutive periods without improvement is ≥ N, then... stop,FF And the total number of iterations T>T min (To reduce premature stopping), early stopping is triggered, at which point the iterative optimization process terminates, and the previous best loss L is reset. best The corresponding filter parameter set is output as the debugging result.

[0136] Correspondingly, in practical applications, iteration stops when either the "accuracy target" or "no continuous improvement" condition is met. By setting the above two early stopping conditions, the FF mode can reduce overfitting or getting trapped in local optima while ensuring amplitude and phase accuracy, and at the same time terminate invalid iterations that have entered a plateau period in a timely manner, thereby improving debugging efficiency while ensuring noise reduction effect.

[0137] In some embodiments, when the target filter mode is FB mode, the preset convergence conditions include a depth stability attainment condition and a stability adjustment exceedance condition. The iterative optimization includes: after each iteration, if the current closed-loop noise reduction depth reaches the preset target noise reduction depth and the open-loop response meets the preset stability requirements, then the depth stability attainment condition is met, the iteration is stopped, and the current filter parameter set is output as the debugging result; if the open-loop response does not meet the stability requirements, the gain of the responsible filter causing instability is adjusted and the number of adjustments is recorded. If the number of adjustments reaches a preset threshold and the open-loop response still does not meet the stability requirements, then the stability adjustment exceedance condition is met, the iteration is stopped, and the most stable filter parameter set recorded during the adjustment process is output as the debugging result.

[0138] For example, during the iterative optimization process of the FB mode, after each iteration, it is necessary to determine whether the current parameter set meets the preset convergence conditions to ensure system stability while improving the noise reduction depth. These preset convergence conditions include a depth stability achievement condition and a stability adjustment exceeding limit condition, each corresponding to different early stop triggering scenarios. Specifically, the depth stability achievement condition is used to determine whether the current parameter set simultaneously meets the noise reduction depth requirements and system stability requirements; when the closed-loop depth meets the requirement and the system is stable, early stop is directly triggered.

[0139] For example, the noise reduction depth requirement is measured within the core noise reduction frequency band, assuming the angular frequency corresponding to fc in the core noise reduction frequency band is... The current closed-loop noise reduction depth is The preset target noise reduction depth is ;when At that time, the depth requirement is deemed met. Stability requirements are determined based on the Nyquist criterion for open-loop responses. It is necessary to detect whether a phase crossing point exists, which is defined as satisfying the condition that... The frequency point; if there are no phase crossing points, i.e. If the system is stable, then the system is stable. If there are phase crossing points, it is necessary to further determine whether the open-loop gain at all crossing points is less than 1. When the open-loop gain at all phase crossing points satisfies the condition... When the system reaches the target noise reduction depth and the open-loop response meets the stability requirements, it is determined that the depth stability target is met. At this point, the iterative optimization process terminates, and the current filter parameter set is output as the debugging result.

[0140] The stability adjustment over-limit condition is used to handle system instability. When the open-loop response does not meet the stability requirements, stability adjustment is required. If the stability requirements still cannot be met after exceeding the adjustment limit, an early stop is triggered, and the most stable parameter recorded during the adjustment process is output. Specifically, when the open-loop response is detected to not meet the stability requirements, the unstable state of the system is analyzed, specifically by detecting the phase crossover point of the open-loop response. (i.e., satisfy) The frequency points are identified to pinpoint the critical frequency bands causing instability; then, the contribution of the gain at these phase crossing points to the gain of each filter is calculated, and the gain is proportional to the frequency of the crossover. The filter contributing the most is identified as the "responsibility filter." After identifying the responsibility filter, a stability adjustment operation is performed: the filter gain of this responsibility filter is reduced to decrease its open-loop gain contribution at the phase crossover point, thereby improving system stability. After each adjustment, the adjustment count is incremented, and the open-loop response is reassessed to ensure it meets stability requirements. During the adjustment process, the filter parameter set historically closest to the stability requirement is recorded as the current most stable filter parameter set. This most stable parameter set can be the parameter state whose open-loop response is closest to meeting the stability requirement during the adjustment process, such as the parameter set with the minimum open-loop gain at the phase crossover point. If the number of adjustments reaches a preset threshold... If the open-loop response still fails to meet the stability requirements, it is determined that the stability adjustment exceeds the limit. At this point, the iterative optimization process terminates, and the most stable filter parameter set recorded during the adjustment process is output as the debugging result to ensure that the system does not oscillate.

[0141] In practical applications, when the "depth and stability" condition is met, the optimal parameter set is recorded and output; when the "stability adjustment exceeds the limit" or "there is no continuous improvement" condition is met, the current most stable parameter set is output (prioritizing ensuring that the system does not oscillate). By setting the above two early stop conditions, the FB mode can achieve the target noise reduction depth while ensuring closed-loop stability, and at the same time reduce the risk of system oscillation caused by excessive pursuit of depth, thereby improving the noise reduction effect while ensuring the reliability and consistency of the product.

[0142] In some embodiments, when the target filter mode is EQ mode, the preset convergence conditions include amplitude compliance conditions and error stability conditions. The iterative optimization includes: after each iteration, if the average amplitude error between the current actual frequency response and the target response data in the entire frequency band is less than a preset amplitude error threshold, then the amplitude compliance condition is met, the iteration stops, and the current filter parameter set is output as the debugging result; if the average amplitude error is not less than the amplitude error threshold, and the absolute value of the fitting slope of the loss value sequence within the preset sliding window is less than a preset rate of change threshold, then the error stability condition is met, the iteration stops, and the filter parameter set with the smallest loss value within the sliding window is output as the debugging result.

[0143] For example, in the iterative optimization process of EQ mode, after each iteration, it is necessary to determine whether the current parameter set meets the preset convergence conditions in order to quickly converge to the target amplitude response and reduce excessive iterations. The preset convergence conditions include the amplitude attainment condition and the error stabilization condition, which correspond to different early stop triggering scenarios. Among them, the amplitude attainment condition is used to determine whether the amplitude of the current actual frequency response is close enough to the target amplitude response; when the average amplitude error across the entire frequency band is less than the preset threshold, early stop is directly triggered.

[0144] Accordingly, assume the total number of frequency points in the EQ mode is M.eq , No. The frequency points are The average amplitude error across the entire frequency band Satisfy the following formula:

[0145]

[0146] in, For the current filter parameter set at frequency The fitted amplitude at that point, For target response data at frequency The target amplitude at the location; when the average amplitude error Less than the preset amplitude error threshold When the amplitude threshold is met, the iterative optimization process terminates, and the current filter parameter set is output as the debugging result. Since the EQ mode only focuses on the amplitude response, phase smoothing is unnecessary, and the filter parameters corresponding to the amplitude curve can be directly output.

[0147] The error stationarity condition is used to determine whether iterative optimization has entered a plateau phase, i.e., when the rate of change of error approaches zero. When the change in the loss value becomes gradual, even if the required amplitude accuracy has not yet been achieved, continued iteration is unlikely to yield significant improvement. In this case, early stopping should be triggered to reduce invalid computation. For example, the error stationarity condition is determined based on the sequence of loss values ​​within a sliding window, assuming the sliding window size is... The next iteration, the window contains the most recent Loss value of the next iteration and the corresponding number of iterations The slope of the fit is calculated by performing a linear fit on the loss value sequence within the window. To reflect the changing trend of the error, the fitted slope Satisfy the following formula:

[0148]

[0149] The summation is performed within the sliding window. The iteration is repeated. The formula is obtained through linear fitting using the least squares method, and the slope is... The sign of indicates whether the error is increasing or decreasing, and the absolute value of the fitted slope. The size indicates the rate of change; when Less than the preset rate of change threshold When the error plateaus, the loss value almost stops decreasing, indicating that the error stationarity condition is met, and the iterative optimization process terminates. Since the parameters of the current iteration may not be the optimal parameters within the window when the error stationarity condition is triggered (they may have overfitted or started to deteriorate), it is necessary to output the filter parameter set corresponding to the iteration with the smallest loss value within the sliding window. By recording the loss values ​​of each iteration within the window, the iteration with the smallest loss value and its corresponding filter parameter set can be determined and output as the debugging result to ensure that the output is the best parameter in the recent optimization process.

[0150] By setting the two early stopping conditions mentioned above, the EQ mode can quickly converge to the target amplitude response while promptly terminating invalid iterations that have entered a plateau phase. When the amplitude error meets the target condition, it directly outputs the current filter parameter set; when the error is stable, it outputs the filter parameter set with the minimum loss value within the sliding window. Since the EQ mode only focuses on the amplitude response, phase smoothing is unnecessary, and the filter parameters corresponding to the amplitude curve can be directly output. This mechanism effectively reduces the computational load while ensuring fitting accuracy, helping to accelerate the production line calibration cycle.

[0151] Figure 2 Another flowchart illustrating a multi-mode filter parameter tuning method provided for an exemplary embodiment of this application is shown. Figure 2 As shown, the multi-mode filter parameter tuning method includes the following steps:

[0152] S201. Obtain target response data.

[0153] S202. Determine the target filter mode corresponding to the current debugging scenario based on the target response data. The target filter mode includes one of FF mode, FB mode or EQ mode.

[0154] S203. Based on the target filter mode, determine the target initialization strategy from the preset multiple parameter initialization strategies, and initialize the current filter parameter group to be optimized according to the target initialization strategy.

[0155] For example, in some embodiments, the filter parameter set includes overall gain, center frequency, filter gain, and quality factor. Based on the target filter mode, a target initialization strategy is determined from a set of preset parameter initialization strategies. This includes: when the target filter mode is FF mode, determining the target initialization strategy as a first initialization strategy, the first initialization strategy including: initializing the overall gain based on the average and peak values ​​of the target response data; uniformly sampling in the logarithmic frequency space to initialize the center frequency; initializing the filter gain of each filter based on the amplitude of the target response data at the center frequency; and dynamically initializing the quality factor based on the local amplitude slope of the target response data; when the target filter mode is FB mode, determining the target initialization strategy... The second initialization strategy includes: initializing the overall gain with random values ​​within a preset numerical range; initializing the center frequency by sampling at equal intervals within a preset frequency band; limiting the filter gain of each filter within a preset gain range; and limiting the quality factor within a preset quality factor range. When the target filter mode is EQ mode, the target initialization strategy is determined to be the third initialization strategy, which includes: initializing the overall gain to a preset fixed value; initializing the center frequency by sampling uniformly within the logarithmic frequency space; initializing the filter gain of each filter according to the amplitude of the target response data at the center frequency; and dynamically initializing the quality factor according to the local amplitude slope of the target response data.

[0156] S204. Determine the current actual frequency response.

[0157] S205. Determine the loss value between the current actual frequency response and the target response data based on the preset loss function corresponding to the target filter mode.

[0158] S206. Based on the target filter mode, determine the gradient of the loss value with respect to each filter parameter in the filter parameter group.

[0159] For example, when the target filter mode is FF mode, the forward difference method is used to determine the gradient of the loss value with respect to each filter parameter in the filter parameter group; when the target filter mode is FB mode or EQ mode, the central difference method is used to determine the gradient of the loss value with respect to each filter parameter in the filter parameter group.

[0160] S207. Based on the gradient of each filter parameter, the Adam optimizer is used in conjunction with the dynamic learning rate to update each filter parameter.

[0161] S208. According to the parameter constraints corresponding to the target filter mode, the updated filter parameters are subjected to amplitude limiting.

[0162] For example, the updated filter parameters are limited according to the parameter constraints corresponding to the target filter mode. Specifically, for parameters such as overall gain, filter gain, and quality factor, each mode has a preset value range. For instance, the overall gain is limited to the maximum gain allowed by the system, the filter gain is limited to the upper limit of the gain of a single filter, and the quality factor is limited to a preset Q value range. After each parameter update, it is checked whether each parameter exceeds the preset range of the corresponding mode. If it exceeds the upper limit, it is assigned the upper limit value; if it exceeds the lower limit, it is assigned the lower limit value; if it is within the range, it remains unchanged. Through the above limiting process, it is ensured that all filter parameters are always within a reasonable range, which helps to reduce the abnormal filter performance caused by parameters going out of bounds, thereby ensuring the stable progress of the iterative optimization process.

[0163] S209. After each iteration, determine whether the preset convergence condition corresponding to the target filter mode is met.

[0164] If so, execute S210;

[0165] If not, proceed with S204.

[0166] S210. Output the optimized filter parameter set as the debugging result.

[0167] Figure 3 This is yet another flowchart illustrating a multi-mode filter parameter tuning method provided for an exemplary embodiment of this application. Figure 3 As shown, the multi-mode filter parameter tuning method includes the following steps:

[0168] S301, Filter mode selection.

[0169] If the filter mode is FF mode, execute S302;

[0170] If the filter mode is FB mode, execute S310;

[0171] If the filter mode is EQ mode, execute S316.

[0172] S302. Determine the amplitude error and phase error.

[0173] S303. Determine whether the accuracy standard is met.

[0174] If not, proceed with S304;

[0175] If so, execute S306.

[0176] S304, increment the count of continuous no improvement by one.

[0177] That is, after each iteration, if the current loss Compared to the previous best loss The difference between (i.e., the historical best loss value) If the loss decreases insignificantly, the count of no improvement will be incremented by one.

[0178] S305. Determine whether the number of consecutive no-improvement counts is greater than or equal to the consecutive no-improvement count threshold.

[0179] If not, proceed to S308;

[0180] If so, execute S306.

[0181] S306, triggers early stop.

[0182] That is, the iterative optimization process terminates.

[0183] S307, Output optimization results.

[0184] S308, Continue iterating.

[0185] S309. Determine if the maximum number of iterations has been reached.

[0186] If so, execute S307;

[0187] If not, proceed with S301.

[0188] S310, Determine depth loss and stability loss.

[0189] S311. Determine whether the conditions for achieving deep stability are met.

[0190] If so, execute S315;

[0191] If not, proceed to S312.

[0192] S312, Perform stability adjustments.

[0193] S313, Reduce the gain of the unstable filter.

[0194] S314, Update filter parameters.

[0195] S315, Record the optimal parameters.

[0196] S316. Determine the amplitude error.

[0197] S317. Determine whether the amplitude meets the standard.

[0198] If so, execute S306;

[0199] If not, proceed with S318.

[0200] S318, Error Change Detection.

[0201] The error plateau condition is used to determine whether iterative optimization has entered a plateau phase, i.e., when the rate of change of error approaches zero. When the change of the loss value becomes gradual, even if the amplitude accuracy requirement has not yet been met, continuing iteration will hardly yield significant improvement. In this case, early stopping should be triggered to reduce invalid computation.

[0202] For example, Figure 4 A schematic diagram of the fitting result of the FF filter provided for an exemplary embodiment of this application. For example... Figure 4 As shown, the upper subplot is a gain response comparison chart, where the solid line represents the target curve and the dashed line represents the design curve. The two curves largely overlap within the core frequency band, indicating that the amplitude error meets the preset accuracy requirements. The middle subplot is a phase response comparison chart, similarly using solid lines to represent the target phase and dashed lines to represent the design phase. The two curves also match well within the core frequency band, indicating that the phase error meets the preset accuracy requirements. The lower subplot is a complex residual chart, calculated from the complex difference between the actual frequency response and the target frequency response. The chart shows that the complex residual is below -40dB within the core noise reduction frequency band, meeting the preset accuracy requirements. These three sets of curves demonstrate that the FF filter optimization scheme provided in this application can achieve accurate amplitude and phase fitting within the core frequency band, effectively ensuring the feedforward noise reduction effect.

[0203] For example, Figure 5 A schematic diagram of the FB filter fitting result provided for an exemplary embodiment of this application. (See diagram below.) Figure 5 As shown, the left subplot represents the gain and phase response of the secondary path and filter frequency response, where the solid line represents the secondary path response and the dashed line represents the FB filter frequency response. Together, they determine the characteristics of the open-loop response. The middle subplot represents the gain and phase response of the open-loop response, which is obtained by cascading the secondary path and the FB filter. By analyzing its phase crossover point and corresponding gain, it can be determined whether the system meets the Nyquist stability criterion. The right subplot represents the gain of the closed-loop response, which reflects the final noise reduction effect after adding feedback. The figure shows that the closed-loop gain is below -15dB in the core noise reduction frequency band (such as the human ear's sensitive frequency band), indicating that the noise reduction depth meets the preset requirements. Through the comprehensive analysis of the above three sets of curves, the FB filter optimization scheme provided in this application embodiment can achieve deep noise reduction in the core frequency band while ensuring system stability, effectively reducing performance fluctuations caused by improper parameters.

[0204] For example, Figure 6 A schematic diagram of the EQ filter fitting result provided for an exemplary embodiment of this application. (See diagram below.) Figure 6As shown, the upper subplot illustrates the target curve and tolerance band. The solid line represents the target curve, serving as the benchmark for equalization calibration. The dashed line represents the tolerance band boundaries, with the upper boundary at +1.5dB above the target curve and the lower boundary at -1.5dB below the target curve, used to measure the allowable error range of the fitting results. The lower subplot compares the design curve and the target curve. The solid line represents the target curve, and the dashed line represents the EQ design result obtained after optimization in this application. The figure shows that the design curve and the target curve highly overlap across the entire frequency band, with an amplitude error of less than 0.5dB, meeting the preset accuracy requirements. The comparison of these two sets of curves demonstrates that the EQ filter optimization scheme provided in this application can actively ignore the phase response while ensuring fitting accuracy, thereby achieving high-quality equalization calibration while reducing computational load.

[0205] In summary, this application has at least the following advantages:

[0206] I. By constructing a categorized stochastic gradient descent optimization framework, the debugging efficiency and accuracy of multi-mode filter parameters were significantly improved. For the feedforward (FF) mode, a dual-objective collaborative optimization strategy of phase and gain was adopted, achieving high-precision fitting with amplitude error below 0.1dB and phase error below 3° within the core noise reduction frequency band. Convergence was achieved in as few as 300 iterations, which is more than 50% faster than the traditional ergonomic search method, effectively shortening the noise reduction debugging cycle on the production line. For the feedback (FB) mode, an open-loop-closed-loop joint iterative mechanism was introduced. The Nyquist criterion was used to monitor system stability in real time and dynamically adjust the gain of the responsible filter to ensure that the phase margin of the closed-loop response reaches more than 30°, effectively suppressing the risk of howling and significantly improving product consistency and reliability. For the balanced (EQ) mode, the phase response calculation was innovatively omitted, focusing only on minimizing the amplitude error. While maintaining a fitting accuracy of 0.5dB, the computational load was reduced by 60%, significantly accelerating the calibration cycle on the production line.

[0207] Second, by introducing an intelligent early-stop mechanism, the iteration is automatically terminated when the filter frequency response reaches the preset accuracy or a convergence plateau is detected, reducing invalid calculations after the target is met. Comparative tests show that this mechanism can save 40% of the calculation time under the same accuracy requirements, further improving debugging efficiency. At the same time, through parameter limiting and stability constraints, it is ensured that the optimization process always takes place within the effective parameter space, guaranteeing the physical realizability of the debugging results.

[0208] Third, the above-mentioned technical improvements enable this application not only to be applicable to the large-scale automated calibration of active noise cancellation filters for headphones, but also to parameter optimization scenarios for audio devices such as hearing aids, car audio systems, and smart speakers. While ensuring high performance, it can effectively save on debugging manpower costs and help improve production line throughput and product consistency.

[0209] Figure 7 A schematic diagram of a multi-mode filter parameter tuning device provided for an exemplary embodiment of this application. Figure 7 As shown, the multi-mode filter parameter tuning device 70 includes an acquisition module 71, a filter parameter tuning module 72, and an output module 73, wherein:

[0210] The acquisition module 71 is used to acquire target response data and determine the target filter mode corresponding to the current debugging scenario based on the target response data. The target filter mode includes one of feedforward FF mode, feedback FB mode or equalizer EQ mode.

[0211] The filter parameter tuning module 72 is used to iteratively optimize the current filter parameter set according to the target filter mode, using a differentiated optimization strategy corresponding to the target filter mode, until the preset convergence condition corresponding to the target filter mode is met. The differentiated optimization strategy includes: when the target filter mode is FF mode, the optimization objective is to simultaneously reduce amplitude error and phase error; when the target filter mode is FB mode, the optimization objective is to simultaneously improve the noise reduction depth and meet the preset stability constraints; when the target filter mode is EQ mode, the optimization objective is to reduce amplitude error.

[0212] Output module 73 is used to output the optimized filter parameter set as the debugging result.

[0213] In one possible implementation, the filter parameter tuning module 72 can be specifically used to: determine a target initialization strategy from a variety of preset parameter initialization strategies according to the target filter mode, and initialize the current filter parameter set to be optimized according to the target initialization strategy to obtain the initialized filter parameter set; determine the current actual frequency response according to the initialized filter parameter set, and determine the loss value between the current actual frequency response and the target response data according to the preset loss function corresponding to the target filter mode; and update the initialized filter parameter set using a stochastic gradient descent algorithm according to the loss value.

[0214] In one possible implementation, the filter parameter set includes overall gain, center frequency, filter gain, and quality factor. The filter parameter tuning module 72 can also be used to: when the target filter mode is FF mode, determine the target initialization strategy as a first initialization strategy, the first initialization strategy including: initializing the overall gain based on the average and peak values ​​of the target response data; uniformly sampling in the logarithmic frequency space to initialize the center frequency; initializing the filter gain of each filter based on the amplitude of the target response data at the center frequency; and dynamically initializing the quality factor based on the local amplitude slope of the target response data; when the target filter mode is FB mode, determine the target initialization strategy as a second initialization strategy, the third... The second initialization strategy includes: initializing the overall gain with random values ​​within a preset numerical range; initializing the center frequency by sampling at equal intervals within a preset frequency band; limiting the filter gain of each filter within a preset gain range; and limiting the quality factor within a preset quality factor range. When the target filter mode is EQ mode, the target initialization strategy is determined to be the third initialization strategy, which includes: initializing the overall gain to a preset fixed value; initializing the center frequency by sampling uniformly within the logarithmic frequency space; initializing the filter gain of each filter according to the amplitude of the target response data at the center frequency; and dynamically initializing the quality factor according to the local amplitude slope of the target response data.

[0215] In one possible implementation, the filter parameter tuning module 72 can also be used to: determine the gradient of the loss value with respect to each filter parameter in the initialized filter parameter group using the numerical difference method; update each filter parameter using the Adam optimizer combined with the dynamic learning rate according to the gradient of each filter parameter; and perform amplitude limiting processing on the updated filter parameters according to the parameter constraints corresponding to the target filter mode.

[0216] In one possible implementation, the filter parameter tuning module 72 can also be used to: determine the gradient of the loss value with respect to each filter parameter in the initialized filter parameter group when the target filter mode is FF mode; and determine the gradient of the loss value with respect to each filter parameter in the initialized filter parameter group when the target filter mode is FB mode or EQ mode.

[0217] In one possible implementation, when the target filter mode is FF mode, the preset convergence conditions include accuracy attainment conditions and continuous no improvement conditions. The filter parameter debugging module 72 can also be used to: after each iteration, if the amplitude error between the current actual frequency response and the target response data meets the preset amplitude accuracy requirements and the phase error meets the preset phase accuracy requirements, then it is determined that the accuracy attainment conditions are met, the iteration is stopped, and the current filter parameter set is output as the debugging result; if the amplitude accuracy requirements and phase accuracy requirements are not met simultaneously, and the difference between the current loss value and the historical best loss value is less than the preset loss reduction threshold in a continuous preset number of iterations, then it is determined that the continuous no improvement conditions are met, the iteration is stopped, and the filter parameter set corresponding to the historical best loss value is output as the debugging result.

[0218] In one possible implementation, when the target filter mode is FB mode, the preset convergence conditions include depth stability attainment conditions and stability adjustment exceeding conditions. The filter parameter debugging module 72 can also be used to: after each iteration, if the current closed-loop noise reduction depth reaches the preset target noise reduction depth and the open-loop response meets the preset stability requirements, then it is determined that the depth stability attainment conditions are met, the iteration is stopped, and the current filter parameter set is output as the debugging result; if the open-loop response does not meet the stability requirements, then the gain of the responsible filter that caused the instability is adjusted and the number of adjustments is recorded. If the number of adjustments reaches the preset threshold and the open-loop response still does not meet the stability requirements, then it is determined that the stability adjustment exceeding conditions are met, the iteration is stopped, and the most stable filter parameter set recorded during the adjustment process is output as the debugging result.

[0219] In one possible implementation, when the target filter mode is EQ mode, the preset convergence conditions include amplitude compliance conditions and error stability conditions. The filter parameter tuning module 72 can also be used to: after each iteration, if the average amplitude error between the current actual frequency response and the target response data in the entire frequency band is less than a preset amplitude error threshold, then the amplitude compliance condition is met, the iteration is stopped, and the current filter parameter set is output as the tuning result; if the average amplitude error is not less than the amplitude error threshold, and the absolute value of the fitting slope of the loss value sequence within the preset sliding window is less than a preset rate of change threshold, then the error stability condition is met, the iteration is stopped, and the filter parameter set with the smallest loss value within the sliding window is output as the tuning result.

[0220] The multi-mode filter parameter debugging device provided in this application embodiment can execute the technical solution shown in the above-described multi-mode filter parameter debugging method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0221] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented by processing element calls to software, while others are implemented in hardware. For example, the filter parameter tuning module can be a separate processing element, or it can be integrated into a chip in the above device. Alternatively, it can be stored as program code in the memory of the above device, and its function can be called and executed by a processing element. The implementation of other modules is similar. Moreover, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed through the integrated logic circuits in the hardware of the processor element or through software instructions.

[0222] For example, these modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more Digital Signal Processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). As another example, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a System-On-a-Chip (SOC).

[0223] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Video Discs, DVDs), or semiconductor media (e.g., solid-state disks (SSDs)).

[0224] Figure 8 A schematic diagram of the structure of an electronic device provided as an exemplary embodiment of this application. For example... Figure 8 As shown, the electronic device 80 in this embodiment includes:

[0225] At least one processor 81; and a memory 82 communicatively connected to the at least one processor;

[0226] The memory 82 stores instructions that can be executed by at least one processor 81 to cause the electronic device to perform the method as described in any of the above embodiments.

[0227] Alternatively, the memory 82 can be either standalone or integrated with the processor 81.

[0228] The memory 82 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device.

[0229] The processor 81 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. Specifically, when implementing the multi-mode filter parameter tuning method described in the foregoing method embodiments, the electronic device may be, for example, an electronic device with processing capabilities such as a server.

[0230] Optionally, the electronic device may also include a communication interface 83. In specific implementations, if the communication interface 83, memory 82, and processor 81 are implemented independently, they can be interconnected via a bus to complete communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not imply that there is only one bus or one type of bus.

[0231] Optionally, in a specific implementation, if the communication interface 83, memory 82, and processor 81 are integrated on a single chip, then the communication interface 83, memory 82, and processor 81 can communicate through an internal interface.

[0232] The implementation principle and technical effects of the electronic device provided in this embodiment can be found in the foregoing embodiments, and will not be repeated here.

[0233] This application also provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are executed, they are used to implement the method steps as described in the above method embodiments. The specific implementation methods and technical effects are similar and will not be repeated here.

[0234] The aforementioned computer-readable storage media can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0235] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an application-specific integrated circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in a multi-mode filter parameter tuning device.

[0236] This application also provides a computer program product, including a computer program, which, when executed, implements the method steps as described in the above method embodiments. The specific implementation and technical effects are similar and will not be repeated here.

[0237] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0238] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for adjusting parameters of a multi-mode filter, characterized in that, include: Acquire target response data and determine the target filter mode corresponding to the current debugging scenario based on the target response data. The target filter mode includes one of feedforward FF mode, feedback FB mode, or equalizer EQ mode. Based on the target filter mode, a differentiated optimization strategy corresponding to the target filter mode is adopted to iteratively optimize the current filter parameter set to be optimized until the preset convergence condition corresponding to the target filter mode is met; wherein, the differentiated optimization strategy includes: when the target filter mode is the FF mode, the optimization objective is to simultaneously reduce amplitude error and phase error; when the target filter mode is the FB mode, the optimization objective is to simultaneously improve the noise reduction depth and meet the preset stability constraint; when the target filter mode is the EQ mode, the optimization objective is to reduce amplitude error; The optimized filter parameter set is output as the debugging result.

2. The multi-mode filter parameter tuning method according to claim 1, characterized in that, The step of iteratively optimizing the current filter parameter set according to the target filter mode, using a differentiated optimization strategy corresponding to the target filter mode, includes: Based on the target filter mode, a target initialization strategy is determined from a variety of preset parameter initialization strategies, and the current filter parameter set to be optimized is initialized according to the target initialization strategy to obtain the initialized filter parameter set. The current actual frequency response is determined based on the initialized filter parameter set, and the loss value between the current actual frequency response and the target response data is determined based on the preset loss function corresponding to the target filter mode. Based on the loss value, the initialized filter parameter set is updated using the stochastic gradient descent algorithm.

3. The multi-mode filter parameter tuning method according to claim 2, characterized in that, The filter parameter set includes overall gain, center frequency, filter gain, and quality factor. The step of determining a target initialization strategy from a set of preset parameter initialization strategies based on the target filter mode includes: When the target filter mode is the FF mode, the target initialization strategy is determined to be the first initialization strategy. The first initialization strategy includes: initializing the overall gain based on the average and peak values ​​of the target response data; uniformly sampling in the logarithmic frequency space to initialize the center frequency; initializing the filter gain of each filter based on the amplitude of the target response data at the center frequency; and dynamically initializing the quality factor based on the local amplitude slope of the target response data. When the target filter mode is the FB mode, the target initialization strategy is determined to be the second initialization strategy. The second initialization strategy includes: initializing the overall gain with random values ​​within a preset numerical range; sampling at equal intervals within a preset frequency band to initialize the center frequency; limiting the filter gain of each filter within a preset gain range; and limiting the quality factor within a preset quality factor range. When the target filter mode is the EQ mode, the target initialization strategy is determined to be the third initialization strategy. The third initialization strategy includes: initializing the overall gain to a preset fixed value; uniformly sampling in the logarithmic frequency space to initialize the center frequency; initializing the filter gain of each filter according to the amplitude of the target response data at the center frequency; and dynamically initializing the quality factor according to the local amplitude slope of the target response data.

4. The multi-mode filter parameter tuning method according to claim 2, characterized in that, The step of updating the initialized filter parameter set using the stochastic gradient descent algorithm based on the loss value includes: The gradient of the loss value with respect to each filter parameter in the initialized filter parameter set is determined using the numerical difference method; Based on the gradient of each filter parameter, the Adam optimizer combined with a dynamic learning rate is used to update each filter parameter; The updated filter parameters are subjected to amplitude limiting based on the parameter constraints corresponding to the target filter mode.

5. The multi-mode filter parameter tuning method according to claim 4, characterized in that, The step of determining the gradient of the loss value with respect to each filter parameter in the initialized filter parameter set using the numerical difference method includes: When the target filter mode is the FF mode, the gradient of the loss value with respect to each filter parameter in the initialized filter parameter group is determined by the forward difference method. When the target filter mode is the FB mode or the EQ mode, the gradient of the loss value with respect to each filter parameter in the initialized filter parameter group is determined using the central difference method.

6. The method for adjusting the parameters of a multi-mode filter according to any one of claims 2 to 4, characterized in that, When the target filter mode is the FF mode, the preset convergence condition includes an accuracy achievement condition and a continuous no-improvement condition, and the iterative optimization includes: After each iteration, if the amplitude error between the current actual frequency response and the target response data meets the preset amplitude accuracy requirement and the phase error meets the preset phase accuracy requirement, then it is determined that the accuracy compliance condition is met, the iteration stops, and the current filter parameter group is output as the debugging result. If the amplitude accuracy requirement and the phase accuracy requirement are not met simultaneously, and the difference between the current loss value and the historical best loss value is less than the preset loss reduction threshold in a preset number of consecutive iterations, then the condition of no continuous improvement is met, the iteration is stopped, and the filter parameter group corresponding to the historical best loss value is output as the debugging result.

7. The method for adjusting the parameters of a multi-mode filter according to any one of claims 2 to 4, characterized in that, When the target filter mode is the FB mode, the preset convergence condition includes a depth stability attainment condition and a stability adjustment exceedance condition, and the iterative optimization includes: After each iteration, if the current closed-loop noise reduction depth reaches the preset target noise reduction depth and the open-loop response meets the preset stability requirements, then it is determined that the depth stability target condition is met, the iteration stops, and the current filter parameter set is output as the debugging result. If the open-loop response does not meet the stability requirements, the gain of the responsible filter causing instability is adjusted and the number of adjustments is recorded. If the open-loop response still does not meet the stability requirements after the number of adjustments reaches a preset threshold, it is determined that the stability adjustment exceeds the limit condition, the iteration is stopped, and the most stable filter parameter set recorded during the adjustment process is output as the debugging result.

8. The method for adjusting the parameters of a multi-mode filter according to any one of claims 2 to 4, characterized in that, When the target filter mode is the EQ mode, the preset convergence condition includes an amplitude attainment condition and an error stability condition, and the iterative optimization includes: After each iteration, if the average amplitude error between the current actual frequency response and the target response data in the entire frequency band is less than the preset amplitude error threshold, it is determined that the amplitude compliance condition is met, the iteration stops, and the current filter parameter set is output as the debugging result. If the average amplitude error is not less than the amplitude error threshold, and the absolute value of the fitting slope of the loss value sequence within the preset sliding window is less than the preset rate of change threshold, then it is determined that the error stationarity condition is met, the iteration stops, and the filter parameter group with the smallest loss value within the sliding window is output as the debugging result.

9. A multi-mode filter parameter tuning device, characterized in that, include: The acquisition module is used to acquire target response data and determine the target filter mode corresponding to the current debugging scenario based on the target response data. The target filter mode includes one of feedforward FF mode, feedback FB mode or equalizer EQ mode. The filter parameter tuning module is used to iteratively optimize the current filter parameter set according to the target filter mode, using a differentiated optimization strategy corresponding to the target filter mode, until the preset convergence condition corresponding to the target filter mode is met. The differentiated optimization strategy includes: when the target filter mode is the FF mode, the optimization objective is to simultaneously reduce amplitude error and phase error; when the target filter mode is the FB mode, the optimization objective is to simultaneously improve noise reduction depth and meet preset stability constraints; when the target filter mode is the EQ mode, the optimization objective is to reduce amplitude error. The output module is used to output the optimized filter parameter set as the debugging result.

10. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory is used to store computer-executed instructions; The processor is configured to execute the computer execution instructions to implement the method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed, it implements the method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Scene adaptive active noise reduction method and earphone

    CN108900943A

  • Active noise reduction earphone verification method

    CN112929809A

  • Earphone control method and device, noise reduction earphone and storage medium

    CN114666702A

  • Noise reduction filter optimization method, noise reduction method and device, earphone and storage medium

    CN117560602A

  • Fuse denoising method and system based on adaptive filtering

    CN119961566A