Equalizer filter parameter determination method and device, electronic equipment, and storage medium

By combining particle swarm optimization algorithm with a preset loss function, the slow convergence and local optima problems of stochastic gradient descent algorithm in solving equalizer filter parameters are solved, realizing fast and efficient filter parameter solving.

CN115987248BActive Publication Date: 2026-07-07BESTECHNIC SHANGHAI CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BESTECHNIC SHANGHAI CO LTD
Filing Date
2022-12-30
Publication Date
2026-07-07

Smart Images

  • Figure CN115987248B_ABST
    Figure CN115987248B_ABST
Patent Text Reader

Abstract

The application provides a filter parameter determination method and device of an equalizer, electronic equipment and a storage medium, comprising: evaluating a loss difference between a device frequency response corresponding to position information of each particle and a target frequency response through a preset loss function; wherein the position information of each particle corresponds to a group of filter parameters, and the loss function defines that when a difference between the device frequency response and the target frequency response at any frequency point is less than a preset difference threshold, a sub-loss difference at the frequency point is zero; judging whether the loss difference is less than a preset loss threshold; if the loss differences corresponding to all particles are all not less than the loss threshold, updating the position information of all particles, and returning to the step of evaluating the loss difference; repeating the above process until there is a target particle corresponding to a loss difference less than the loss threshold, and determining that the position information corresponding to the target particle is an optimal solution of the filter parameters. The application scheme realizes solving of the optimal filter parameters of the equalizer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of audio processing technology, and in particular to a method and apparatus for determining filter parameters of an equalizer, an electronic device, and a storage medium. Background Technology

[0002] With technological advancements, calibrating the frequency response curve of equipment using equalizers (EQ) has become widely adopted, allowing for the calibration of the equipment's timbre. This process requires solving for the parameters of the filters in the equalizer, including gain, center frequency, and quality factor. In related techniques, SGD (Stochastic Gradient Descent Algorithm) can be used to solve for these parameters. Given the desired filter and target frequency response, a loss function is defined as the mean square error between the equalizer and the target frequency response. SGD then minimizes this mean square error to obtain the final filter parameters. However, because SGD relies on gradient updates to find the optimal solution, it converges slowly in the later stages of iteration when the gradient is small, and there is a risk of prematurely finding a local optimum. Summary of the Invention

[0003] The purpose of this application is to provide a method, apparatus, electronic device, and storage medium for determining the filter parameters of an equalizer, used to solve for the optimal filter parameters of the equalizer.

[0004] On the one hand, this application provides a method for determining the filter parameters of an equalizer, including:

[0005] The loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle is evaluated by using a preset loss function. The position information of each particle corresponds to a set of filter parameters. Both the device frequency response and the target frequency response include the frequency response at multiple frequency points. The loss function defines that when the difference between the device frequency response and the target frequency response at any frequency point is less than a preset difference threshold, the sub-loss difference at that frequency point is zero.

[0006] Determine whether the loss difference is less than a preset loss threshold;

[0007] If the loss difference for all particles is not less than the loss threshold, update the position information of all particles and return to the step of evaluating the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle by using a preset loss function.

[0008] Repeat the above process until there is a target particle whose loss difference is less than the loss threshold, and determine the position information of the target particle as the optimal solution for the filter parameters.

[0009] In one embodiment, before evaluating the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle using a preset loss function, the method further includes:

[0010] The position and velocity information of multiple particles are initialized within a preset search space; wherein, the search space limits the range of values ​​for the position information of the multiple particles, the position information of each particle is randomly generated, and the velocity information of each particle is initialized to zero.

[0011] In one embodiment, evaluating the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle using a preset loss function includes:

[0012] For each particle, determine the sub-loss difference at each frequency point between the device frequency response and the target frequency response corresponding to the particle's position information; wherein, if at any frequency point the difference between the device frequency response and the target frequency response is less than the difference threshold, the sub-loss difference at that frequency point is zero; if at any frequency point the difference between the device frequency response and the target frequency response is not less than the difference threshold, the sub-loss difference at that frequency point is the square of the difference between the device frequency response and the target frequency response;

[0013] For each particle, the loss difference between the device frequency response and the target frequency response corresponding to the particle's position information is determined based on the sub-loss difference of the particle at all frequency points.

[0014] In one embodiment, updating the position information of all particles includes:

[0015] For each particle, update the particle's current velocity based on the particle's previous velocity, previous position information, individual extreme value, and group extreme value;

[0016] For each particle, update the particle's position information based on the particle's current velocity and previous position information.

[0017] In one embodiment, the method further includes:

[0018] After updating the position information of any particle, determine whether the updated position information is within the range of values ​​in the preset search space;

[0019] If not, the updated location information is transformed to obtain transformed location information; wherein the transformed location information is within the range of values.

[0020] In one embodiment, the method further includes:

[0021] After updating the position information of any particle, it is determined whether the loss difference of the particle evaluated by the loss function has decreased;

[0022] If the loss difference of the particles becomes smaller, the updated position information is determined as the individual extreme value of the particles.

[0023] In one embodiment, the method further includes:

[0024] After updating the position information of any particle, it is determined whether the minimum loss difference of all particles evaluated by the loss function has decreased;

[0025] If the minimum loss difference among all particles decreases, the updated position information of the particles is determined as the population extremum of all particles.

[0026] On the other hand, this application provides a filter parameter determination device for an equalizer, comprising:

[0027] The evaluation module is used to evaluate the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle by using a preset loss function. The position information of each particle corresponds to a set of filter parameters. The device frequency response and the target frequency response both include frequency responses at multiple frequency points. The loss function defines that when the difference between the device frequency response and the target frequency response at any frequency point is less than a preset difference threshold, the sub-loss difference at that frequency point is zero.

[0028] The judgment module is used to determine whether the loss difference is less than a preset loss threshold;

[0029] The update module is used to update the position information of all particles if the loss difference corresponding to all particles is not less than the loss threshold, and return the step of evaluating the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle by means of a preset loss function.

[0030] The determination module is used to repeat the above process until there is a target particle whose loss difference is less than the loss threshold, and the position information corresponding to the target particle is determined as the optimal solution of the filter parameters.

[0031] Furthermore, this application provides an electronic device, the electronic device comprising:

[0032] processor;

[0033] Memory used to store processor-executable instructions;

[0034] The processor is configured to execute the filter parameter determination method of the equalizer described above.

[0035] In addition, this application provides a computer-readable storage medium storing a computer program that can be executed by a processor to complete the above-described method for determining the filter parameters of the equalizer.

[0036] The proposed solution can use the PSO algorithm to solve for the optimal filter parameters of the equalizer. During the iterative update process, the loss function defines that when the difference between the device frequency response and the target frequency response at any frequency point is less than the difference threshold, the sub-loss difference at that frequency point is zero. This causes the particle population to quickly bias towards those particles with smaller deviations, ensuring that the particles do not make unnecessary jumps, accelerating convergence, and avoiding the risk of getting trapped in local optima when solving using SGD. Attached Figure Description

[0037] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly described below.

[0038] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0039] Figure 2 A flowchart illustrating a method for determining filter parameters of an equalizer according to an embodiment of this application;

[0040] Figure 3 A schematic diagram of an equalizer filter parameter determination method provided in an embodiment of this application;

[0041] Figure 4 A schematic diagram illustrating the variation of loss difference provided in an embodiment of this application;

[0042] Figure 5 A schematic diagram showing the comparison between the calibrated device frequency response and the target frequency response provided in an embodiment of this application;

[0043] Figure 6 A block diagram of an equalizer filter parameter determination device provided in an embodiment of this application. Detailed Implementation

[0044] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0045] Similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0046] like Figure 1As shown, this embodiment provides an electronic device 1, including: at least one processor 11 and a memory 12. Figure 1 Taking a processor 11 as an example, the processor 11 and memory 12 are connected via bus 10. Memory 12 stores instructions that can be executed by the processor 11. The instructions are executed by the processor 11 to enable the electronic device 1 to perform all or part of the process of the method in the embodiments described below. In one embodiment, the electronic device 1 may be a host, server, server cluster, or cloud computing center for executing the equalizer filter parameter determination method. The following description uses the electronic device as the execution subject.

[0047] The memory 12 can be implemented by 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 red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0048] This application also provides a computer-readable storage medium storing a computer program that can be executed by a processor 11 to perform the equalizer filter parameter determination method provided in this application.

[0049] See Figure 2 This is a flowchart illustrating a method for determining filter parameters of an equalizer according to an embodiment of this application. Figure 2 As shown, the method may include steps 210-240.

[0050] Step 210: Evaluate the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle using a preset loss function; wherein, the position information of each particle corresponds to a set of filter parameters, and both the device frequency response and the target frequency response contain frequency responses at multiple frequency points. The loss function is defined as follows: when the difference between the device frequency response and the target frequency response at any frequency point is less than a preset difference threshold, the sub-loss difference at the frequency point is zero.

[0051] Electronic devices use the Particle Swarm Optimization (PSO) algorithm to find the optimal solution for the filter parameters of an equalizer. Filter parameters can include gain, center frequency, and quality factor. When calibrating the frequency response curve of an device using an equalizer, the device may be calibrated using a single superimposed frequency response curve or multiple superimposed frequency response curves. Therefore, as needed, the position information of each particle in the PSO algorithm can be determined to correspond to the filter parameters of one frequency response curve or multiple frequency response curves. For example, if the position information corresponds to the filter parameters of one frequency response curve, the position information includes a gain, a center frequency, and a quality factor; if the position information corresponds to the filter parameters of two frequency response curves, the position information includes a gain, a center frequency, and a quality factor, as well as another gain, another center frequency, and another quality factor.

[0052] For any particle, given its current position information, one or more frequency response curves can be generated using the filter parameters in the position information to calibrate the device's frequency response curve. Therefore, the device's frequency response corresponding to the particle's position information is the calibrated device's frequency response parameter. The device's frequency response can include the frequency response at multiple frequency points; the number and location of these frequency points can be pre-configured as needed. The device's frequency response can be represented as {R1, R2, ..., R...} m}, where m is the number of frequency points, and the frequency response of the device is composed of the frequency responses at m frequency points.

[0053] The target frequency response refers to the frequency response parameters that a device should exhibit under ideal conditions. The target frequency response can include the frequency response at multiple frequency points; the number and location of these frequency points can be pre-configured as needed. The number and location of frequency points in the target frequency response are the same as those in the device's frequency response. The device's frequency response can be represented as {G1, G2, ..., G...} m}, where m is the number of frequency points, and the frequency response of the device is composed of the frequency responses processed by m frequency points.

[0054] After calculating the device frequency response based on the position information of any particle, the electronic device can use a loss function to calculate the sub-loss difference between the frequency response at each frequency point in the device frequency response and the frequency response at the target frequency response. After determining the sub-loss difference for each frequency point, the average of the sub-loss differences for all frequency points can be calculated as the loss difference between the device frequency response at the current position and the target frequency response. When calculating the sub-loss difference between the device frequency response and the target frequency at each frequency point, the loss function defines that if the difference between the device frequency response and the target frequency response at any frequency point is less than a difference threshold, the sub-loss difference at that frequency point is zero. The difference threshold can be configured as needed. In this case, if the difference between the device frequency response and the target frequency response at any frequency point is sufficiently small, it can be determined that the frequency response at that frequency point does not require further optimization.

[0055] Step 220: Determine whether the loss difference is less than the preset loss threshold.

[0056] After calculating the loss difference for the position information of any particle, the electronic device can determine whether the loss difference is less than a loss threshold. Here, the loss threshold can be pre-configured based on experience.

[0057] On the one hand, if the loss difference corresponding to the position information of the particle is less than the loss threshold, the particle can be determined to be the target particle, and the position information of the target particle is the optimal solution for the filter parameters. On the other hand, if the loss difference corresponding to the position information of the particle is not less than the loss threshold, the electronic device can perform the evaluation and judgment process of steps 210 to 220 on the position information of other particles until the above evaluation and judgment process is completed for all particles.

[0058] Step 230: If the loss difference for all particles is not less than the loss threshold, update the position information of all particles and return to the step of evaluating the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle through a preset loss function.

[0059] If the loss difference for all particles is not less than the loss threshold, the position information of all particles can be updated. Based on the current position information of each particle, new position information is obtained. After updating the position information of all particles, step 210 can be returned to recalculate the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle.

[0060] Step 240: Repeat the above process until there is a target particle whose loss difference is less than the loss threshold, and determine the position information of the target particle as the optimal solution for the filter parameters.

[0061] Steps 210 to 230 can be repeated multiple times until there is a particle whose position information corresponds to a loss difference that is less than the loss threshold. At this point, the particle is the target particle, and the position information corresponding to the target particle is the optimal solution for the filter parameters.

[0062] By employing the above measures, the optimal filter parameters of the equalizer can be solved using the PSO algorithm. During the iterative update process, the loss function defines that when the difference between the device frequency response and the target frequency response at any frequency point is less than the difference threshold, the sub-loss difference at that frequency point is zero. This causes the particle population to quickly bias towards those particles with smaller deviations, ensuring that the particles do not make unnecessary jumps, accelerating convergence, and avoiding the risk of getting trapped in local optima when solving using SGD.

[0063] In one embodiment, before performing step 210, the electronic device can initialize the position and velocity information of multiple particles within a preset search space. The search space defines the range of values ​​for the position information of the multiple particles. For example, if the position information of each particle corresponds to filter parameters of a frequency response curve, the search space defines the upper and lower limits of the gain, the upper and lower limits of the center frequency, and the upper and lower limits of the quality factor.

[0064] When initializing the position information of each particle, the initial position information of each particle is randomly generated and located within the search space, and the initial velocity information of each particle is zero. In addition, the total number of particles can be configured as needed.

[0065] In one embodiment, when evaluating the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle using a loss function, for each particle, the electronic device can determine the sub-loss difference at each frequency point between the device frequency response and the target frequency response corresponding to the particle's position information. Specifically, if the difference between the device frequency response and the target frequency response at any frequency point is less than a difference threshold, then the sub-loss difference at that frequency point is zero; if the difference between the device frequency response and the target frequency response at any frequency point is not less than the difference threshold, then the sub-loss difference at that frequency point is the square of the difference between the device frequency response and the target frequency response.

[0066] For each particle, the electronic device can determine the loss difference between the device frequency response and the target frequency response corresponding to the particle's position information based on the sub-loss differences of that particle at all frequency points. By calculating the mean of the sub-loss differences at all frequency points, the loss difference between the device frequency response and the target frequency response corresponding to the particle's position information can be obtained.

[0067] For example, the loss function can be expressed by the following formula (1):

[0068]

[0069] Where m represents the number of frequency points; R i G represents the frequency response at the i-th frequency point in the device's frequency response; i Let represent the frequency response at the i-th frequency point in the target frequency response; ε represents the difference threshold. I is the indicator function, when R... i and G i When the absolute value of the difference between them is less than the difference threshold, I is 1, and at this time, the sub-loss difference at the i-th frequency point is zero; when R i and G i The absolute value of the difference between them is not less than the difference threshold, and I is 0. At this time, the sub-loss difference at the i-th frequency point is (R i -G i ) 2 .

[0070] In one embodiment, when updating the position information of all particles, the electronic device updates the current velocity of each particle based on its previous velocity, previous position information, individual extreme value, and population extreme value. Here, the previous velocity refers to the particle's velocity before the current update; the previous position information refers to the particle's position information before the current update; the individual extreme value refers to the particle's current optimal position information, where the loss difference corresponding to the particle is minimized; and the population extreme value refers to the current optimal position information of all particles, where the minimum loss difference corresponding to the position information of all particles is minimized.

[0071] For example, the speed update process can be represented by the following formula (2):

[0072] V id = wV id + C1r1(P id - X id ) + C2r2(P gd - X id (2)

[0073] Where, V on the left side of the equation id Let represent the velocity information of the i-th particle in the d-th dimension after the update; w represents the preset inertia factor; C1 represents the preset individual cognitive acceleration; C2 represents the preset social cognitive acceleration; r1 and r2 are random numbers on [0,1], which will change with each update; V on the right side of the equation id This represents the velocity information of the i-th particle in the d-th dimension before the update; X id P represents the position information of the i-th particle in the d-th dimension before the update; id P represents the individual extreme value of the i-th particle in the d-th dimension; gd This represents the group extremum of all particles in the d-th dimension.

[0074] After updating the current velocity of the particles, for each particle, the electronic device can update the particle's position information based on the particle's current velocity and previous position information.

[0075] For example, the process of updating location information can be represented by the following formula (3):

[0076] X id = X id + V id (3)

[0077] Where, X on the left side of the equation id This represents the updated position information of the i-th particle in the d-th dimension; X on the right-hand side of the equation id V represents the position information of the i-th particle in the d-th dimension before the update; id Indicate the current velocity of the i-th particle in the d-th dimension.

[0078] Formulas (2) and (3) above calculate each dimension of the location information separately, but the algorithms for each dimension are actually the same. Here, if the location information includes a gain, a center frequency, and a quality factor, then the location information of the first dimension can be the gain, the location information of the second dimension can be the center frequency, and the location information of the third dimension can be the quality factor. The location information of each dimension can be updated using formulas (2) and (3) above, respectively.

[0079] In one embodiment, after updating the position information of any particle, the electronic device can determine whether the updated position information falls within a value range in a preset search space. For the gain, center frequency, and quality factor in the position information, each has a corresponding value range. Therefore, after updating the position information in any dimension, it is necessary to determine whether the position information in that dimension falls within its corresponding value range.

[0080] On the one hand, if the updated location information is within its corresponding value range, no processing is required. On the other hand, if the updated location information is not within its corresponding value range, the electronic device can convert the updated location information to obtain converted location information, where the converted location is within the value range.

[0081] For the position information of the i-th particle in the d-th dimension, if it is less than the minimum value in the range after the update, it can be converted using the following formula (4):

[0082] X id =x max -mod(x min -X id ,xmax -x min (4)

[0083] Where, X on the left side of the equation id This represents the updated position information of the i-th particle in the d-th dimension; x max This represents the maximum value within the range corresponding to the positional information of the d-th dimension; x min This represents the minimum value within the range corresponding to the location information of the d-th dimension; X on the right side of the equation id This represents the position information of the i-th particle in the d-th dimension before the update. Mod(a, b) represents the maximum r corresponding to n that makes a = n*b + r true, where a, b, and r are non-negative real numbers, and n is a natural number.

[0084] For the position information of the i-th particle in the d-th dimension, if the value after the update is greater than the maximum value in the range, it can be converted using the following formula (5):

[0085] X id =x min +mod(X id -x max ,x max -x min (5)

[0086] Where, X on the left side of the equation id This represents the updated position information of the i-th particle in the d-th dimension; x max This represents the maximum value within the range corresponding to the positional information of the d-th dimension; x min This represents the minimum value within the range corresponding to the location information of the d-th dimension; X on the right side of the equation id This represents the position information of the i-th particle in the d-th dimension before the update. Mod(a, b) represents the maximum r corresponding to n that makes a = n*b + r true, where a, b, and r are non-negative real numbers, and n is a natural number.

[0087] By taking the above measures, when the location information exceeds the value range after being updated, it can be converted so that the converted location information is within the value range, thereby avoiding invalid searches due to the location information exceeding the value range during the search for the optimal solution.

[0088] In one embodiment, after updating the position information of any particle, the electronic device can determine whether the loss difference of that particle, as evaluated by the loss function, has decreased. Here, since the position information includes multiple dimensions, the loss difference after this update can be evaluated using the loss function after all dimensions have been updated.

[0089] On the one hand, if the loss difference is not smaller than the loss difference corresponding to the particle's previous individual extreme value, it indicates that the updated position information is not better than the particle's previous individual extreme value. In this case, the individual extreme value can be kept unchanged. On the other hand, if the loss difference is smaller than the damage difference corresponding to the particle's previous individual extreme value, it indicates that the updated position information is better than the particle's previous individual extreme value. In this case, the updated position information can be determined as the particle's individual extreme value, and thus the individual extreme value can be updated.

[0090] By taking the above measures, the individual extreme values ​​of each particle can be updated during the search for the optimal solution.

[0091] In one embodiment, after updating the position information of any particle, the electronic device can determine whether the minimum loss difference among all particles evaluated by the loss function has decreased. Here, since the position information includes multiple dimensions, after updating all dimensions, the loss difference after this update can be evaluated using the loss function. The minimum loss difference among all particles is the loss difference corresponding to the population extremum.

[0092] On the one hand, if the loss difference is not smaller than the loss difference corresponding to the group extremum, it indicates that the updated position information is not better than the group extremum. In this case, the group extremum can be kept unchanged. On the other hand, if the loss difference is smaller than the loss difference corresponding to the group extremum, it indicates that the updated position information is better than the group extremum. In this case, the updated position information of this particle can be determined as the group extremum of all particles, and thus the group extremum can be updated.

[0093] By employing the above measures, the population extrema corresponding to all particles can be updated during the search for the optimal solution.

[0094] See Figure 3 This is a schematic diagram of an equalizer filter parameter determination method provided in an embodiment of this application, as shown below. Figure 3As shown, in the process of finding the optimal solution for filter parameters based on PSO, the total number of particles (setting particle size) and the position and velocity information of each particle are first initialized. For the device frequency response and target frequency response corresponding to the position information of each particle, the loss difference (loss value) is evaluated using a loss function. This process updates the individual extreme values ​​of each particle (current individual historical best) and the group extreme values ​​of all particles (current global best solution). Furthermore, the velocity and position information of each particle can be updated. After obtaining the loss difference corresponding to the position information of each particle, it can be determined whether the loss difference corresponding to the global best solution meets the requirement (less than the loss threshold). In one case, if the requirement is met, the global best solution can be used as the optimal solution for the filter parameters. In another case, if the requirement is not met, the loss difference corresponding to the position information of each particle can be re-evaluated using the loss function. This process can be repeated multiple times until the optimal solution for the filter parameters is finally obtained.

[0095] This application uses the PSO algorithm to find the optimal solution for the filter parameters, which can converge quickly. See [link to relevant documentation]. Figure 4 This is a schematic diagram illustrating the change in loss difference according to an embodiment of this application, as shown below. Figure 4 As shown, after the first 10 updates, the loss difference corresponding to the group extreme value can drop sharply to a very low level.

[0096] Figure 5 This is a schematic diagram comparing the calibrated device frequency response with the target frequency response, provided in one embodiment of this application. Figure 5 As shown, since the optimal solution for the filter parameters obtained by the PSO algorithm is the optimal solution among the individual extrema of all particles, and since the individual particles are randomly distributed throughout the entire search space, this optimal solution is the global optimal solution. At this point, the difference between the device frequency response curve (gray line) corresponding to the optimal solution of the filter parameters and the target frequency response curve (black line) is less than 1 dB, which meets the requirements.

[0097] Figure 6 This is a block diagram of a filter parameter determination device for an equalizer according to an embodiment of the present invention, as shown below. Figure 6 As shown, the device may include:

[0098] Evaluation module 610 is used to evaluate the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle by using a preset loss function; wherein, the position information of each particle corresponds to a set of filter parameters, the device frequency response and the target frequency response both include frequency responses at multiple frequency points, and the loss function defines that when the difference between the device frequency response and the target frequency response at any frequency point is less than a preset difference threshold, the sub-loss difference at that frequency point is zero;

[0099] The judgment module 620 is used to determine whether the loss difference is less than a preset loss threshold;

[0100] The update module 630 is used to update the position information of all particles if the loss difference corresponding to all particles is not less than the loss threshold, and return the step of evaluating the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle by means of a preset loss function.

[0101] The determination module 640 is used to repeat the above process until there is a target particle whose loss difference is less than the loss threshold, and determine the position information corresponding to the target particle as the optimal solution of the filter parameters.

[0102] The specific implementation process of the functions and roles of each module in the above-mentioned device can be found in the implementation process of the corresponding steps in the above-mentioned equalizer filter parameter determination method, and will not be repeated here.

[0103] The apparatuses and methods disclosed in the several embodiments provided in this application can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatuses, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0104] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0105] If a function is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

Claims

1. A method for determining filter parameters of an equalizer, characterized in that, include: A preset loss function is used to evaluate the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle. Each particle's position information corresponds to a set of filter parameters. Both the device frequency response and the target frequency response include frequency responses at multiple frequency points. The loss function defines that when the difference between the device frequency response and the target frequency response at any frequency point is less than a preset difference threshold, the sub-loss difference at that frequency point is zero. The device frequency response is the frequency response parameter of the calibrated device; the target frequency response is the frequency response parameter exhibited by the device under ideal conditions. Determine whether the loss difference is less than a preset loss threshold; If the loss difference corresponding to all particles is not less than the loss threshold, update the position information of all particles, and return to the step of evaluating the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle by using a preset loss function; Repeat the above process until there is a target particle whose loss difference is less than the loss threshold, and determine the position information of the target particle as the optimal solution for the filter parameters.

2. The method according to claim 1, characterized in that, Before evaluating the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle using a preset loss function, the method further includes: The position and velocity information of multiple particles are initialized within a preset search space; wherein, the search space limits the range of values ​​for the position information of the multiple particles, the position information of each particle is randomly generated, and the velocity information of each particle is initialized to zero.

3. The method according to claim 1, characterized in that, The step of evaluating the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle through a preset loss function includes: For each particle, determine the sub-loss difference between the device frequency response and the target frequency response at each frequency point corresponding to the particle's position information; if at any frequency point, the difference between the device frequency response and the target frequency response is not less than the preset difference threshold, the sub-loss difference at the frequency point is the square of the difference between the device frequency response and the target frequency response; For each particle, the loss difference between the device frequency response and the target frequency response corresponding to the particle's position information is determined based on the sub-loss difference of the particle at all frequency points.

4. The method according to claim 1, characterized in that, The step of updating the position information of all the particles includes: For each particle, update its current velocity based on its previous velocity, previous position information, individual extreme value, and group extreme value. For each particle, update its position information based on its current velocity and previous position information.

5. The method according to claim 4, characterized in that, The method further includes: After updating the position information of any particle, determine whether the updated position information is within the range of values ​​in the preset search space; If not, the updated location information is transformed to obtain transformed location information; wherein the transformed location information is within the range of values.

6. The method according to claim 4, characterized in that, The method further includes: After updating the position information of any particle, it is determined whether the loss difference of that particle as evaluated by the loss function has decreased; If the loss difference of the particle becomes smaller, the updated position information is determined as the individual extreme value of the particle.

7. The method according to claim 4, characterized in that, The method further includes: After updating the position information of any particle, determine whether the minimum loss difference of all particles evaluated by the loss function has decreased; If the minimum loss difference among all particles decreases, the updated position information of that particle is determined as the population extremum of all particles.

8. A device for determining filter parameters of an equalizer, characterized in that, include: The evaluation module is used to evaluate the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle using a preset loss function. Each particle's position information corresponds to a set of filter parameters. Both the device frequency response and the target frequency response include frequency responses at multiple frequency points. The loss function defines that when the difference between the device frequency response and the target frequency response at any frequency point is less than a preset difference threshold, the sub-loss difference at that frequency point is zero. The device frequency response is the frequency response parameter of the calibrated device; the target frequency response is the frequency response parameter exhibited by the device under ideal conditions. The judgment module is used to determine whether the loss difference is less than a preset loss threshold; The update module is used to update the position information of all particles if the loss difference corresponding to all particles is not less than the loss threshold, and return the step of evaluating the loss difference between the device frequency response and the target frequency response corresponding to the position information of each particle by means of a preset loss function. The determination module is used to repeat the above process until there is a target particle whose loss difference is less than the loss threshold, and the position information corresponding to the target particle is determined as the optimal solution of the filter parameters.

9. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store processor-executable instructions; The processor is configured to execute the filter parameter determination method for the equalizer according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that can be executed by a processor to perform the equalizer filter parameter determination method according to any one of claims 1-7.