Active noise reduction algorithm parameter optimization method based on particle swarm optimization

文档序号:1230195 发布日期:2020-09-08 浏览:32次 中文

阅读说明:本技术 一种基于粒子群算法的主动降噪算法参数优化方法 (Active noise reduction algorithm parameter optimization method based on particle swarm optimization ) 是由 陈书明 蒋尧 周政道 张瑞 于 2020-06-03 设计创作,主要内容包括:本发明公开了一种基于粒子群算法的主动降噪算法参数优化方法,步骤1:种群的随机初始化;步骤2:将群体赋值给待求参数;步骤3:运行主动噪声控制算法,并计算适应度函数对应适应度值;步骤4:确定个体最优位置和全局最优位置;步骤5:判断迭代次数是否达到上限;若未达到则继续执行以下步骤6;若达到,则输出优化变量值;步骤6:对粒子的速度与位置进行更新,得到新的群体,之后再次执行步骤2至步骤5。(The invention discloses an active noise reduction algorithm parameter optimization method based on a particle swarm algorithm, which comprises the following steps of 1: randomly initializing a population; step 2: assigning the group to the parameter to be solved; and step 3: operating an active noise control algorithm and calculating a fitness value corresponding to a fitness function; and 4, step 4: determining an individual optimal position and a global optimal position; and 5: judging whether the iteration number reaches an upper limit or not; if not, continuing to execute the following step 6; if so, outputting an optimization variable value; step 6: and updating the speed and the position of the particles to obtain a new population, and then executing the steps 2 to 5 again.)

1. A particle swarm algorithm-based active noise reduction algorithm parameter optimization method is characterized in that,

step 1: randomly initializing a population;

step 2: assigning the group to the parameter to be solved;

and step 3: calculating a fitness function corresponding to the fitness value through an active noise control algorithm based on the FxLMS algorithm;

and 4, step 4: determining an individual optimal position and a global optimal position;

and 5: judging whether the iteration number reaches an upper limit or not; if not, continuing to execute the following step 6; if so, outputting an optimization variable value;

step 6: and updating the speed and the position of the particles to obtain a new population, and then executing the steps 2 to 5 again.

2. The particle swarm optimization-based parameter optimization method for the active noise reduction algorithm according to claim 1, wherein particles of a certain population size are generated in the step 1, and an initial velocity v of each particle is randomly initializedij(t ═ 0) and position xij(t ═ 0); wherein i is the number of the optimization parameter, i.e. the ith optimization parameter, j is the number of each particle, i.e. the jth particle, vij(t) velocity and x of jth particle representing ith optimization parameter at tth iterationij(t) represents the position of the jth particle of the ith-dimensional optimization parameter at the tth iteration.

3. The particle swarm optimization-based parameter optimization method for active noise reduction algorithm according to claim 1 or 2, wherein when the fixed-step FxLMS algorithm is adopted, when μ (n) ═ μ0,μ0For the purpose of setting, use the parameter var in step 2iLet mu stand for0=var1(ii) a Or

When mu (n) is not constant when adopting the step length FxLMS algorithm, then:

Figure FDA0002521980570000011

where α and β are constants greater than zero.

Using the parameters of step two, let α be var1,β=var2

4. The particle swarm algorithm-based active noise reduction algorithm parameter optimization method of claim 1 or 2,

in the step 3, the fitnessFitness value fitv of the function:

wherein n refers to the current iteration number, M refers to the total iteration number, and e (n) refers to the residual error value output by the active noise reduction simulation algorithm from iteration to the nth time.

5. The active noise reduction algorithm parameter optimization method based on the particle swarm optimization, according to claim 1 or 2, wherein in the step 4, during initial iteration, the current position of each particle is set as an individual optimal position pbest, after the initial iteration, the current position of each particle is compared with the historical optimal position of each particle, if the current position is more optimal, the pbest is replaced with the current position, otherwise, the individual optimal position is not changed; and comparing the optimal values pest of all the individuals with the current global optimal position gbest of the whole group, if the optimal value pest of a certain individual is more optimal, replacing the gbest with the optimal value pest, and if not, keeping the global optimal position unchanged.

6. The particle swarm optimization-based active noise reduction algorithm parameter optimization method according to claim 1 or 2, wherein in the step 6, the position and the speed of each particle are adjusted to make each particle move to its own historical optimal position and optimal position of the population, and the updated formula is as follows:

vij(t+1)=w·vij(t)+r1·c1(pbestij(t)-xij(t))+r2·c2·(gbesti(t)-xij(t))

xij(t+1)==xij(t)+vij(t+1)

where i is the number of each optimization parameter, i.e. the ith optimization parameter, j is the number of each particle, i.e. the jth particle, vij(t) and xij(t) velocity and position, pbest, of particle j of the ith-dimensional optimization variable at the tth iteration, respectivelyij(t) and pbesti(t) represents the jth optimization parameter at the tth iterationThe optimal position of the particle and the optimal position of the ith optimization variable of the whole population; w is the inertial weight, c1And c2Respectively a cognitive learning factor and a social learning factor, r1And r2Are all [0,1]The random number in (c).

7. The particle swarm optimization-based active noise reduction algorithm parameter optimization method of claim 5, wherein the inertia weight w is controlled by a linear adjustment method, the initial value of w should be larger, and as the iteration is performed, the value of w is gradually reduced, and the following linear adjustment method is adopted to control the value of w:

Figure FDA0002521980570000031

wherein w1And w2Respectively representing the initial value and the final value of the inertia weight, and T and T are respectively the current iteration times and the maximum iteration times of the whole optimization process.

Technical Field

The invention relates to the technical field of active noise control, in particular to an active noise reduction algorithm parameter optimization method based on a particle swarm algorithm.

Background

With the pursuit of comfort and NVH performance in the automobile, more and more attention is paid to noise in the automobile. The automobile is in a noise environment for a long time, so that driving safety is influenced, and physical and psychological health of people is greatly damaged. Therefore, controlling noise in the vehicle has become an important research direction in the automobile industry. The traditional passive noise control has good control effect on high-frequency noise, but not ideal control on low-frequency noise. And the active noise control utilizes the principle of sound wave interference, can play a good role in inhibiting low-frequency noise, and can effectively improve the quality of sound in the vehicle. The adaptive filtering algorithm is the core of active noise control, and the Least Mean Square (LMS) algorithm is widely applied due to the characteristics of simple algorithm and small calculation amount. However, in the active noise control practical application, a secondary sound channel exists, and the problem of instability occurs. Based on the characteristic, Widrow improves the LMS algorithm into a Filter-x Least mean square (FxLMS) algorithm to eliminate the influence of a secondary channel.

For the defect that the convergence speed and the steady-state error of the in-vehicle noise active control system adopting the fixed-step FxLMS algorithm cannot be considered, the technical scheme is characterized in that a larger step is used in the initial convergence stage of the algorithm to obtain a faster convergence speed, the weight vector gradually reaches the optimal value after the algorithm converges, a smaller step is used to obtain a smaller steady-state error, and when the residual error is gradually close to 0, the characteristic of slow change is required to be provided, so that the step is prevented from being greatly changed due to the occasional fluctuation of the error in the steady-state process. The similar step length adjusting mode is applied to the FxLMS algorithm adopted by the traditional in-vehicle noise active control system, and the actual noise reduction effect can be improved.

In experimental research or practical application, a trial and error method or an orthogonal method is generally adopted to determine an optimal value for a plurality of parameters involved in an algorithm, and the methods are complicated to operate and have low precision. The Particle Swarm Optimization (PSO) is an algorithm for optimizing based on social behaviors of individuals and groups, and belongs to the category of intelligent optimization algorithms. Similar to other group search algorithms, the particle swarm optimization algorithm guides individuals to dynamically move to an optimal interval according to the fitness of a group to the environment. The algorithm is unique in that each individual in the algorithm is only considered as a particle flying in a specific speed and direction in the whole optimizing space, and the whole optimizing process does not have evolutionary processes such as cross variation and recombination among the particles. The particle swarm optimization algorithm has the advantages of simple programming, easy realization, high optimization speed, obvious optimization effect and the like, and can effectively solve the problem of complex optimization. The PSO algorithm is applied to parameter selection of the active noise reduction algorithm, so that not only can the precision be improved, but also the time for parameter selection can be greatly shortened, and the efficiency of algorithm research or system debugging is improved.

Disclosure of Invention

The invention provides an active noise reduction algorithm parameter optimization method based on a particle swarm optimization algorithm, which is used for selecting parameters related to an active noise control algorithm through the particle swarm optimization algorithm and aiming at searching optimal parameters which enable a target function to be minimum.

An active noise reduction algorithm parameter optimization method based on particle swarm optimization,

step 1: randomly initializing a population;

step 2: assigning the group to the parameter to be solved;

and step 3: substituting the parameters obtained in the step 2, adopting an active noise control algorithm, and calculating a fitness value corresponding to a fitness function;

and 4, step 4: determining an individual optimal position and a global optimal position;

and 5: judging whether the iteration number reaches an upper limit or not; if not, continuing to execute the following step 6; if so, outputting an optimization variable value;

step 6: and updating the speed and the position of the particles to obtain a new population, and then executing the steps 2 to 5 again.

Preferably, the particles of a certain population size are generated in step 1, and the initial velocity v of each particle is randomly initializedij(t ═ 0) and position xij(t ═ 0); wherein i is the number of the optimization parameter, i.e. the ith optimization parameter, j is the number of each particle, i.e. the jth particle, vij(t) velocity and x of jth particle representing ith optimization parameter at tth iterationij(t) represents the position of the jth particle of the ith-dimensional optimization parameter at the tth iteration.

As a further preference, fixed step length FxLM is adoptedWhen the algorithm is S, when mu (n) is mu0,μ0For the purpose of setting, use the parameter var in step 2iLet mu stand for0=var1(ii) a Or

When mu (n) is not constant when adopting the step length FxLMS algorithm, then:

where α and β are constants greater than zero.

Using the parameters of step two, let α be var1,β=var2

As a further preferred option, in step 3, the fitness value fitv of the fitness function is:

wherein n refers to the current iteration number, M refers to the total iteration number, and e (n) refers to the residual error value output by the active noise reduction simulation algorithm from iteration to the nth time.

As a further preferred option, in the step 4, during the first iteration, the current position of each particle is set as an individual optimal position pbest, after the first iteration, the current position of each particle is compared with the historical optimal position of each particle, if the current position is more optimal, the pbest is replaced with the current position, otherwise, the individual optimal position is not changed; and comparing the optimal values pest of all the individuals with the current global optimal position gbest of the whole group, if the optimal value pest of a certain individual is more optimal, replacing the gbest with the optimal value pest, and if not, keeping the global optimal position unchanged.

As a further preference, in step 6, the position and speed of each particle are adjusted to make each particle move toward its own historical optimal position and optimal position of the population, and the updated formula is as follows:

vij(t+1)=w·vij(t)+r1·c1·(pbestij(t)-xij(t))+r2·c2·(gbesti(t)-xij(t))

xij(t+1)=xij(t)+vij(t+1)

where i is the number of each optimization parameter, i.e. the ith optimization parameter, j is the number of each particle, i.e. the jth particle, vij(t) and xij(t) velocity and position, pbest, of particle j of the ith-dimensional optimization variable at the tth iteration, respectivelyij(t) and pbesti(t) respectively representing the optimal position of the jth particle of the ith optimization parameter and the optimal position of the ith optimization variable of the whole population in the tth iteration; w is the inertial weight, c1And c2Respectively a cognitive learning factor and a social learning factor, r1And r2Are all [0,1]The random number in (c).

Preferably, the inertia weight w is controlled by a linear adjustment method, the initial value of w should be large, and the value of w is gradually reduced with the progress of iteration, and the value of w is controlled by the following linear adjustment method:

wherein w1And w2Respectively representing the initial value and the final value of the inertia weight, and T and T are respectively the current iteration times and the maximum iteration times of the whole optimization process.

The invention has the following beneficial effects:

compared with the trial-and-error method and the orthogonal method which are generally adopted in the prior art, the active noise reduction algorithm parameter optimization method based on the particle swarm optimization has the advantages that the intelligent selection of the optimal parameters can be realized through a program, and the efficiency and the precision of parameter selection are improved.

The similar step length adjusting mode is applied to the FxLMS algorithm adopted by the traditional in-vehicle noise active control system, and the actual noise reduction effect can be improved.

The method combines a particle swarm algorithm and an active noise control algorithm, undetermined parameters of the active noise control algorithm, which directly influence the noise reduction effect, are set as optimized parameters in the particle swarm algorithm, the mean square value of residual errors output by the active noise control algorithm is set as a fitness function or a target function of the particle swarm algorithm, and the particle swarm optimization algorithm guides an individual to dynamically move to an optimal interval according to the fitness of the swarm to the environment.

Drawings

FIG. 1 is a flow chart of a parameter optimization method of the present invention.

Fig. 2 is a block diagram of the FxLMS algorithm according to the present invention.

Fig. 3 is a diagram of an analog noise signal according to the present invention.

Fig. 4 is a diagram of the active noise reduction effect corresponding to the optimal parameter according to the present invention.

Fig. 5 shows the active noise reduction effect of the previous 1000 iterations corresponding to the optimal parameters described in the present invention.

Fig. 6 shows the active noise reduction effect of the first 1000-.

Detailed Description

The present invention is further described in detail below with reference to the attached drawings so that those skilled in the art can implement the invention by referring to the description text.

As shown in FIG. 1, the invention provides a particle swarm algorithm-based active noise reduction algorithm parameter optimization method, which combines a particle swarm algorithm and an active noise control algorithm, sets undetermined parameters of the active noise control algorithm, which directly affect the noise reduction effect, as optimization parameters in the particle swarm algorithm, sets the mean square value of residual errors output by the active noise control algorithm as a fitness function or a target function of the particle swarm algorithm, and aims to find the optimal parameters which minimize the target function.

The method comprises the following steps:

step 1: randomly initializing a population;

step 2: assigning the group to the parameter var to be solvedi

And step 3: calling the adopted active noise control algorithm by using the parameters obtained in the step 2, and calculating the corresponding fitness value of the fitness function as shown in FIG. 2;

the active noise control algorithm adopts FxLMS algorithm, and the reference signal x (n) passes through the primary path P (z) to obtain the estimated primary signal d (n), namely

d(n)=p(n)*x(n)

Where p (n) is the impulse response function of the primary path P (z).

At the same time, convolving the initial weight coefficient w (n) with the reference signal x (n) to obtain the output signal y (n), the results are as follows:

y(n)=wT(n)x(n)

the output signal y (n) is filtered by the secondary channel S (z) to obtain the secondary counteracting signal ys(n)

ys(n)=s(n)*y(n)

Where s (n) is the impulse response function of the secondary channel S (z).

Combining the primary signal d (n) and the secondary cancellation signal ys(n) subtracting to obtain an error signal e (n)

e(n)=d(n)-ys(n)

Simultaneous reference signal and secondary path estimation

Figure BDA0002521980580000062

Performing convolution operation to obtain filtered signal

Figure BDA0002521980580000063

Wherein the content of the first and second substances,

Figure BDA0002521980580000064

is a secondary channelThe impulse response function of (a).

Using filtered signals xf(n) and an error signal e (n) for updating the weight coefficients

w(n+1)=w(n)+2μ(n)xf(n)e(n)

The above process is repeated continuously, and active control of noise can be realized. Wherein, mu (n) is a step parameter, when mu (n) is mu0,μ0The algorithm is a fixed value and is called a fixed step length FxLMS algorithmMethod, using the parameter var in step 2iLet mu stand for0=variAnd performing fixed-step FxLMS algorithm operation. Wherein variWherein i is the number of the parameter to be solved, and only mu is in FXLMS algorithm0For each case, i is 1, and e (n) is determined.

When mu (n) is not a fixed value, the algorithm is called a variable step length FxLMS algorithm. In this example, the algorithm in the variable step length FxLMS algorithm takes:

where α and β are constants greater than zero.

Parameters α, β to be solved in the step length-variable FxLMS algorithm, and α is set to var by using the parameters in the step two1,β=var2The variable step length FxLMS algorithm is executed to calculate e (n).

Therefore, the parameters to be solved in the fixed-step FxLMS algorithm and the variable-step FxLMS algorithm are respectively mu0And α, β.

The fitness function here is defined as:

Figure BDA0002521980580000071

wherein n refers to the current iteration number, M refers to the total iteration number, and e (n) refers to the residual error value output by the active noise reduction simulation algorithm from iteration to the nth time. n is 1,2,3 … … M (see the above formula for fitv); the meaning represented by the self-fitness function or the target function is the mean square value of the residual error; and calculating the fitness value fitv corresponding to the fitness function.

And 4, step 4: determining an individual optimal position and a global optimal position;

and 5: and judging whether the iteration number reaches an upper limit or not. If not, continuing to execute the following steps; if so, outputting an optimization variable value, and ending the algorithm;

step 6: and updating the speed and the position of the particles to obtain a new population, and then executing the steps 2 to 5 again.

In the FxLMS algorithm for actively reducing the noise of the engine order in the vehicle, the parameter selection process is as follows:

step 1: and (4) randomly initializing the population. The algorithm firstly generates m particles with a certain population scale, and randomly initializes the initial velocity v of each particleij(t ═ 0) and position xij(t=0)。

Where i is the number of the optimization parameter (or optimization dimension), i.e. the ith optimization parameter, j is the number of each particle, i.e. the jth particle, vij(t) and xij(t) represents the velocity and position, respectively, of the jth particle of the ith-dimensional optimization parameter at the tth iteration.

Step 2: assigning the group to the parameter var to be solvedi

Where i refers to the number of the first parameter to be solved, which is consistent with the number of the aforementioned optimized parameter, the parameter to be solved is used by the active noise control algorithm.

And step 3: and adopting an active noise control algorithm and calculating a fitness value corresponding to the fitness function.

The fitness function here is defined as:wherein n refers to the current iteration number, M refers to the total iteration number, and e (n) refers to the residual error value output by the active noise reduction simulation algorithm from iteration to the nth time. The term "fitness function" or "objective function" as used herein means a mean square value of a residual error.

And 4, step 4: and determining an individual optimal position and a global optimal position.

During initial iteration, setting the current position of each particle as an individual optimal position pbest, after initial iteration, comparing the current position of each particle with the historical optimal position of each particle, if the current position is more optimal, replacing pbest with the current position, otherwise, keeping the individual optimal position unchanged; and comparing the optimal values pest of all the individuals with the current global optimal position gbest of the whole group, if the optimal value pest of a certain individual is more optimal, replacing the gbest with the optimal value pest, and if not, keeping the global optimal position unchanged. It should be noted that the value finally adopted in the active noise control algorithm is the value corresponding to the global optimal position.

And 5: judging whether the iteration number reaches an upper limit or not; if not, continuing to execute the following step 6; if so, outputting an optimization variable value, and ending the algorithm.

Step 6: and updating the speed and the position of the particles to obtain a new population, and then executing the step 2. Adjusting the position and the speed of each particle to enable each particle to move towards the optimal position of the self history and the optimal position of the population, and updating the formula as follows:

vij(t+1)=w·vij(t)+r1·c1·(pbestij(t)-xij(t))+r2·c2·(gbesti(t)-xij(t))

xij(t+1)=xij(t)+vij(t+1)

where i is the number of each optimization parameter (or optimization dimension), i.e. the ith optimization parameter, j is the number of each particle, i.e. the jth particle, vij(t) and xij(t) velocity and position, pbest, of particle j of the ith-dimensional optimization variable at the tth iteration, respectivelyij(t) and pbesti(t) represents the optimal position of the ith optimization parameter jth particle and the optimal position of the ith optimization variable of the whole population at the tth iteration respectively. w is the inertial weight, c1And c2Respectively a cognitive learning factor and a social learning factor, r1And r2Is [0,1 ]]The random number in (c).

The inertia weight w is generally controlled by a linear adjustment method, the initial value of w should be large, and as iteration progresses, the value of w is gradually reduced, and the value of w is controlled by the following linear adjustment method:

wherein w1And w2Preferably, the linear range of the weights is w ∈ [0.4,0.9 ]](ii) a C1, C2 are learning factors, C1 and C2 is in the range of [0,4 ]]Usually, c1 ═ c2 ═ 2 is taken.

The above process is repeated continuously to find the optimal parameter which minimizes the objective function.

The method provided by the invention is adopted to select the step length parameters in the fixed step length FxLMS algorithm and the variable step length FxLMS algorithm.

The block diagram of the FxLMS algorithm is shown in FIG. 2, where x (n) is a reference signal, d (n) is a primary noise signal, y (n) is an output signal, and ys(n) a secondary cancellation signal, e (n) an error signal, P (z) a primary path transfer function, S (z) a secondary path transfer function,

Figure BDA0002521980580000092

estimation of the secondary path transfer function. The difference between the fixed step length FxLMS algorithm and the variable step length FxLMS algorithm is whether the step length in the weight coefficient updating formula is a fixed value or not.

The weight coefficient updating formula of the fixed-step FxLMS algorithm is as follows:

w(n+1)=w(n)+2μe(n)xf(n)

wherein n is a time index, w (n) is a weight coefficient of the n-time algorithm, w (n +1) is a weight coefficient of the (n +1) -time algorithm, and μ is a step length which is a constant value which does not change along with time, is a parameter to be solved in the FxLMS algorithm, and is also an optimization parameter in the particle swarm algorithm.

The weight coefficient updating formula of the variable step length FxLMS algorithm is as follows:

w(n+1)=w(n)+2μ(n)e(n)xf(n)

mu (n) is weight update step at the moment n, and the expression of the step function mu (n) is

According to the in-vehicle noise characteristics, the relationship between the engine speed and the in-vehicle peak frequency is used to synthesize the in-vehicle analog noise signal under the steady-state working condition as shown in fig. 3. Aiming at the noise signal, active noise control simulation is carried out by a fixed step length FxLMS algorithm and a variable step length FxLMS algorithm respectively, and active noise reduction is carried outIn the noise algorithm, the order of a filter is taken as N-32, the sampling frequency is 8000Hz, and the parameter to be solved of the fixed-step FxLMS algorithm is the step size mu0And parameters to be solved of the variable step length FxLMS algorithm are α and β, wherein basic parameters of the particle swarm algorithm are set as that the population scale is 30, the inertial weight adopts a linear adjustment method, and the initial value w is1Is taken to be 0.9, the final value w2The value is 0.4, the number of iterations is 30, the acceleration factors c1 and c2 are 1.5, and the range of the parameter mu in the FxLMS algorithm is [0.01, 0.04 ] according to empirical values]The range of the parameter α in the variable step length FxLMS algorithm is [0.01, 0.04 ]]The parameter β is in the range of [200, 1000%]. And (4) performing iterative calculation by an algorithm to obtain the optimal parameters and the corresponding objective function values MSE shown in the table 1. The finally obtained optimal parameters are shown in table 1, and the corresponding active noise reduction results are shown in fig. 4, fig. 5 and fig. 6.

TABLE 1 active noise control algorithm parameters derived from particle swarm optimization and their corresponding objective function values MSE

While embodiments of the invention have been described above, it is not limited to the applications set forth in the description and the embodiments, which are fully applicable in various fields of endeavor to which the invention pertains, and further modifications may readily be made by those skilled in the art, it being understood that the invention is not limited to the details shown and described herein without departing from the general concept defined by the appended claims and their equivalents.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:电子设备、控制装置、控制方法及记录介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!