Matlab函数学习—滤波器设计工具箱—adaptfilt.lms
函数名:adaptfilt.lms
说明:基于LMS的自适应滤波器
用法:ha = adaptfilt.lms(L,step,leakage,coeffs,states)
参数说明:
L 滤波器的长度(必须为整数)
step 步长
leakage 遗漏系数(必须为0到1,默认为0.1)
coeffs 初始滤波器系数矢量(长度必须为L,默认为全0)
states 初始滤波器状态矢量(长度必须为L-1,默认为全0)
例一:
使用500迭代确认一个未知的32级的FIR滤波器.
x = randn(1,500); % Input to the filter
b = fir1(31,0.5); % FIR system to be identified
n = 0.1*randn(1,500); % Observation noise signal
d = filter(b,1,x)+n; % Desired signal
mu = 0.008; % LMS step size.
ha = adaptfilt.lms(32,mu);
[y,e] = filter(ha,x,d);
subplot(2,1,1); plot(1:500,[d;y;e]);
title('System Identification of an FIR Filter');
legend('Desired','Output','Error');
xlabel('Time Index'); ylabel('Signal Value');
subplot(2,1,2); stem([b.',ha.coefficients.']);
legend('Actual','Estimated');
xlabel('Coe
fficient #'); ylabel('Coefficient Value');
grid on;
在自适应滤波器构架中使用LMS滤波器确定一个未知的滤波器是一种常用的手段。
Matlab函数学习—滤波器设计工具箱—adaptfilt.lms
转载本文请联系原作者获取授权,同时请注明本文来自邵启红科学网博客。
链接地址:http://blog.sciencenet.cn/blog-658273-545624.html
下一篇:MATLAB 信号处理工具箱 函数集