Background technology
Present main flow equalizer (EQ) can roughly be divided into two classes: graphic equalizer and Parametric equalizer.On the whole, graphic equalizer is more directly perceived.It is divided into several fixing zones with whole audible spectrum, and each zone can be by the size of the gain of user's independent regulation or decay.Although graphic equalizer uses relatively simple, its limitation is also very obvious, is mainly manifested in the frequency field that the user is limited to reserve in advance, can't control accurately frequency response.Realize angle from it in addition, graphic equalizer uses finite impulse response (FIR) (FIR) filter usually, in order to have steady in the good band and the attenuation outside a channel performance, its single filter number of parameters is usually a lot, more FIR filter uses number (spectral band need be with a FIR filter in addition, all frequency spectrum needs 10 to 32 usually), its calculated performance and resource to system is brought very huge pressure.
The relative graphic equalizer of Parametric equalizer provides accurate control to frequency response to the user.The flatness of its frequency response is also very good.Parametric equalizer uses infinite impulse response (IIR) filter usually from realizing angle, the number of parameters of its single filter seldom, that the iir filter number that whole frequency spectrum uses also compares is less (common 5 to 7 enough), so very little to calculated performance and the resource consumption of system.Because these advantages of Parametric equalizer, its field of audio processing in specialty is widely used.
Although Parametric equalizer has a lot of advantages than graphic equalizer, a difficult point of its application is that the user need to carry out complicated and loaded down with trivial details adjustment to its FILTER TO CONTROL parameter, to reach desirable frequency response output.This difficult point has restricted a large amount of popularize of Parametric equalizer in domestic consumer.
In disclosed technology, for example, american documentation literature US6405227 discloses the method that a kind of operation parameter equalizer is realized EQ, and is fixing but the position of the parameter filter number in the method and centre frequency is, and also can't regulate.Again for example, american documentation literature US20040146170 discloses a kind of method with graphic equalizer realization Parametric equalizer, but the method uses DSP that each graphic equalizer fixed center frequency is carried out the gain reduction adjusting, but cost is very high.For example american documentation literature US20060114979 discloses user interface and the method for control parameter of the filter of manual adjustment Parametric equalizer again, but revise the control parameter (G of each filter in the method, f0, Q) be the part that needs the user repeatedly to revise and test, loaded down with trivial details and difficult usefulness very.And another american documentation literature US20060153404 discloses a kind of method of regulating Parametric equalizer.The method is only regulated the width of Parametric equalizer, and other parameters are not regulated.In addition, the method only only limits to the covering frequency range of single filter to error judgment, is limited to local optimum easily and the frequency response of non-integral bank of filters is optimum.
Thereby, how a kind of Automatic parameter optimization method of Parametric equalizer is proposed, to solve for Parametric equalizer complicated loaded down with trivial details this difficult problem of parameter adjustment in concrete application process, the real practitioner in the art's problem demanding prompt solution that become.
Summary of the invention
The shortcoming of prior art in view of the above, the object of the present invention is to provide a kind of Automatic parameter optimization method of Parametric equalizer, and then after in case the realization user sets the initial control parameter of each filter, system is with Automatic Optimal and revise the FILTER TO CONTROL parameter, until the purpose that its frequency response and user's default EQ coincide.
Reach for achieving the above object other relevant purposes, the invention provides a kind of Automatic parameter optimization method of Parametric equalizer, be used for behind user preset EQ, being optimized operation, described Parametric equalizer has a plurality of filters, it is characterized in that described Automatic parameter optimization method may further comprise the steps at least: the control parameter that 1) reads a filter in the described Parametric equalizer; 2) one of them adjusting range of controlling parameter and adjustment step-length are set, adjust number of times with the maximum of determining this control parameter; 3) calculate performance of filter parameter and the frequency response thereof of respectively controlling parameter value in the described adjusting range; 4) select an optimal control parameter value, make its frequency response values and described default EQ the most approaching; 5) dwindle the adjusting range of this control parameter and adjust step-length; 6) judge whether to reach the maximum number of times of adjusting of this control parameter, if not, then return step 3), if then proceed to next step; 7) judge this filter all control parameters all whether adjusted is complete, if not, then return step 2) read described filter another control parameter, if then proceed to next step; 8) all whether adjusted is complete to judge in the described Parametric equalizer all filters, if not, then returns step 1) read next filter in the described Parametric equalizer, if then proceed to next step; 9) generate each performance of filter parameter and frequency response chart; And 10) judge that according to described frequency response chart whether the frequency response of each filter matches with described default EQ, if not, then returns step 1), if then optimize and finish.
Step 1 in Automatic parameter optimization method of the present invention) in, the control parameter that reads a filter in the described Parametric equalizer is gain G, centre frequency f0 or bandwidth controlling value Q.
Concrete, in described step 2) in, keep described centre frequency f0 and bandwidth controlling value Q constant, the adjusting range of described gain G is set and adjusts step-length, adjust number of times with the maximum of determining described gain G; Perhaps, in described step 2) in, keep described gain G and bandwidth controlling value Q constant, the adjusting range of described centre frequency f0 is set and adjusts step-length, adjust number of times with the maximum of determining described centre frequency f0; Perhaps, in described step 2) in, keep described gain G and centre frequency f0 constant, the adjusting range of described bandwidth controlling value Q is set and adjusts step-length, adjust number of times with the maximum of determining described bandwidth controlling value Q.
In an execution mode, the step 10 of Automatic parameter optimization method of the present invention) comprise also in that one judges whether and the consistent step of optimum results last time, if not, then return step 1), if then optimize and finish.
In another execution mode, the step 10 of Automatic parameter optimization method of the present invention) comprise that also one judges whether to reach the step of largest optimization number of times in, if not, then return step 1), if then optimize and finish.
As mentioned above, the Automatic parameter optimization method of Parametric equalizer of the present invention has following beneficial effect:
One, use method of the present invention, in a single day the user sets and can allow the optimal value of system's its each filter parameter of Automatic-searching after the initial filter control parameter, this process is fully automatic, has greatly alleviated the loaded down with trivial details and burden that the user adjusts parameter repeatedly.
Two, method of the present invention is insensitive to the initial filter control parameter that the user arranges, even exist in the larger gap situation in user's initial parameter value and desirable optimal value, usually still can find the global optimization value.
Three, method optimizing process of the present invention is controlled, can not occur optimizing stagnating and locked situation.
Four, method optimizing process of the present invention can show in real time, reflects the frequency response of whole bank of filters and the relation between the default EQ and near process, is convenient to user's tracking comparison.
Five, method extensibility of the present invention is better, can be according to user's environment for use (machine performance height), increase and reduce adjusting range, the threshold values of adjusting step-length and revising largest optimization number of times or the goodness of fit is so that the user averages out at effect of optimization with between the optimization time.
Embodiment
Below by specific instantiation explanation embodiments of the present invention, those skilled in the art can understand other advantages of the present invention and effect easily by content disclosed in the present specification.The present invention can also be implemented or be used by other different embodiment, and the every details in this specification also can be based on different viewpoints and application, carries out various modifications or change under the spirit of the present invention not deviating from.
The invention provides a kind of Automatic parameter optimization method of Parametric equalizer, in order to behind user preset EQ, to be optimized operation, in other words, can need not manual repeatedly modification for its Automatic Optimal parameter by waiting system in case the user sets the initial control parameter of each filter, described Parametric equalizer has a plurality of filters.Be as shown in Figure 2, be shown as frequency response under the initial control parameter and the goodness of fit schematic diagram of user preset EQ, among the figure, curve table is shown the frequency response under the initial control parameter, and round dot is expressed as user preset EQ.
In present embodiment, for example be provided with N iir filter for the user, the performance of filter parameter b of each filter and a (b, a is vector) generate by following 3 control parameters, (Gain) G, centre frequency (Center Frequency) f0 and bandwidth controlling value Q namely gain, that is to say, namely in a single day described control parametric gain G, centre frequency f0, and bandwidth controlling value Q determine that the performance of filter parameter b of this filter and a have also just determined so.
See also Fig. 1, be shown as the Automatic parameter optimization method implementation flow chart of Parametric equalizer of the present invention.As shown in the figure, described Automatic parameter optimization method may further comprise the steps at least:
Execution in step S1 at first reads the control parameter of a filter in the described Parametric equalizer, in present embodiment, and the gain G that described control parameter is this filter, centre frequency f0, and bandwidth controlling value Q.Follow execution in step S2.
In step S2, the adjusting range of one of them control parameter is set and adjusts step-length, adjust number of times with the maximum of determining this control parameter, in present embodiment, keep described centre frequency f0 and bandwidth controlling value Q constant, the adjusting range of described gain G is set and adjusts step-length, adjust number of times with the maximum of determining described gain G, for example, the currency of i filter is G[i], determine that it optimizes adjustable range is GL and GH, so that GL<G[i]<GH; We can be with the value M-1 five equilibrium in this scope of GL-GH, so G[i] M probable value can just have been arranged, then M is the maximum number of times of adjusting.Follow execution in step S3,
In step S3, calculate performance of filter parameter and the frequency response thereof of respectively controlling parameter value in the described adjusting range; In present embodiment, namely calculate each G[i] performance of filter parameter and frequency response thereof in the value situation, in present embodiment, the present invention has used 3 kinds of iir filters, be low pass shelf filter (low shelf filter), high pass shelf filter (high shelf filter) and bell filter (peaking filter).For instance, such as bell filter peaking filter, the vector length of its performance parameter b is 3, the vector length of performance parameter a also is 3, is designated as respectively b0, b1, b2 and a0, a1, a2. so they from control parametric gain G, centre frequency f0, and bandwidth controlling value Q be calculated as follows:
At first calculate 3 medians:
A=sqrt (10^ (G/20)); W0=2*pi*f0/fs; Alpha=sin (w0)/(2*Q); Wherein, fs is sample frequency.
Then calculating filter performance parameter b and a:
b0=1+alpha*A
b1=-2*cos(w0)
b2=1-alpha*A
a0=1+alpha/A
a1=-2*cos(w0)
a2=1-alpha/A
Follow execution in step S4,
In step S4, select an optimal control parameter value, make its frequency response values and described default EQ the most approaching; In present embodiment, select optimum G[i] value, so that its frequency response values and described default EQ are the most approaching, particularly, the EQ of each frequency response values and user preset is carried out goodness of fit inspection (can judge the goodness of fit by certain computing formula, for example the mean square error of Weight and etc.), that G value that the goodness of fit is the highest is made as new G[i].Follow execution in step S5,
In step S5, dwindle the adjusting range of described control parameter and adjust step-length; In present embodiment, dwindle G[i] adjusting range and adjust step-length, be about to GL and GH and narrow down near the new G value, then still with the M-1 five equilibrium again of the value in this new range of GL-GH, so just the adjusting range of G value has been dwindled simultaneously with the adjustment step-length.Follow execution in step S6,
In step S6, judge whether to reach the maximum number of times of adjusting of this control parameter, if not, then return step 3), if then proceed to step S7;
In step S7, judge this filter all control parameters all whether adjusted is complete, if not, then return step 2) read described filter another control parameter, if then proceed to step S8; If return step 2) frequency f 0 centered by another control parameter of the described filter that reads, then keep described gain G and bandwidth controlling value Q constant, the adjusting range of described centre frequency f0 is set and adjusts step-length, adjust number of times with the maximum of determining described centre frequency f0.In like manner, if return step 2) another control parameter of the described filter that reads is bandwidth controlling value Q, then keep described gain G and centre frequency f0 constant, the adjusting range of described bandwidth controlling value Q is set and adjusts step-length, adjust number of times with the maximum of determining described bandwidth controlling value Q.In other words, in the present embodiment, the control parameter G of i filter just adjusts complete, then just can be to the optimization of another centre frequency f0 or the bandwidth controlling value Q of this filter.As space is limited, just repeat no more here, process roughly and the optimization of gain G are similar.
In step S8, all whether adjusted is complete to judge in the described Parametric equalizer all filters, if not, then returns step 1) read next filter in the described Parametric equalizer, if then proceed to step S9.
In step S9, generating each performance of filter parameter (is b, a) and frequency response chart.
In step S10, judge that according to described frequency response chart whether the frequency response of each filter matches with described default EQ, if not, then returns step 1), if then optimize and finish.In present embodiment, this step comprises that also one judges whether and the consistent step S101 of optimum results last time, if not, then returns step 1), if then optimize and finish.In other execution mode, can also comprise among the described step S10 that one judges whether to reach the step S101 of largest optimization number of times, if not, then return step 1), if then optimize and finish.
Need to prove, when one take turns optimize to finish after, system will generate performance of filter parameter b and a of each bank of filters automatically, and then generate the frequency response of synthesis filter performance parameter bg and ag and whole bank of filters.This frequency response will be compared with user's default EQ, if coincide, so whole Optimization Work finishes, otherwise will carry out next round optimization.Be as shown in Figure 3, be shown as frequency response and the goodness of fit schematic diagram of user preset EQ under the control parameter after optimizing, among the figure, control the frequency response under the parameter after curve table is shown and optimizes, round dot is expressed as user preset EQ.
In sum, in the Automatic parameter optimization method of Parametric equalizer of the present invention, in a single day the user sets and can allow the optimal value of system's its each filter parameter of Automatic-searching after the initial filter control parameter, this process is fully automatic, has greatly alleviated the loaded down with trivial details and burden that the user adjusts parameter repeatedly; And method of the present invention is insensitive to the initial filter control parameter that the user arranges, even exist in the larger gap situation in user's initial parameter value and desirable optimal value, usually still can find the global optimization value; Moreover method optimizing process of the present invention is controlled, can not occur optimizing stagnating and locked situation, and its optimizing process can show in real time, reflects the frequency response of whole bank of filters and the relation between the default EQ and near process, the tracking of being convenient to the user is compared.In addition, method extensibility of the present invention is better, can according to user's environment for use (machine performance height), increase and reduce adjusting range, the threshold values of adjusting step-length and revising largest optimization number of times or the goodness of fit is so that the user averages out at effect of optimization with between the optimization time.So the present invention has effectively overcome various shortcoming of the prior art and the tool high industrial utilization.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not is used for restriction the present invention.Any person skilled in the art scholar all can be under spirit of the present invention and category, and above-described embodiment is modified or changed.Therefore, have in the technical field under such as and know that usually the knowledgeable modifies or changes not breaking away from all equivalences of finishing under disclosed spirit and the technological thought, must be contained by claim of the present invention.