?? program_09_08.m
字號:
% 設置采樣周期和小波函數(shù)
delta = 0.1; wname = 'coif3';
% 定義尺度
amax = 7;
a = 2.^[1:amax];
% 計算相關的準頻率
f = scal2frq(a,wname,delta);
% 計算相關的準周期
per = 1./f;
% 繪圖尺度-準周期
subplot(211), plot(a,per)
title(['小波: ',wname, ', 采樣周期: ',num2str(delta)])
xlabel('尺度')
ylabel('準周期')
% 對于每個尺度 2^i:
% - 產(chǎn)生周期為 per(i)的正弦函數(shù)
% - 進行小波分解
% - 確定最大能量
% - 計算檢測出的準周期
for i = 1:amax
% 以采樣周期delta,產(chǎn)生周期為的per(i)周期信號Generate sine function of period
t = 0:delta:100;
x = sin((t.*2*pi)/per(i));
% 對 x 做第9級分解
[c,l] = wavedec(x,9,wname);
% 估計系數(shù)的標準差
stdc = wnoisest(c,l,[1:amax]);
% 計算檢測周期
[y,jmax] = max(stdc);
idper(i) = per(jmax);
end
% 比較檢出準周期和計算準周期
subplot(212), plot(per,idper,'o',per,per)
title('檢出準周期和計算準周期')
xlabel('計算準周期')
ylabel('檢出準周期')
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -