?? gdmu.m
字號:
x = randn(1,700); % 作為系統的輸入
b = fir1(63,0.5) % 確定未知系統
n = 0.1*randn(1,700); % 加入噪聲
d = filter(b,1,x)+n; % 期望信號
mu =0.003; % 固定步長值
h = adaptfilt.lms(64,mu); % 模擬建模
[y,e] = filter(h,x,d); % 模擬系統輸出
S =abs(h.Coefficients.')-abs(b.'); % 誤差取絕對值作差
subplot(3,2,1); plot(1:700,d);axis([0,700,-3,3]);
title(‘未知系統輸出’);xlabel(‘采樣點’); ylabel(‘輸出’);
subplot(3,2,3); plot(1:700,y);axis([0,700,-3,3]);
title(‘模擬系統輸出’);xlabel(‘采樣點’); ylabel(‘輸出’);
subplot(3,2,5); plot(1:700,e);axis([0,700,-3,3]);
title(‘誤差值’);xlabel(‘采樣點’); ylabel(‘誤差’);
subplot(3,2,2);stem([b.']);axis([0,63,-0.1,0.6]);
title(‘未知系統采樣點’);xlabel(‘采樣點’); ylabel(‘數值’);
subplot(3,2,4);stem([h.Coefficients.']);axis([0,63,-0.1,0.6]);
title(‘模擬系統采樣點’);xlabel(‘采樣點’); ylabel(‘數值’);
subplot(3,2,6);stem([s]);axis([0,63,-0.03,0.03]);
title(‘誤差比對’);xlabel(‘采樣點’); ylabel('誤差大小');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -