資源簡介
在matlab下利用小波和wavedec和upcoef函數(shù)對(duì)信號(hào)進(jìn)行多級(jí)的分解與重建
代碼片段和文件信息
clear;
fs=600;N=512;
w=2*pi/fs;
t=0:N-1;
wname=‘db1‘;
f1=sin(w*t);subplot(611);plot(tf1);title(‘1HZ信號(hào)‘);
f2=sin(5*w*t);subplot(612);plot(f2);title(‘5HZ信號(hào)‘);
f3=sin(10*w*t);subplot(613);plot(f3);title(‘10HZ信號(hào)‘);
f4=sin(20*w*t);subplot(614);plot(f4);title(‘20HZ信號(hào)‘);
f5=sin(50*w*t);subplot(615);plot(f5);title(‘50HZ信號(hào)‘);
f6=sin(100*w*t);subplot(616);plot(f6);title(‘100HZ信號(hào)‘);
signal=f1+f2+f3+f4+f5+f6;
figure(2);plot(signal);title(‘疊加信號(hào)‘);%原始信號(hào)
figure(3);
subplot(311);plot(signal);
[CACD]=dwt(signalwname);
subplot(312);plot(CA);title(‘CA‘);
subplot(313);plot(CD);title(‘CD‘);%用wname小波經(jīng)過dwt函數(shù)對(duì)信號(hào)進(jìn)行小波分解
[CL]=wavedec(signal8wname);
figure(4);
A8=C(1:L(1));
D8=C(L(1)+1:L(1)+L(2));
D7=C(L(1)+L(2)+1:L(1)+L(2)+L(3));
D6=C(L(1)+L(2)+L(3)+1:L(1)+L(2)+L(3)+L(4));
D5=C(L(1)+L(2
評(píng)論
共有 條評(píng)論