📄 diagnose1.m
字号:
0.018400
0.019200
0.019200
0.020800
0.019200
0.020800
0.019200
0.020800
0.019200
0.020800
0.019200
0.020800
0.019200
0.020800
0.018400
0.020800
0.018400
0.020000
0.018400
0.019200
0.017600
0.019200
0.019200
0.019200
0.017600
0.019200
0.018400
0.020000
0.018400
0.019200
0.018400
0.019200
0.018400
0.020000
0.018400
0.019200
0.017600
0.019200
0.016800
0.020000
0.017600
0.019200
0.017600
0.019200
0.016800
0.018400
0.016800
0.019200
0.016800
0.018400
0.016800
0.018400
0.016800
0.018400
0.016800
0.017600
0.016000
0.017600
0.016000
0.017600
0.016800
0.017600
0.016000
0.018400
0.016000
0.016800
0.014400
0.017600
0.015200
0.016800
0.016000
0.017600
0.016000
0.016800
0.014400
0.016800
0.015200
0.016000
0.015200
0.016800
0.014400
0.016000
0.015200
0.016800
0.014400
0.016000
0.014400
0.016000
0.014400
0.015200
0.014400
0.016000
0.014400
0.015200
0.013600
0.015200
0.014400
0.015200
0.012800
0.016000
0.012800
0.014400
0.012800
0.014400
0.012800
0.014400
0.012800
0.014400
0.012000
0.013600
0.012800
0.014400
0.012800
0.013600
0.011200
0.012800
0.011200
0.012000
0.011200
0.012000
0.010400
0.012000
0.010400
0.011200
0.010400
0.011200
0.010400
0.011200
0.010400
0.012000
0.011200
0.012800
0.012000
0.014400
0.014400
0.017600
0.018400
0.021600
0.022400
0.027200
0.027200
0.032800
0.034400
0.040800
0.041600
0.047200
0.049600
0.053600
0.056800
0.060800
0.062400
0.066400
0.068000
0.071200
0.072000
0.072800
0.072800
0.074400
0.072800
0.073600
0.069600
0.071200
0.064800
0.068000
0.059200
0.064000
0.054400
0.057600
0.048000
0.053600
0.042400
0.048000
0.036800
0.040800
0.032000
0.035200
0.025600
0.029600
0.023200
0.024800
0.019200
0.021600
0.016000
0.018400
0.014400
0.016000
0.012800
0.014400
0.011200
0.013600
0.011200
0.012000
0.010400
0.012000
0.009600
0.011200
0.010400
0.011200
0.009600
0.011200
0.009600
0.011200
0.009600
0.010400
0.008000
0.010400
0.008800
0.010400
0.008000
0.008800
0.008000
0.008800
0.007200
0.008800
0.007200
0.008000
0.007200
0.008000
0.007200
0.007200
0.007200
0.008000
0.006400
0.008800
0.005600
0.008000
0.007200
0.007200
0.006400
0.007200
0.006400
0.008000
0.005600
0.007200
0.005600
0.007200
0.005600
0.008000
0.005600
0.007200
0.005600
0.006400
0.005600
0.006400
0.005600
0.007200
0.005600
0.007200
0.006800
0.006400
0.005600
0.006400
0.007200
0.008000
0.008000
0.009600
0.010400
0.012800
0.012800
0.017600
0.019200
0.023200
0.024800
0.030400
0.023400
0.028200
0.028800
0.034800
0.036000
0.040800
0.041400
0.045600
0.046200
0.051000
0.051600
0.052200
0.052800
0.054000
0.054000
0.054600
0.053400
0.054000
0.049800
0.052200
0.045000
0.049200
0.042000
0.045000
0.037200
0.042000
0.032400
0.036000
0.027600
0.031200
0.023400
0.027600
0.018000
0.022800
0.021600
0.024000
0.017600
0.020000
0.014400
0.016800
0.012800
0.013600
0.010400
0.012800
0.009600
0.011200
0.008000
0.009600
0.007200
0.008800
0.006400
0.008000
0.006400
0.008000
0.005600
0.007200
0.005600
0.007200
0.006400
0.007200
0.004800
0.007200
0.004800
0.007200
0.003200
0.005600
0.004000
0.004800
0.003200
0.004000
0.002400
0.004000
0.002400
0.004000
0.002400
0.004800
0.003200
0.003200
0.003200
0.003200
0.003200
0.004000
0.002400
0.004000
0.002400
0.004000
0.003200
0.004000
0.004000
0.004800
0.003200
0.004800
0.003200
0.005600
0.004000
0.004800
0.003200
0.004800
0.003200
0.004000
0.003200
0.004000
0.003200
0.004000
0.003200
0.004000
0.004000
0.004800
0.004000
0.005600
0.004800
0.007200
0.007200
0.009600
0.008800
0.013600
0.014400
0.018400
0.019200
0.025600
0.026400
0.032000
0.033600
0.042400
0.044000
0.049600
0.051200
0.056800
0.058400
0.064000
0.064800
0.068800
0.068800
0.069600
0.070400
0.072000
0.069600
0.070400
0.065600
0.069600
0.061600
0.064800
0.056000
0.060000
0.049600
0.054400
0.042400
0.047200
0.036000
0.040800
0.029600
0.035200
0.024800
0.028800
0.020800
0.023200
0.016000
0.019200
0.012000
0.016000
0.011200
0.012800
0.010400
0.010400
0.008000
0.008800
0.007200
0.008000
0.007200
0.007200
0.005600
0.007200
0.005600
0.007200
0.004000
0.006400
0.005600
0.005200
0.004800
0.005600
0.004800
0.004800
0.004000
0.004800
0.004800
0.004800
0.001600
0.003200
0.002800
0.002400
0.001600
0.002400
0.002000
0.001600
0.000800
0.001600
0.000000
0.001600
0.000800
0.001600
0.000800
0.001600
0.000800
0.002400
0.000000
0.002400
0.000800
0.002400
0.001600
0.002400
0.001600
0.002400
0.001600
0.003200
0.002400
0.002400
0.002400
0.004000
0.002400
0.004000
0.002400
0.002400
0.000800
0.002400
0.001600
0.002400
0.002400
0.004000
0.002400
0.004000
0.004000
0.005600
0.006400
0.008800
0.007200
0.012800
0.011200
0.018400
0.019200
0.023200
0.025600
0.032000
0.032800
0.040000
0.041600
0.048000
0.048800
0.056800
0.058400
0.062400
0.064000
0.067200
0.068000
0.069600
0.070400
0.072000
0.070400
0.070400
0.066400
0.068800
0.061600
0.065600
0.056800
0.060800
0.050400
0.055200
0.043200
0.049600
0.037600
0.041600
0.031200
0.035200
0.024800
0.029600
0.020000
0.024000
0.016800
0.020800
0.012800
0.016000
0.011200
0.008000
0.009600
0.007200
0.008800
0.006400
0.008000
0.006400
0.008000
0.005600
0.007200
0.005600
0.007200
0.006400
0.007200
0.004800
0.007200
0.004800
0.007200
0.003200
0.005600
0.004000
0.004800
0.003200
0.004000
0.002400
0.004000
0.002400
0.004000
0.002400
0.004800
0.003200
0.003200
0.003200
0.003200
0.003200
0.004000
0.002400
0.004000
0.002400
0.004000
0.003200
0.004000
0.004000
0.001600
0.003200
0.001600
0.002400
0.002400
0.004000
0.001600
0.004000
0.002400
0.003200
0.002400
0.003200
0.001600
0.003200
0.001600
0.003200
0.002400
0.003200
0.002400
0.003200
0.002400
0.004000
0.002400
0.004000
0.003200
0.004000
0.004000
0.006400
0.004800
0.006400
0.005600
0.009600
0.010400
0.014400
0.015200
0.020000
0.020800
0.027200
0.028000
0.035200
0.037600
0.044000
0.045600
0.052000
0.054400
0.062400
0.062400
0.067200
0.068000
0.070400
0.072000
0.073600
0.073600
0.074400
0.071200
0.072800
0.068000
0.070400
0.064000
0.066400
0.056800
0.062400
0.050400
0.054400
0.042400
0.048800
0.037600
0.044000
0.030400
0.036800
0.026400
0.028800
0.021600
0.025600
0.016800
0.020800
0.013600
0.016000
0.012000
0.013600
0.010400
0.012000
0.007200
0.009600
0.007200
0.009600
0.007200
0.008000
0.006400
0.007200
0.005600
0.007200
0.006400
0.007200
0.006400
0.007200
0.006400
0.007200
0.005600
0.006400
0.005600
0.006400
0.004800
0.007200
0.004000
0.006400
0.004800
0.005600
0.004000
0.005600
0.004800
0.005600
0.004000
0.006400
0.004800
0.005600
0.004800
0.005600
0.004800
0.005600
0.004800
0.005600
0.004800
0.007200
0.004800
0.006400
0.004800
0.006400
0.006400
0.006400
0.005600
0.006400
0.004800
0.006400
0.004800
0.006400
0.005600
0.006400
0.004000
0.005600
0.004800
0.006400
0.004000
0.005600
0.004800
0.005600
0.005600
0.006400
0.006400
0.007200
0.007200
0.009600
0.010400
0.014400
0.015200
0.017600
0.020000
0.024800
0.025600
0.032800
0.034400
0.040000
0.041600
0.050400
0.051200
0.059200
0.060000
0.065600
0.066400
0.070400
0.071200
0.076000
0.075200
0.076000
0.075200
0.076800
0.072800
0.075200
0.069600
0.072000
0.064800
0.069600
0.057600
0.063200
0.052000
0.057600
0.045600
0.051200
0.040000
0.044800
0.034400
0.037600
0.028800
0.032000
0.024000
0.027200
0.020000
0.022400
0.017600
0.018400
0.015200
0.016800
0.013600
0.015200
0.012000
0.014400
0.012000
0.012800
0.012000
0.013600
0.010400
0.012000
0.011200
0.012800
0.011200
0.012000
0.011200
0.012000
0.011200
0.012800
0.010400
0.012000
0.010400
0.013600
0.010400
0.012000
0.010400
0.011200
0.009600
0.011200
0.009600
0.012000
0.010400
0.011200
0.010400
0.012000
0.010400
0.012000
0.011200
0.012000
0.011200
0.012000
0.010400
0.012000
0.011200
0.012800
0.010400
0.012000
0.011200
0.012800
0.011200
0.012000
0.011200
0.012800
0.011200
0.013600
0.012000
0.013600
0.012800
0.013600
0.012800
0.014400
0.012800
0.014400
0.012000
0.013600
0.012800
0.014400
0.012800
0.014400
0.012800
0.013600
0.012800
0.014400
0.012800
0.013600
0.012800
0.014400
0.012800
0.015200
0.013600
0.014400
0.012800
0.014400
0.013600
0.015200
0.013600
0.016000
0.014400
0.015200
0.014400
0.016800
0.014400
0.016000
0.015200
0.016000
0.015200
0.017600
0.015200
0.016000
0.014400
0.017600
0.016000
0.016800
0.016000
0.017600
0.016000
0.017600
0.015200
0.016800
0.016000
0.016800
0.015200
0.016800
0.015200
0.016800
0.016000
0.016800
0.015200
0.016800
0.016000
0.016800
0.015200
0.016800
0.015200
0.016800
0.016000
0.017600
0.016000
0.016800
0.016000
0.017600
0.015200
0.017600
0.016000
0.016800
0.016000
0.016000
0.016000
0.016800
0.016800
0.017600
0.016800
0.018400
0.016800
0.018400
0.017600
0.018400
0.017600
0.018400
0.017600
0.018400
0.018400
0.019200
0.016800
0.018400
0.017600
0.019200
0.017600
0.019200
0.017600
0.018400
0.016800
0.018400
0.018400
0.018000
0.017600
0.019200
0.017600
0.019200
0.018400
0.020000
0.018400
0.020000
0.018400
0.019200
0.019200
0.020000
0.018400
0.020800
0.019200
0.020800
0.019200
0.020800
0.018400
0.020800
0.019200
0.021600
0.019200
];
%分别输入时间信号和信号的幅值------------------------------------
N=1024;
fs=100000;
t=[0:0.00001:0.01023];
figure(1);
subplot(2,1,1);plot(t,nw);title('Normal Wave');
axis([0 0.01023 -0.06 0.1]);
Ylabel('Magnitude');
subplot(2,1,2);plot(t,fw);title('Fault wave');
axis([0 0.01023 -0.06 0.1]);
Ylabel('Magnitude');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(2);%%Frequency Spectrum 1
ny=fft(nw,N);
my=abs(ny(1:N/2));
k=(0:N/2-1)*fs/(N-1);
subplot(2,1,1);plot(k,my);title('从4785.15625Hz开始的频谱部分');
axis([0*(50000/512) 50000 -inf inf]);
Ylabel('Freq Magnitude');
%%Frequency Spectrum 2
fy=fft(fw,N);
my=abs(fy(1:N/2));
k=(0:N/2-1)*fs/(N-1);
subplot(2,1,2);plot(k,my);title('从4785.15625Hz开始的频谱部分');
axis([0*(50000/512) 50000 0 9]);
Ylabel('Freq Magnitude');
%%%% Wavelet decomposition
wtype='db3'
[nc,nl]=wavedec(nw,4,wtype);
[fc,fl]=wavedec(fw,4,wtype);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%[cd1,cd2,cd3,cd4,cd5,cd6]=detcoef(c,l,[1 2 3 4 5 6]);
%figure(4);
%subplot(6,1,1);plot(cd1);ylabel('cd1');
%subplot(6,1,2);plot(cd2);ylabel('cd2');
%subplot(6,1,3);plot(cd3);ylabel('cd3');
%subplot(6,1,4);plot(cd4);ylabel('cd4');
%subplot(6,1,5);plot(cd5);ylabel('cd5');
%subplot(6,1,6);plot(cd6);ylabel('cd6');
%%% Wavelet reconstruction for nw
figure(3);
for ai=1:4;
a=wrcoef('a',fc,fl,wtype,5-ai);
subplot(4,1,ai);plot(t,a);
if ai==1
title('利用小波对各低频信号进行重构');
end ;
if ai==2
fdl=a;
end;
if ai==3
fdr=a;
end;
axis([0 0.01023 -inf inf]); %定义坐标轴的范围
Ylabel(['a',num2str(5-ai)]);
end;
for i=1:N
ffd(i)=fdl(i)*fdr(i);
end
%%%%%%%Wavelet reconstruction for fw(no plot)
for ai=1:4;
a=wrcoef('a',nc,nl,wtype,5-ai);
if ai==1
title('利用小波对各低频信号进行重构');
end ;
if ai==2
ndl=a;
end;
if ai==3
ndr=a;
end;
end;
for i=1:N
nnd(i)=ndl(i)*ndr(i);
end
%%%%%%%%%%%%%%%%%%%%%%%%%
figure(5)
for i=1:N
dd(i)=nnd(i)-ffd(i);
end
subplot(1,1,1);plot(t,dd);
axis([0 0.01023 -inf inf]); %定义坐标轴的范围
figure(4);
for di=1:4;
d=wrcoef('d',fc,fl,wtype,5-di);
subplot(4,1,di);plot(t,d);
if di==1
title('利用小波对各高频信号进行重构第二槽短路15%');
end;
axis([0 0.01023 -inf inf]); %定义坐标轴的范围
Ylabel(['d',num2str(5-di)]);
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -