📄 f12_3.m
字号:
%读信号
load noisbloc
x = noisbloc;
%3层小波包分解
t = wpdec(x,3,'sym4');
%%显示树结构
plot(t);
%设置全局阈值.
t1 = t;
sorh = 'h';
thr = wthrmngr('wp1ddenoGBL','penalhi',t);
cfs = read(t,'data');
cfs = wthresh(cfs,sorh,thr);
t1 = write(t1,'data',cfs);
plot(t1)
%对每个节点分别设置阈值.
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
plot(t2)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -