?? f14_3.m
字號:
%采樣頻率
fs=10000;
%齒輪點蝕聲音信號
fid=fopen('GEAR2.dat','r');%故障
N=1024;
xdata=fread(fid,N,'int16');
fclose(fid);
xdata=(xdata-mean(xdata))/std(xdata,1);
%時域波形
figure(1);
plot(1:N,xdata);
xlabel('時間 t/n');
ylabel('電壓 V/v');
%db5小波進行4層分解
%一維小波分解
[c,l] = wavedec(xdata,4,'db5');
a4 = wrcoef('a',c,l,'db5',4);
%重構第1-4層細節系數
d4 = wrcoef('d',c,l,'db5',4);
d3 = wrcoef('d',c,l,'db5',3);
d2 = wrcoef('d',c,l,'db5',2);
d1 = wrcoef('d',c,l,'db5',1);
%顯示細節號
figure(2)
subplot(5,1,1);
plot(d1,'LineWidth',2);
ylabel('d1');
subplot(5,1,2);
plot(d2,'LineWidth',2);
ylabel('d2');
subplot(5,1,3);
plot(d3,'LineWidth',2);
ylabel('d3');
subplot(5,1,4);
plot(d4,'LineWidth',2);
ylabel('d4');
xlabel('時間 t/s');
subplot(5,1,5);
plot(a4,'LineWidth',2);
ylabel('a4');
xlabel('時間 t/s');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -