Signal filtering method and apparatus, storage medium, and electronic device
Patent Information
- Application Number
- CN202310155850.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-22
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-02-22
AI Technical Summary
[0005]鉴于此,本申请提供一种信号滤波方法、装置、存储介质及电子设备,以解决现有的无法在提高收敛速度的同时获得更优的稳态误差的问题
[0049]本申请上述的信号滤波方法,设置和误差信号相关的权系数向量,根据每一个权系数向量计算不同的梯度结果,再根据不同的梯度结果做对应的指数加权移动平均计算,得到梯度变化向量,梯度变化向量可区分误差信号的不同权重的影响占比,通过梯度变化向量和步长因子的联系来更新步长因子,并且步长因子μ(n)和梯度变化向量为非线性关系,从而在收敛过程中,步长因子μ(n)较大,收敛曲线下降速率快,实现快速收敛;在达到稳态后,步长因子变小,稳态误差更优。
Smart Images

Figure CN116318053B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic technology, specifically to a signal filtering method, apparatus, storage medium, and electronic device. Background Technology
[0002] The Least Mean Square (LMS) adaptive filtering algorithm is a search algorithm that works by continuously reducing the error between the desired signal and the filter output signal by updating the filter coefficients. The step size factor μ(n) is related to the updating of the filter coefficients. When updating the filter coefficients, the selection of the step size factor μ(n) directly affects the convergence speed and steady-state error of the LMS adaptive filtering algorithm. Generally, a larger μ(n) results in a faster convergence speed but a larger steady-state error; conversely, a smaller μ(n) results in a smaller steady-state error but a slower convergence speed. Therefore, finding a balance between the algorithm's convergence speed and steady-state error is a problem that urgently needs to be solved.
[0003] The step size factor μ(n) in the existing LMS adaptive filtering algorithm is also variable. Specifically, it is adjusted by establishing a nonlinear relationship between the step size factor μ(n) and the error signal (the difference between the output signal and the desired signal). However, using the relationship between the error signal and the step size factor to drive the iteration of the step size factor is still relatively coarse and the representation is relatively simple. Specifically, it has two drawbacks: First, the curve descent rate is slow during the convergence process, making it difficult to achieve fast convergence; second, the curve does not have a gradual change characteristic, and the step size is adjusted too quickly in the steady state phase.
[0004] Therefore, a signal filtering method is needed that can improve the convergence speed while obtaining better steady-state error. Summary of the Invention
[0005] In view of this, this application provides a signal filtering method, apparatus, storage medium, and electronic device to solve the problem that existing methods cannot achieve better steady-state error while improving convergence speed.
[0006] This application provides a signal filtering method, comprising:
[0007] Obtain the input signal and the desired signal at time n;
[0008] The output signal at that moment is calculated based on the input signal and the weight coefficient vector at the corresponding moment.
[0009] When the mean square value of the error signal between the desired signal and the output signal is not less than a set value, the step size factor is calculated based on the error signal, and the weight coefficient vector and the output signal at time n+1 are updated based on the step size factor.
[0010] Repeat the above steps until the mean square value of the error signal is less than the set value, then end the loop and output the final output signal.
[0011] Optionally, when the mean square value of the error signal between the desired signal and the output signal is not less than a set value, a step size factor is calculated based on the error signal, and the weight coefficient vector and output signal at time n+1 are updated based on the step size factor, including:
[0012] Calculate the error signal based on the desired signal and the output signal;
[0013] Determine whether the mean square value of the error signal is less than a set value;
[0014] If not, then calculate the step size factor based on the weight coefficient vector and the error signal, and update the weight coefficient vector at time n+1 based on the step size factor, the error signal and the input signal.
[0015] The output signal at time n+1 is calculated based on the weight coefficient vector at time n+1.
[0016] Optionally, calculating the step size factor based on the weight coefficient vector and the error signal includes:
[0017] A gradient change vector is obtained based on the weight coefficient vector and the error signal, such that each component vector of the gradient change vector is positively correlated with the exponentially weighted moving average of the gradient values of the corresponding component of the weight coefficient vector.
[0018] The gradient change vector is subjected to a bounded and nonlinear function transformation to obtain the step size factor, and the change magnitude of the step size factor is positively correlated with the change magnitude of the gradient change vector.
[0019] Optionally, the gradient change vector s(n) is:
[0020]
[0021] Where β is the smoothing coefficient, e(n) is the error signal at time n, and w(n) is the weight coefficient vector at time n.
[0022] Optionally, after calculating the step size factor, the method further includes:
[0023] The maximum value μ of the step size factor at time n is determined by the following formula. max :
[0024] μ max =x(n)*x(n) T / n,
[0025] Where x(n) is the input signal at time n, if the calculated step size factor is greater than μ max Then let μ(n) = μ max .
[0026] Optionally, the step size factor μ(n) can be obtained by performing a bounded and nonlinear function transformation on the gradient change vector using the following formula:
[0027] μ(n) = p*arctan{b*abs[s(n)]}
[0028] Where s(n) is the gradient change vector, p controls the magnitude of the step size change, and b controls the speed of the step size change.
[0029] Optionally, the method for obtaining the step size factor by performing a bounded and nonlinear function transformation on the gradient change vector includes:
[0030] The step size factor μ(n) is obtained by performing a bounded and nonlinear function transformation on the gradient change vector using the following formula:
[0031]
[0032] Where p controls the magnitude of the step size change, and b controls the speed of the step size change.
[0033] Optionally, calculating the output signal at that moment based on the input signal and the weight coefficient vector at the corresponding moment includes:
[0034] The input signal x(n) at time n is compared with the weight coefficient vector w(n) = [w1(n), w2(n), ..., wn(n)] at time n. M (n)] T After multiplication, the weight coefficient vector is initialized as w(M) = [0, 0, ..., 0]. T The output signal y(n) = w at time n is obtained. T (n)*x(n).
[0035] Optionally, the input signal is x(n) = [x(n), x(n-1), ..., x(n-M+1)] T , where N is the signal length, M is the order of the LMS adaptive filter, M is a constant greater than 0, and n∈[M,N].
[0036] Optionally, the method for obtaining the desired signal includes:
[0037] Use the actual measurement value at time n as the desired signal.
[0038] Optionally, the weight coefficient vector w(n+1) at time n+1 can be calculated using the following formula:
[0039]
[0040] Where e(n) is the error signal at time n, w(n) is the weight coefficient vector at time n, and μ(n) is the step size factor at time n.
[0041] Optionally, the range of the set value is 0.01-0.1.
[0042] This application also provides a signal filtering device, including:
[0043] The acquisition module is used to acquire the input signal and the desired signal at time n;
[0044] The first calculation module is used to calculate the output signal at that moment based on the input signal and the weight coefficient vector at the corresponding moment.
[0045] The second calculation module is used to calculate the step size factor based on the error signal when the mean square value of the error signal between the expected signal and the output signal is not less than a set value, and to update the weight coefficient vector and the output signal at time n+1 based on the step size factor.
[0046] The processing module is used to repeatedly execute the processing steps of the second calculation module until the mean square value of the error signal is less than the set value, at which point the loop ends and the final output signal is output.
[0047] This application also provides a storage medium storing a plurality of instructions adapted for loading by a processor to perform the steps of the signal filtering method according to any one of claims 1 to 10.
[0048] This application also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, it performs the signal filtering method described above.
[0049] The signal filtering method described in this application sets a weight coefficient vector related to the error signal, calculates different gradient results based on each weight coefficient vector, and then performs corresponding exponentially weighted moving average calculations based on the different gradient results to obtain a gradient change vector. The gradient change vector can distinguish the influence ratio of different weights of the error signal. The step size factor is updated through the relationship between the gradient change vector and the step size factor. Furthermore, the step size factor μ(n) and the gradient change vector have a non-linear relationship. Therefore, during the convergence process, a larger step size factor μ(n) results in a faster descent rate of the convergence curve, achieving rapid convergence. After reaching a steady state, the step size factor decreases, resulting in better steady-state error. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a schematic flowchart of a signal filtering method according to an embodiment of this application;
[0052] Figure 2 This is a schematic diagram of the process of obtaining the step size factor μ(n) based on the error signal e(n) and the weight coefficient vector w(n) according to an embodiment of this application;
[0053] Figure 3 This is a comparison diagram of the errors of the filtering method using this scheme and the traditional fixed step size filtering method according to an embodiment of this application.
[0054] Figure 4 This is a schematic diagram of the structure of a signal filtering device according to an embodiment of this application. Detailed Implementation
[0055] In existing technologies, a larger step size factor results in a greater change in the error signal, indicating that the output signal approaches the desired signal by a larger margin. This leads to faster convergence speed but also a larger steady-state error. Conversely, a smaller step size factor results in a greater change in the error signal, indicating that the output signal approaches the desired signal d1 by a smaller margin. This leads to slower convergence speed but a smaller steady-state error.
[0056] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. In the absence of conflict, the following embodiments and their technical features can be combined with each other.
[0057] Please see Figure 1 This is a schematic flowchart of a signal filtering method according to an embodiment of this application.
[0058] In this embodiment, the signal filtering method includes the following steps:
[0059] Step S11. Obtain the input signal x(n) at time n and the desired signal d(n) at time n.
[0060] In this embodiment, the input signal x(n) at time n is the signal to be filtered, and the desired signal d(n) is the output signal after filtering under ideal conditions. It is understood that during filtering, the closer the output signal after filtering is to the desired signal d(n), the better the filtering effect.
[0061] Step S12. The input signal x(n) is multiplied by the weight coefficient vector w(n) at the corresponding time to obtain the output signal y(n) at that time.
[0062] The initial output signal y(n) differs significantly from the desired signal d(n), failing to meet the requirement for direct output. Therefore, further processing of the output signal y(n) is necessary to reduce the error between the output signal y(n) and the desired signal d(n), as follows:
[0063] Step S13. Obtain an error signal e(n) based on the desired signal d(n) and the output signal y(n), wherein the error signal e(n) is positively correlated with the difference between the desired signal d(n) and the output signal y(n).
[0064] In this embodiment, the error signal e(n) characterizes the difference between the desired signal d(n) and the output signal y(n). The smaller the error signal e(n), the closer the output signal y(n) is to the desired signal d(n). The error signal e(n) may be non-linearly positively correlated with the difference between the desired signal d(n) and the output signal y(n), or linearly positively correlated. Furthermore, the error signal e(n) may be directly proportional to the difference between the desired signal d(n) and the output signal y(n), i.e., e(n) = a[y(n) - d(n)], where a is a coefficient.
[0065] Step S14. Obtain the step size factor μ(n) based on the error signal e(n) and the weight coefficient vector w(n).
[0066] Step S15. Determine the square of the error signal e 2 (n) Whether it is less than the set value Z.
[0067] Step S16. If the judgment result is negative, then according to the step size factor μ(n), the error signal e(n) and the input signal x(n), update the weight coefficient vector w(n) to obtain the weight coefficient vector w(n+1) at time n+1; then update the output signal y(n) to obtain the output signal y(n+1) at time n+1.
[0068] In this way, each update of the weight coefficient vector w(n) can update the output signal y(n), making the updated output signal y(n) closer to the desired signal d(n) each time.
[0069] Step S17. Repeat the above steps until the square of the error signal e is reached. 2 The loop ends when (n) is less than the set value Z, and the final signal Y is output.
[0070] In this embodiment, the square of the error signal e 2 The smaller (n) is, the closer the final output signal Y is to the desired signal d(n).
[0071] The setpoint Z is a pre-set positive value that determines the square of the error signal e. 2 (n) The number of iterations. According to the algorithm requirements, the smaller the set value Z, the smaller the square of the error signal e. 2 (n) The more iterations there are, the greater the square of the error signal e. 2 If (n) is less than the set value Z, the output signal y is closer to the desired signal d(n).
[0072] In this embodiment, on the one hand, the gradient change vector s(n) is related to the error signal e(n) and the weight coefficient vector w(n), and the error signal e(n) and w(n) are also related; therefore, the gradient change vector s(n) can characterize the error signal e(n). On the other hand, each component vector of the gradient change vector s(n) is positively correlated with the exponentially weighted moving average of the corresponding component gradient values of the weight coefficient vector w(n); therefore, the gradient change vector s(n) can distinguish the influence ratio of different weights of the error signal e(n), and the step size factor μ(n) is updated through the relationship between the gradient change vector s(n) and the step size factor μ(n), thus solving the problem of coarse characterization of the error signal e(n) as a variable step size variable.
[0073] Furthermore, the step size factor μ(n) and the gradient change vector s(n) have a nonlinear relationship. Therefore, during the convergence process, the step size factor μ(n) is larger, the convergence curve descent rate is faster, and fast convergence is achieved. After reaching steady state, the step size factor μ(n) becomes smaller, and the steady state error is better.
[0074] In this embodiment, please refer to Figure 2 The method for obtaining the step size factor μ(n) based on the error signal e(n) and the weight coefficient vector w(n) in step S14 includes steps S141 to S142:
[0075] Step S141. Obtain the gradient change vector s(n) based on the weight coefficient vector w(n) and the error signal e(n), such that each component vector of the gradient change vector s(n) is positively correlated with the exponentially weighted moving average of the gradient values of the corresponding components of the weight coefficient vector w(n).
[0076] Each component of s(n) is an exponentially weighted moving average of the squared gradient values of the corresponding component of the weight vector coefficient w. A larger s(n) component value indicates a larger average change in the value of the component corresponding to the weight vector coefficient w, while a smaller s(n) component value indicates a smaller average change in the value of the component corresponding to the weight vector coefficient w.
[0077] Among them, the exponentially weighted moving average is generated by smoothing the current value by comparing it with the previous period, thus creating a smooth trend curve.
[0078] Step S142. Perform a bounded and nonlinear function transformation on the gradient change vector s(n) to obtain the step size factor μ(n), and the change magnitude of the step size factor μ(n) is positively correlated with the change magnitude of the gradient change vector s(n).
[0079] Based on the above explanation, a nonlinear mathematical relationship is established between the smoothed gradient change vector s(n) and the step size factor μ(n) to realize the real-time update of the step size μ(n). When the gradient change amplitude is large, the step size factor μ(n) is increased accordingly, and when the gradient change amplitude is small, a smaller step size factor μ(n) is used. This method aims to achieve a balance between convergence speed and steady-state error.
[0080] The gradient change vector s(n) is used to replace the error signal e(n) as the independent variable of the step size factor μ(n). The nonlinear mathematical relationship between the gradient change vector s(n) and the step size factor μ(n) must be a bounded function with a range of varying rates of change. Thus, when the step size factor μ(n) is large, the convergence curve descent rate is fast, achieving rapid convergence. After reaching steady state, the step size factor becomes smaller, resulting in better steady-state error.
[0081] In this embodiment, the gradient change vector s(n) is used to distinguish different weights of the error signal e(n). For example, the update speed of the gradient change vector s(n) on the component with a large change amplitude can be reduced, while the update speed on the component with a small change amplitude can be increased, thereby stabilizing the steady-state error.
[0082] Furthermore, in one embodiment, step S11, the method for obtaining the input signal x(n) at time n and the desired signal d(n) at time n, includes:
[0083] The input signal obtained at time n is x(n) = [x(n), x(n-1), ..., x(n-M+1)]. T Where N is the signal length, M is the order of the LMS adaptive filter, M is a constant greater than 0, and n∈[M,N]; the initialization step size factor setting must satisfy:
[0084]
[0085] Where, λ max It is the largest eigenvalue of the correlation matrix of the input signal.
[0086] Furthermore, in one embodiment, the method for obtaining the desired signal d(n) in step S11 includes: using the actual measurement value at time n as the desired signal.
[0087] The actual measured value refers to the measured value of the physical quantity corresponding to the final signal obtained through actual measurement methods. For example, in one embodiment, the output signal is the current value flowing through the target device. The method for measuring the actual measured value at time n includes: connecting a resistor in series with the target device, detecting the voltage across the resistor, and dividing the voltage value by the resistance value according to Ampere's law to obtain the actual current flowing through the target device, which is the actual measured value at time n. In other embodiments, other methods of actual measurement can be performed according to the physical meaning of the actual output signal, which are not limited here.
[0088] In one embodiment, step S12, multiplying the input signal x(n) with the weight coefficient vector w(n) at the corresponding time to obtain the output signal y(n) at that time, includes: multiplying the input signal x(n) at time n with the weight coefficient vector w(n) = [w1(n), w2(n), ..., w M (n)] T After multiplication, the weight coefficient vector is initialized as w(M) = [0, 0, ..., 0]. T The output signal y(n) = w at time n is obtained. T (n)*x(n).
[0089] In one embodiment, in step S13, the difference between the expected signal d(n) and the output signal y(n) directly represents the error signal e(n), that is, e(n) = y(n) - d(n), which makes the calculation process simpler.
[0090] In one embodiment, in step 14, the maximum value μ of the step size factor μ(n) at time n (n > M) is further determined. max To ensure algorithm stability, μ max =x(n)*x(n) T / n, if the calculated step size factor μ(n) is greater than μ max Then let μ(n) = μ max .
[0091] In one embodiment, for step S141, a gradient change vector s(n) is obtained based on the weight coefficient vector w(n) and the error signal e(n), such that each component vector of the gradient change vector s(n) is positively correlated with the exponentially weighted moving average of the gradient values of the corresponding component of the weight coefficient vector w(n).
[0092] The gradient change vector s(n) can also be constructed using any of the following formulas:
[0093]
[0094]
[0095]
[0096]
[0097] Where β is the smoothing coefficient.
[0098] In one embodiment, for step S142, the gradient change vector s(n) is subjected to a bounded and nonlinear function transformation to obtain the step size factor μ(n), and the change magnitude of the step size factor μ(n) is positively correlated with the change magnitude of the gradient change vector s(n).
[0099] The step size factor μ(n) is obtained by performing a bounded and nonlinear function transformation on the gradient change vector s(n) using the expression μ(n)=p*arctan{b*abs[s(n)]}. Here, p controls the magnitude of the step size change, and b controls the rate of change of the step size. The steady-state misalignment is reduced based on the magnitude of the absolute error, so that the parameters converge and tend to be stable.
[0100] The arctangent function is a positive function of the independent variable, and it changes rapidly near the origin and slowly away from the origin. Therefore, the rate of change of the step size factor μ(n) can be adjusted. Moreover, the arctangent function is a bounded function, and its calculation results will not diverge. Therefore, in the later stages of the change, the rate of change of the step size factor μ(n) becomes slower and slower, making the steady-state error smaller and smaller.
[0101] This scheme uses the gradient change vector s(n) instead of the error signal e(n) as the independent variable of the variable step size function, where the variable step size function must be a bounded function with a range of varying rates of change.
[0102] In other alternative embodiments, the step size factor μ(n) can also be obtained by performing a bounded and nonlinear function transformation on the gradient change vector s(n) using the sigmoid function. The expression is as follows:
[0103]
[0104] Where p controls the magnitude of the step size change, and b controls the rate of change of the step size.
[0105] In one embodiment, in step S16, the weight coefficient vector w(n+1) at time n+1 is:
[0106]
[0107] The output signal y(n+1) at time n+1 can be calculated, and the output signal can be continuously iterated and updated to make the output signal y(n) closer to the desired signal d(n).
[0108] In one embodiment, in step S17, the set value Z is 0.01-0.1. The smaller the set value Z, the larger the square of the error signal e. 2 The smaller the final change of (n), the smaller the error of the output signal y(n) relative to the desired signal d(n).
[0109] The present invention also provides an embodiment of applying the above-described signal filtering method to predict speaker current.
[0110] This embodiment is based on the adaptive iterative process constructed using the method of the foregoing embodiments, used to predict the current passing through the speaker, and includes the following steps:
[0111] Step S21. Obtain the input signal x(n) at time n and the desired signal d(n) at time n.
[0112] Specifically, in this embodiment, Gaussian white noise with an amplitude of -10dB is obtained as the original signal, with a signal length of 10s. At a sampling rate of 48kHz, N is 480000. After passing through a power amplifier, the voltage corresponding to the signal to the speaker is obtained. This voltage is used as the input signal x(n) of the LMS adaptive filter. The input signal at time n is x(n) = [x(n), x(n-1), ..., x(n-M+1)]. T Where n∈[M,N], the order M of the LMS adaptive filter is 8, and the initial step size μ(n)=0.05.
[0113] The method for obtaining the desired signal d(n) includes: by connecting a 0.2-ohm resistor in series with the speaker, taking the voltage across the resistor and dividing it by 0.2 ohms to obtain the current passing through the speaker, and using the current as the desired signal d(n).
[0114] Step S22. Combine the input signal x(n) at time n with the weight coefficient vector w(n) = [w1(n), w2(n), ..., w M (n)] TAfter multiplication, the weight coefficient vector is initialized as w(M) = [0, 0, ..., 0]. T The output signal y(n) of the LMS adaptive filter at time n is obtained. y(n) is calculated by the following formula: y(n) = w T (n)*x(n).
[0115] Step S23. Subtract the expected signal d(n) from the output signal value y(n) to obtain the error signal e(n) at time n. The error signal e(n) at time n is calculated by the following formula: e(n) = y(n) - d(n).
[0116] Step S24. Obtain the step size factor μ(n) based on the error signal e(n) and the weight coefficient vector w(n); μ(n) is a variable step size factor, which is a function of the error signal e(n) at time n:
[0117] The step size factor μ(n) is calculated according to the expression μ(n)=p*arctan{b*abs[s(n)]}.
[0118] Here, p controls the magnitude of the step size change, p∈[0,1], and b controls the rate of change of the step size, b∈[0,1]. Here, p and b are set to 0.05 and 0.1 respectively, and the smoothing coefficient β in the gradient change vector s(n) is set to 0.75, β∈[0,1].
[0119] Step S25. Determine the square e of the error signal. 2 (n) Whether it is less than the set value Z; where Z is set to 0.01.
[0120] Step S26. If the judgment result is negative, then using the error signal e(n) at time n, the step size factor μ(n), and the input signal x(n), calculate the weight coefficient vector w(n+1) of the LMS adaptive filter at time n+1. w(n+1) is calculated by the following formula:
[0121]
[0122] Then, the updated w(n+1) is used to calculate the output signal y(n+1) at time n+1.
[0123] Step S27. Repeat the above steps until the square of the error signal e is reached. 2 When (n) < 0.01, the loop ends and the final signal Y is output. At this time, the product of the weight coefficient vector and the input signal of the filter is the final filtered signal, i.e., the predicted current signal.
[0124] Please see Figure 3 The figure shows a comparison of the error e(n) obtained by using this method and the traditional fixed step size filtering method.
[0125] The method of the present invention is further illustrated by comparative simulation experiments. Figure 3 It is known that the traditional fixed-step-size LMS adaptive filtering method converges slowly and has a large error fluctuation range. In contrast, the proposed method uses a larger step size before reaching a steady state, which means a faster convergence speed. After reaching a steady state, the step size fluctuation is minimized, indicating better stability. In summary, the proposed LMS adaptive filtering method with a variable step size factor exhibits superior overall performance, faster convergence speed, and better stability.
[0126] In one embodiment, this application also provides a signal filtering device, comprising:
[0127] The acquisition module 301 is used to acquire the input signal and the desired signal at time n;
[0128] The first calculation module 302 is used to calculate the output signal at that moment based on the input signal and the weight coefficient vector at the corresponding moment.
[0129] The second calculation module 303 is used to calculate the step size factor based on the error signal when the mean square value of the error signal between the expected signal and the output signal is not less than a set value, and to update the weight coefficient vector and the output signal at time n+1 based on the step size factor.
[0130] The processing module 304 is used to repeatedly execute the processing steps of the second calculation module until the mean square value of the error signal is less than the set value, at which point the loop ends and the final output signal is output.
[0131] In addition, embodiments of this application also provide a storage medium storing a plurality of instructions adapted for loading by a processor to execute the steps in the above-described signal filtering method.
[0132] Embodiments of this application also provide an electronic device, including a processor and a memory. The memory stores a computer program, which, when executed by the processor, performs the signal filtering method described above. The electronic device may be a mobile phone, tablet computer, smartwatch, or other terminal device.
[0133] By implementing this filtering method, the electronic device of this application can achieve rapid convergence during the filtering and convergence processes by having a larger step size factor μ(n) and a faster descent rate of the convergence curve. After reaching a steady state, the step size factor becomes smaller, resulting in better steady-state error and thus outputting a more stable signal with smaller error.
[0134] Although this application has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art based on a reading and understanding of this specification and drawings. This application includes all such modifications and variations and is limited only by the scope of the appended claims. In particular, with respect to the various functions performed by the aforementioned components, the terminology used to describe such components is intended to correspond to any component (unless otherwise indicated) that performs the specified function of said component (e.g., is functionally equivalent to it), even if structurally not equivalent to the disclosed structure performing the functions in the exemplary implementations of this specification shown herein.
[0135] That is, the above description is only an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made using the content of this application’s specification and drawings, such as the combination of technical features between different embodiments, or direct or indirect application in other related technical fields, are similarly included within the patent protection scope of this application.
[0136] The above description has been provided to enable any person skilled in the art to implement and use this application. Various details have been set forth in the above description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be implemented without using these specific details. In other embodiments, well-known structures and processes will not be described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed herein.
Claims
1. A signal filtering method, characterized in that, include: Obtain the input signal and the desired signal at time n; The output signal at that moment is calculated based on the input signal and the weight coefficient vector at the corresponding moment. When the mean square value of the error signal between the expected signal and the output signal is not less than a set value, a step size factor is calculated based on the error signal, and the weight coefficient vector and output signal at time n+1 are updated based on the step size factor. This includes: calculating the error signal based on the expected signal and the output signal, and determining whether the mean square value of the error signal is less than a set value; if not, then based on the weight coefficient vector w(n) at time n, the error signal e(n) at time n, and the relational expression... A gradient change vector s(n) is obtained, where β is a smoothing coefficient, such that each component vector of the gradient change vector is positively correlated with the exponentially weighted moving average of the gradient values of the corresponding components of the weight coefficient vector. A bounded and nonlinear function transformation is performed on the gradient change vector to obtain the step size factor, and the change amplitude of the step size factor is positively correlated with the change amplitude of the gradient change vector. Then, based on the step size factor, the error signal, and the input signal, the weight coefficient vector at time n+1 is updated, and the output signal at time n+1 is calculated based on the weight coefficient vector at time n+1. Repeat the above steps until the mean square value of the error signal is less than the set value, then end the loop and output the final output signal.
2. The signal filtering method according to claim 1, characterized in that, After calculating the step size factor, the method further includes: The maximum value μ of the step size factor at time n is determined by the following formula. max : μ max = x(n)* x(n) T / n, Where x(n) is the input signal at time n, if the calculated step size factor is greater than μ max Then let μ(n) = μ max .
3. The signal filtering method according to claim 1, characterized in that, The step size factor μ(n) is obtained by performing a bounded and nonlinear function transformation on the gradient change vector using the following formula: μ(n) = p * arctan{b * abs[s(n)]} Where p controls the magnitude of the step size change, and b controls the speed of the step size change.
4. The signal filtering method according to claim 1, characterized in that: The step size factor μ(n) is obtained by performing a bounded and nonlinear function transformation on the gradient change vector using the following formula: Where p controls the magnitude of the step size change, and b controls the speed of the step size change.
5. The signal filtering method according to claim 1, characterized in that, The step of calculating the output signal at a given time based on the input signal and the weight coefficient vector at the corresponding time includes: The input signal x(n) at time n and the weight coefficient vector w(n) = [w1(n), w2(n), ..., wn] at time n are compared. M (n)] T Multiply the vector and initialize the weight coefficients as w(M) = [0, 0, ..., 0]. T The output signal y(n) = w at time n is obtained. T (n)*x(n).
6. The signal filtering method according to any one of claims 1-5, characterized in that, The input signal is x(n) = [x(n), x(n-1), ..., x(n-M+1)] T , where N is the signal length, M is the order of the LMS adaptive filter, M is a constant greater than 0, and n∈[M,N].
7. The signal filtering method according to any one of claims 1-5, characterized in that, The method for obtaining the desired signal includes: Use the actual measurement value at time n as the desired signal.
8. The signal filtering method according to claim 1, characterized in that, The weight coefficient vector w(n+1) at time n+1 is calculated using the following formula: Where e(n) is the error signal at time n, w(n) is the weight coefficient vector at time n, and μ(n) is the step size factor at time n.
9. The signal filtering method according to any one of claims 1-5, characterized in that, The range of the set value is 0.01-0.
1.
10. A signal filtering device, characterized in that, include: The acquisition module is used to acquire the input signal and the desired signal at time n; The first calculation module is used to calculate the output signal at that moment based on the input signal and the weight coefficient vector at the corresponding moment. The second calculation module is used to calculate a step size factor based on the error signal when the mean square value of the error signal between the expected signal and the output signal is not less than a set value, and to update the weight coefficient vector and output signal at time n+1 based on the step size factor. This includes: calculating the error signal based on the expected signal and the output signal; determining whether the mean square value of the error signal is less than a set value; if not, then based on the weight coefficient vector w(n) at time n, the error signal e(n) at time n, and the relational expression... A gradient change vector s(n) is obtained, where β is a smoothing coefficient, such that each component vector of the gradient change vector is positively correlated with the exponentially weighted moving average of the gradient values of the corresponding components of the weight coefficient vector. A bounded and nonlinear function transformation is performed on the gradient change vector to obtain the step size factor, and the change amplitude of the step size factor is positively correlated with the change amplitude of the gradient change vector. Then, based on the step size factor, the error signal, and the input signal, the weight coefficient vector at time n+1 is updated, and the output signal at time n+1 is calculated based on the weight coefficient vector at time n+1. The processing module is used to repeatedly execute the processing steps of the second calculation module until the mean square value of the error signal is less than the set value, at which point the loop ends and the final output signal is output.
11. A storage medium, characterized in that, The storage medium stores a plurality of instructions adapted for loading by a processor to execute the steps of the signal filtering method according to any one of claims 1 to 9.
12. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, it performs the signal filtering method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Variable step length factor construction method for LMS adaptive filtering
CN112054782A