?? 例程10-6.m
字號:
% 當前擴展模式是補零
% 構造原始一維信號s
randn('seed',531316785)
s = 2 + kron(ones(1,8),[1 -1]) + ...
((1:16).^2)/32 + 0.2*randn(1,16);
% 使用db2進行單尺度dwt
[ca1,cd1] = dwt(s,'db2');
subplot(221); plot(ca1);
title('db2低頻系數');
subplot(222); plot(cd1);
title('db2高頻系數');
% 進行單尺度離散小波逆變換
ss = idwt(ca1,cd1,'db2');
err = norm(s-ss); % 檢查重構
subplot(212); plot([s;ss]');
title('原始信號和重構信號');
xlabel(['誤差的2范數為 = ',num2str(err)])
% 對于給定小波,計算兩個相關重構濾波器,并直接利用它們進行逆變換
[Lo_R,Hi_R] = wfilters('db2','r');
ss = idwt(ca1,cd1,Lo_R,Hi_R);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -