维纳滤波器自适应算法-SD与LMS算法(附Matlab代码)

1.维纳滤波器基本理论

滤波器系统如下图:

  • 学习过程:K1打向A1,K2打向A2,求取横向滤波器最优权向量。
  • 工作过程:K1打向B1,K2打向B2,对输入信号进行滤波处理。

上述两个过程中,求滤波器最优权向量的学习过程是最优滤波的关键!

上图中的横向滤波器结构如下图,学习过程的任务就是求最优权向量$\vec{w}=\left[ w_{0} \quad w_{1} \cdots w_{M-1} \right]^{T}$

  • $d\left(n\right)$:期望响应
  • $\hat{d}\left(n\right)$:对期望响应的估计,$\hat{d}\left(n\right) = \sum_{i=0}^{M-1}w_{i}^{}u\left(n-i\right )=\vec{w}^{H}\vec{u}\left(n \right )=\vec{u}^{T}\left(n \right )\vec{w}^{n}$
  • $e\left( n \right)$:估计误差,$e\left(n\right) = d\left(n\right)-\hat{d}\left(n\right)$

定义$E\left(n\right)$的平均功率为:

$$J\left(w\right)=\left\{ \left|e \left(n \right)\right|^{2}\right\}=\sigma_{d}^{2}-\vec{p}^{H}\vec{w}-\vec{w}^{H}\vec{p}+\vec{w}^{H}R\vec{w}\quad(1)$$

其中:

  • $d\left( n \right)$的平均功率为:$\sigma_{d}^{2}=E\left\{\left|d\left(n\right)\right|^{2}\right\}$。
  • 互相关向量:$p=E\left\{\vec{u}\left(n\right)d^{*}\left(n\right)\right\}$。
  • $u\left(n\right)$的自相关矩阵:$R=E\left\{\vec{u}\left(n\right)\vec{u}^{H}\left(n\right)\right\}$。

$J\left(\vec{w}\right)$也被称为误差性能面或者均方误差。

利用凸优化知识对$J\left(\vec{w}\right)$求梯度并令梯度为0,即:

$$\bigtriangledown J\left ( \vec{w} \right )=-2\vec{p}+2R\vec{w}=0\quad(2)$$

化简得到维纳-霍夫方程

$$R\vec{w_{0}}=\vec{p}\quad(3)$$

$R$是非奇异的,方程两边同时乘以$R^{-1}$得到最优权向量$\vec{w}_{0}$

$$\vec{w_{0}} = R^{-1}\vec{p}\quad(4)$$

2.维纳滤波自适应算法

直接利用维纳-霍夫方程求滤波器的最优权向量涉及矩阵求逆$(R^{-1})$,计算量大,工程上实现困难!使用自适应算法替代矩阵求逆去调整$\vec{w}\left(n\right)$,使得误差最小。

2.1 最陡下降算法(SD)

沿着$J\left(\vec{w}\right)$的负梯度方向调整权向量$\vec{w}$以寻求最优权向量。

$$\vec{w}\left(n+1\right)=\vec{w}\left(n\right)+\vec{\Delta w}\quad(5)$$

$$\vec{\Delta w}=-\frac{1}{2} \mu \bigtriangledown J\left(\vec{w}\left(n\right)\right)\quad(6)$$

由式(2)、(5)、(6)可以得到:

$$\vec{w}\left(n+1\right)=\vec{w}\left(n\right)+\mu \left[\vec{p}-R\vec{w}\left(n\right)\right]\quad(7)$$

$\mu>0$被称为步长参数或步长因子,该参数对自适应算法发迭代速度有很大影响。

2.2 LMS(最小均方)算法

由(7)式可知:

  • 若互相关向量p和自相关矩阵R确定,SD算法的迭代过程和结果就已经确定;
  • SD算法基于统计和概率的思想,其结果与输入信号的变化无关,不具有自适应性。

对于平稳随机信号,若该信号是各态历经(均方遍历)的,则可用时间平均代替统计平均,用时间自相关代替统计自相关。

$$R\doteq\hat{R}=\frac{1}{N}\sum_{i=1}^{N}u\left(i\right)u^{H}\left(i\right)=\vec{u}\left(n\right)\vec{u}^{H}\left(n\right)\quad(8)$$

$$\vec{p}\doteq\vec{\hat{p}}=\frac{1}{N}\sum_{i=1}^{N}u\left(i\right)d^{*}\left(i\right)=\vec{u}\left(n\right)d^{*}\left(n\right)\quad(9)$$

由式(7)、(8)、(9)可得:

$$\vec{\hat{w}}(n+1) =\vec{ \hat{w}}\left(n\right)+\mu \vec{u}\left(n\right)e^{*}\left(n\right)\quad(10)$$

(10)式就是LMS算法的迭代过程。

2.2.1 LMS算法与SD算法的区别与联系

  • SD算法中,互相关向量$\vec{p}$和自相关矩阵$R$都是确定量,得到的$\vec{w}\left(n\right)$是确定的向量序列。
  • LMS算法中,$\vec{u}\left(n\right)$和$\vec{e}\left(n\right)$都是随机过程,所以$\vec{\hat{w}}\left(n\right)$是随机向量。
  • LMS算法是一种随机梯度算法。
    $$\hat{\bigtriangledown}J\left(n\right)=-2\vec{\hat{p}}+2\hat{R}\vec{w}\left(n\right)=-2\vec{u}(n)e^{*}(n)$$

2.2.2 LMS算法步骤

  1. 初始化:n=0
    权向量:$\vec{\hat{w}}(0)=\vec{0}$
    估计误差:$e(0) = d(0)-\hat{d}(0)=d(0)$
    输入向量:$\vec{u}(0)=[u(0)\quad u(-1) \cdots u(-M+1)]^{T}=[u(0)\quad 0 \cdots 0]^{T}$
  2. n=0,1,2...
    更新权向量:$\vec{\hat{w}}(n+1) =\vec{ \hat{w}}\left(n\right)+\mu \vec{u}\left(n\right)e^{*}\left(n\right)$
    更新期望信号的估计:$\hat{d}(n+1)=\vec{\hat{w}}^{H}(n+1)\vec{u}(n+1)$
    更新估计误差:$e(n+1)=d(n+1)-\hat{d}(n+1))$
  3. 令n=n+1,转到步骤2。

3.算例

(1):产生512点AR过程样本序列。(样本序列为512点时μ=0.005的迭代过程尚未收敛,所以实验分别用512点和512*4点做了对比试验)

(2):在不同步长情况下(μ=0.05和μ=0.005)用LMS滤波器估计w1和w2。

(3):在(2)的条件下进行100次独立实验计算剩余均方误差和失调参数,并画出学习曲线。

(4):比较μ=0.05和μ=0.005时二者学习曲线的区别。

4.Matlab仿真结果

图1 样本序列(N=512)
图2 滤波器权系数迭代(N=512*4,μ=0.05)
图3 滤波器权系数迭代(N=512*4,μ=0.005)
图4 学习曲线(N=512*4)
 步长J(∞)JM
μ=0.050.00380.00520.0516
μ=0.0050.00040.00040.0049
表1 剩余均方误差(J)和失调参数(M)

由表1可以看到当样本点数足够多时,得到的剩余均方误差J可以较好的逼近J(∞)。

由图4和表1可以看到μ=0.005的学习曲线收敛的较慢,μ=0.05的学习曲线收敛的较快,但μ=0.005的学习曲线最后收敛的值更小,即误差更小。还可以看到μ越小,失调参数M越小,稳定性能更好。

5.Matlab源码

点此下载源码!

你可能也喜欢

53 thoughts on “维纳滤波器自适应算法-SD与LMS算法(附Matlab代码)

  1. We absolutely love your blog and find most of your post's to be precisely what I'm looking for.
    Do you offer guest writers to write content in your case?
    I wouldn't mind writing a post or elaborating on some of the subjects you
    write in relation to here. Again, awesome web log!

  2. Having read this I thought it was very enlightening.
    I appreciate you spending some time and effort to put this information together.
    I once again find myself spending a significant amount of time
    both reading and leaving comments. But so what, it was still worthwhile!

  3. Its such as you read my thoughts! You seem to understand so much approximately this, like you wrote the guide in it or
    something. I feel that you can do with some % to drive the message house a bit,
    but instead of that, that is great blog. A great read. I will certainly be back.

  4. This is really interesting, You are a very skilled blogger.
    I've joined your rss feed and look forward to seeking more of your fantastic post.
    Also, I've shared your web site in my social networks!

  5. Oh my goodness! Incredible article dude! Thank you, However I am having difficulties with your RSS.
    I don't understand why I can't join it. Is there anybody else
    having the same RSS problems? Anyone that knows the solution will you kindly
    respond? Thanx!!

  6. I'm really loving the theme/design of your site.
    Do you ever run into any internet browser compatibility
    problems? A number of my blog readers have complained about my site not working correctly
    in Explorer but looks great in Chrome. Do you have any advice to
    help fix this issue?

  7. My partner and I absolutely love your blog and find almost all of your post's to be just what I'm looking for.
    Does one offer guest writers to write content in your
    case? I wouldn't mind composing a post or elaborating on some of the subjects you write with regards to here.
    Again, awesome web site!

  8. Hello There. I found your blog using msn. This is a really well written article.
    I'll make sure to bookmark it and return to read more of your useful information. Thanks for the post.
    I'll definitely return.

  9. Hey there, I think your site might be having
    browser compatibility issues. When I look at your blog site in Safari, it looks fine but when opening in Internet Explorer, it
    has some overlapping. I just wanted to give you a quick heads up!

    Other then that, very good blog!

  10. Hi there! I could have sworn I've been to this blog before but after
    browsing through some of the articles I realized it's
    new to me. Anyways, I'm certainly delighted I came across it and I'll be book-marking it and checking back often!

  11. Could I ask who's calling? solumedrol uso en asma A busy screen is shown on the laptop of a Certified Application Counselor as he attempted to enroll an interested person for Affordable Care Act insurance, known as Obamacare, at the Borinquen Medical Center in Miami, Florida October 2, 2013.

  12. Howdy! This is kind of off topic but I need some help from an established blog.
    Is it very difficult to set up your own blog? I'm not very techincal but I
    can figure things out pretty quick. I'm thinking about making my own but
    I'm not sure where to begin. Do you have any points or suggestions?
    Cheers

  13. FUN888 Thailand has all the betting platforms you need. Besides online casinos and sportsbooks.
    We also have arcade games such as slot machines and fishing games.

  14. Hello there, just became aware of your blog through
    Google, and found that it's really informative. I'm going to watch out for brussels.
    I will be grateful if you continue this in future. Lots of people will
    be benefited from your writing. Cheers!

  15. Can I take your number? best place to buy generic viagra uk Later that day, according to multiple media reports, A-Rod skipped a rehab game at Class A Tampa that was eventually rained out. Rodriguez is scheduled to continue his rehab at Class AA Trenton (N.J.) starting Monday through Wednesday, according to Yankees general manager Brian Cashman.

  16. One moment, please isotretinoin medication guide In company news, Netflix Inc shares rose 2.9percent at $309.60 after the Wall Street Journal reported thatit is in talks with several U.S. cable television companies,including Comcast Corp and Suddenlink Communications to make itsstreaming video service available through their set-top boxes.

  17. Hello there! This is my first comment here so I just wanted to give a quick shout
    out and say I genuinely enjoy reading your posts.

    Can you suggest any other blogs/websites/forums that cover the same topics?
    Thank you so much!

  18. Interesting blog! Is your theme custom made or did you download it from somewhere?
    A theme like yours with a few simple tweeks would really make my
    blog shine. Please let me know where you got your theme.
    Appreciate it

  19. I think this is among the most significant information for me.
    And i am glad reading your article. But wanna remark on few general things, The site style is great, the articles
    is really excellent : D. Good job, cheers

  20. I know this if off topic but I'm looking into starting my own blog and was curious what all is needed to get setup?

    I'm assuming having a blog like yours would cost
    a pretty penny? I'm not very internet smart so I'm not 100% positive.
    Any suggestions or advice would be greatly appreciated.
    Kudos

  21. Thanks for the auspicious writeup. It in reality was once a amusement account it.
    Look complicated to more introduced agreeable from you!
    By the way, how can we keep in touch?

  22. An impressive share! I have just forwarded this onto
    a colleague who has been doing a little research on this.
    And he in fact ordered me lunch because I found it for him...
    lol. So let me reword this.... Thank YOU for the meal!!
    But yeah, thanx for spending some time to talk
    about this subject here on your internet site.

  23. Howdy! This post couldn't be written any better!
    Reading through this article reminds me of my previous
    roommate! He continually kept talking about this. I am going to forward
    this article to him. Fairly certain he's going to have a
    good read. Thanks for sharing!

  24. Hello, i think that i saw you visited my blog so i came to “return the
    favor”.I'm attempting to find things to enhance my site!I suppose its ok to use
    some of your ideas!!

  25. Somebody necessarily lend a hand to make severely posts I might state.
    That is the first time I frequented your website page and so far?
    I amazed with the research you made to make this particular publish extraordinary.

    Excellent activity!

  26. Hey I know this is off topic but I was wondering if you knew of any
    widgets I could add to my blog that automatically tweet my newest twitter updates.
    I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something
    like this. Please let me know if you run into
    anything. I truly enjoy reading your blog and I look
    forward to your new updates.

发表评论

电子邮件地址不会被公开。