📄 example4_2_4.m
字号:
load noisbloc
x = noisbloc;
t = wpdec(x,3,'sym4');
plot(t);
%在运行上面命令出现的图形窗口中将Node Label从Depth-postion切换到
%Index并单击索引值为0的结点,即根结点,如图4-9所示
%全局阈值处理
t1 = t;
sorh = 'h';
%硬阈值
thr = wthrmngr('wp1ddenoGBL','penalhi',t);
%设置消噪阈值
cfs = read(t,'data');
cfs = wthresh(cfs,sorh,thr);
t1 = write(t1,'data',cfs);
figure(2);
plot(t1)
%在运行上面命令后出现的图形窗口中再将Node Label从Depth-postion切换到
%Index并单击索引值为0的结点,即根结点,如图4-10所示
%各个结点分别进行阈值处理
t2 = t;
sorh = 's';
thr(1) = wthrmngr('wp1ddenoGBL','penalhi',t);
thr(2) = wthrmngr('wp1ddenoGBL','sqtwologswn',t);
tn = leaves(t);
for k=1:length(tn)
node = tn(k);
cfs = read(t,'data',node);
numthr = rem(node,2)+1;
cfs = wthresh(cfs,sorh,thr(numthr));
t2 = write(t2,'data',node,cfs);
end
figure(3);
plot(t2)
%在运行上面命令后出现的图形窗口中再将Node Label从Depth-postion切换到Index并单击
%索引值为0的结点,即根结点,如图4-11所示
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -