⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xiaobo.asv

📁 用于小波变换,调试过很好.可以求出任意多个小波系数.
💻 ASV
字号:
function [A1,D1,D2,D3,D4,D5] = wavelet( level,s )A1=zero(length(s),)level=input('您要分析几个细节分量: level=') ;%几种小波%dmey   dbN  haar    行 %sym  coif  bior rbio不行if level==1        [C,L]=wavedec(s,1,'dmey');    cA1=appcoef(C,L,'dmey',1);    cD1=detcoef(C,L,1);    A1=wrcoef('a',C,L,'dmey',1);    D1=wrcoef('d',C,L,'dmey',1);        subplot(2,2,1);plot(A1);title('近似部分');    subplot(2,2,2);plot(D1);title('细节1');    endif level==2    [C,L]=wavedec(s,2,'dmey');    cA2=appcoef(C,L,'dmey',2);    cD2=detcoef(C,L,2);    cD1=detcoef(C,L,1);    A2=wrcoef('a',C,L,'dmey',2);    D1=wrcoef('d',C,L,'dmey',1);    D2=wrcoef('d',C,L,'dmey',2);        subplot(2,2,1);plot(A3);title('近似部分');    subplot(2,2,2);plot(D1);title('细节1');    subplot(2,2,3);plot(D2);title('细节2');    subplot(2,2,4);plot(D3);title('细节3'); endif level==3    [C,L]=wavedec(s,3,'dmey');    cA3=appcoef(C,L,'dmey',3);    cD3=detcoef(C,L,3);    cD2=detcoef(C,L,2);    cD1=detcoef(C,L,1);    A3=wrcoef('a',C,L,'dmey',3);    D1=wrcoef('d',C,L,'dmey',1);    D2=wrcoef('d',C,L,'dmey',2);    D3=wrcoef('d',C,L,'dmey',3);    subplot(2,2,1);plot(A3);title('近似部分');    subplot(2,2,2);plot(D1);title('细节1');    subplot(2,2,3);plot(D2);title('细节2');    subplot(2,2,4);plot(D3);title('细节3');endif level==4    [C,L]=wavedec(s,4,'dmey');    cA4=appcoef(C,L,'dmey',4);    cD4=detcoef(C,L,4);    cD3=detcoef(C,L,3);    cD2=detcoef(C,L,2);    cD1=detcoef(C,L,1);    A4=wrcoef('a',C,L,'dmey',4);    D1=wrcoef('d',C,L,'dmey',1);    D2=wrcoef('d',C,L,'dmey',2);    D3=wrcoef('d',C,L,'dmey',3);    D4=wrcoef('d',C,L,'dmey',4);    subplot(5,1,1);plot(D1);title('细节1');    subplot(5,1,2);plot(D2);title('细节2');    subplot(5,1,3);plot(D3);title('细节3');    subplot(5,1,4);plot(D4);title('细节4');    subplot(5,1,5);plot(A4);title('近似部分');endif level==5    [C,L]=wavedec(s,5,'dmey');    cA5=appcoef(C,L,'dmey',5);    cD5=detcoef(C,L,5);    cD4=detcoef(C,L,4);    cD3=detcoef(C,L,3);    cD2=detcoef(C,L,2);    cD1=detcoef(C,L,1);    A5=wrcoef('a',C,L,'dmey',5);    D1=wrcoef('d',C,L,'dmey',1);    D2=wrcoef('d',C,L,'dmey',2);    D3=wrcoef('d',C,L,'dmey',3);    D4=wrcoef('d',C,L,'dmey',4);    D5=wrcoef('d',C,L,'dmey',5);        subplot(6,1,1);plot(D1);title('细节1');    subplot(6,1,2);plot(D2);title('细节2');    subplot(6,1,3);plot(D3);title('细节3');    subplot(6,1,4);plot(D4);title('细节4');    subplot(6,1,5);plot(D5);title('细节5');      subplot(6,1,6);plot(A5);title('近似部分');end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -