對信號X進行N尺度平穩小波分解 [A,H,V,D]=swt2(X,N,'wname');
clc,clear all,close all;
load woman;
[cA,cH,cV,cD]=swt2(X,2,'haar');%用haar小波基進行2尺度平穩小波分解
cA1=cA(:,:,1);cH1=cH(:,:,1);cV1=cV(:,:,1);cD1=cD(:,:,1);%尺度1低、高頻系數
cA2=cA(:,:,2);cH2=cH(:,:,2);cV2=cV(:,:,2);cD2=cD(:,:,2);%尺度2低、高頻系數
figure;
subplot(1,2,1),imshow(uint8(cA1));axis off;title('尺度1的低頻系數圖像');
subplot(1,2,2),imshow(uint8(cA2));axis off;title('尺度2的低頻系數圖像');
figure;
subplot(2,3,1),imshow(uint8(cH1));axis off;title('尺度1水平方向高頻系數');
subplot(2,3,2),imshow(uint8(cV1));axis off;title('尺度1垂直方向高頻系數');
subplot(2,3,3),imshow(uint8(cD1));axis off;title('尺度1斜線方向高頻系數');
subplot(2,3,4),imshow(uint8(cH2));axis off;title('尺度2水平方向高頻系數');
subplot(2,3,5),imshow(uint8(cV2));axis off;title('尺度2垂直方向高頻系數');
subplot(2,3,6),imshow(uint8(cD2));axis off;title('尺度2斜線方向高頻系數');
