日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

LSM 自适应信号处理代码

發布時間:2025/3/20 编程问答 46 豆豆
生活随笔 收集整理的這篇文章主要介紹了 LSM 自适应信号处理代码 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2019獨角獸企業重金招聘Python工程師標準>>>

function [yhat, c, e] = lms(x, y, mu, M, c_0) % function [yhat, c, e] = lms(x, y, mu, M, c_0) % FIR Adaptive Filter using LMS Algorithm, % reference to "Statistical and Adaptive Signal Processing" % by Dimitris G. Manolakis, Vinay K. Ingle, and Stephen M. Kogon. McGraw-Hill Higher Education. % x = input sequence % y = desired sequence % mu = step-size % M = filter order % c_0 = initialization of coefficient vector % yhat = filtered sequence % c = FIR filter coefficient vector % e = error signal % P = squared error if nargin ~= 5 error('The input parameters error!') return end if M <= 0 error('The input filter order must be a postive integer!') return end if sum(size(x)>1)>1 || sum(size(y)>1)>1 || sum(size(c_0)>1)>1 error('Input data dimension error!') return end if length(c_0) ~= M error('initial filter order mismatch!') return end x = squeeze(x); y = squeeze(y); Nx = length(x); x = reshape(x,Nx,1); Ny = length(y); y = reshape(y,Ny,1); c_0 = reshape(c_0,M,1); if Ny > Nx y = y(1:Nx); elseif Ny < Nx y = [y;zeros(Nx-Ny,1)]; end yhat = zeros(Nx,1); c = zeros(M,Nx); P = zeros(Nx,1); e = zeros(Nx,1); xm = zeros(M,1); c(:,1) = c_0; for n = 1:Nx if n < M xm(1:n) = flipud(x(1:n)); else xm = flipud(x(n+1-M:n)); end yhat(n) = xm'*c(:,n); e(n) = y(n)-yhat(n); % P(n) = (abs(e(n)))^2; c(:,n+1) = c(:,n)+2*mu*xm*e(n); end return;

轉載于:https://my.oschina.net/innovation/blog/909418

總結

以上是生活随笔為你收集整理的LSM 自适应信号处理代码的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。