step2.m
来自「f-xlms算法程序 非常有用的消噪用的程序」· M 代码 · 共 25 行
M
25 行
ntrS = 30000;
s = randn(1,ntrS);
dS = filter(H,1,s) + 0.01*randn(1,ntrS);
%% Designing the Secondary Propagation Path Estimate
% Typically, the length of the secondary path filter estimate is not as
% long as the actual secondary path and need not be for adequate control
% in most cases. We shall use a secondary path filter length of 250
% taps, corresponding to an impulse response length of 31 msec.
% While any adaptive FIR filtering algorithm could be used for this
% purpose, the normalized LMS algorithm is often used due to its
% simplicity and robustness. Plots of the output and error signals show
% that the algorithm converges after about 10000 iterations.
M = 250;
muS = 0.1; offsetS = 0.1;
h = adaptfilt.nlms(M,muS,1,offsetS);
[yS,eS] = filter(h,s,dS);
n = 1:ntrS;
plot(n,dS,n,yS,n,eS);
xlabel('Number of iterations');
ylabel('Signal value');
title('Secondary Identification Using the NLMS Adaptive Filter');
legend('Desired Signal','Output Signal','Error Signal');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?