?? program_17_05_special.m
字號:
%讀入EEG信號
load eeg.dat;
x=eeg(2,1:512)';
N=length(sig);
%采樣頻率
fs=312.5;
%小波分解
[c,l] = wavedec(x,5,'db5');
%重構第5層逼近信號
a5 = wrcoef('a',c,l,'db5',5);
%重構第1~5層細節信號
d5 = wrcoef('d',c,l,'db5',5);
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(1)
subplot(6,1,1);
plot(a5,'LineWidth',2);
ylabel('a5');
subplot(6,1,2);
plot(d5,'LineWidth',2);
ylabel('d5');
subplot(6,1,3);
plot(d4,'LineWidth',2);
ylabel('d4');
subplot(6,1,4);
plot(d3,'LineWidth',2);
ylabel('d3');
subplot(6,1,5);
plot(d2,'LineWidth',2);
ylabel('d2');
subplot(6,1,6);
plot(d1,'LineWidth',2);
ylabel('d1');
xlabel('時間 t/s');
%時域波形
figure(2);
subplot(2,1,1);
plot((1:N)/fs,x,'LineWidth',2);
%xlabel('時間 t/s');
ylabel('電壓 A/uV');
title('原始信號')
%去除噪聲,重構信號
subplot(2,1,2);
y=a5+d5+d4;
plot((1:N)/fs,y,'LineWidth',2);
xlabel('時間 t/s');
ylabel('電壓 A/uV');
title('去噪聲后信號')
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -