1.代码
clear clc %一维静态离散小波变换 load noisbloc s = noisbloc; sLen = length(s); [swa,swd] = swt(s,3,'db1'); swd1 = swd(1,:); swa1 = swa(1,:); swd2 = swd(2,:); swa2 = swa(2,:); swd3 = swd(3,:); swa3 = swa(3,:); figure(1) subplot(4,2,[1,2]) plot(s) xlim([0 sLen]) title('Original Signal') subplot(4,2,3) plot(swa1) xlim([0 sLen]) title('Level 1 Approximation coefficients') subplot(4,2,4) plot(swd1) xlim([0 sLen]) title('Level 1 Detail coefficients') subplot(4,2,5) plot(swa2) xlim([0 sLen]) title('Level 2 Approximation coefficients') subplot(4,2,6) plot(swd2) xlim([0 sLen]) title('Level 2 Detail coefficients') subplot(4,2,7) plot(swa3) xlim([0 sLen]) title('Level 3 Approximation coefficients') subplot(4,2,8) plot(swd3) xlim([0 sLen]) title('Level 3 Detail coefficients')
2.运行结果