?? yt324562222222.m
字號:
clear;
t=0:0.001:2.047;
x=0.8*sin(2*pi*50*t)+1.5*sin(2*pi*100*t)+0.4*sin(2*pi*150*t)+0.1*sin(2*pi*200*t);
xx=x';
x1=hilbert(xx);
[tfr,t,f]=tfrwv(x1);
clear;
t=0:0.001:2.047;
x=0.8*sin(2*pi*50*t)+1.5*sin(2*pi*100*t)+0.4*sin(2*pi*150*t)+0.1*sin(2*pi*200*t);
figure(1);
subplot(211);
plot(x(1:800))
y=fft(x,2048);
n=0:2047;f=1000*n/2048;
pyy=y.*conj(y)/2048;
subplot(212);
plot(f(1:1000),abs(y(1:1000)));
%%%%功率譜分析
xx=x';
x1=hilbert(xx);
[tfr,t,f]=tfrstft(x1);
figure(2);subplot(211);
plot(t,abs(tfr(1:600,:)));
subplot(212);
contour(t,f,abs(tfr));%%%%%短時傅立葉變換
[tfr,t,f]=tfrwv(x1);
figure(3);
subplot(211);contour(t,f,tfr);
x=1.9*sin(2*pi*t*100)+0.7*sin(2*pi*t*150)+0.1*sin(2*pi*t*200);%松動
[c,l]=wavedec(x,8,'db10');
d6=wrcoef('d',c,l,'db10',6);
ss=0;for i=1:1024;f=d6(i)*d6(i);ss=ss+f;end;
d7=wrcoef('d',c,l,'db10',7);
ss=0;for i=1:1024;f=d7(i)*d7(i);ss=ss+f;end;
a8=wrcoef('a',c,l,'db10',8);
ss=0;for i=1:1024;f=a8(i)*a8(i);ss=ss+f;end;%小波能量計算
x=1.9*sin(2*pi*t*50)+0.7*sin(2*pi*t*100);%裂紋數據
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -