小波分解与合成的完整代码
答案:2 悬赏:60
解决时间 2021-02-10 06:49
- 提问者网友:喵星人荷西
- 2021-02-10 00:37
小波分解与合成的完整代码
最佳答案
- 二级知识专家网友:堕落奶泡
- 2021-02-10 00:45
% Load original 1D signal.
load leleccum; s = leleccum(1:3920);
ls = length(s);
% Perform one step decomposition of s using db1.
[ca1,cd1] = dwt(s,'db1');
% Perform one step reconstruction of ca1 and cd1.
a1 = upcoef('a',ca1,'db1',1,ls);
d1 = upcoef('d',cd1,'db1',1,ls);
% Now plot a1 + d1.
% Invert directly decomposition of s using coefficients.
a0 = idwt(ca1,cd1,'db1',ls);
% Perform decomposition at level 3 of s using db1.
[c,l] = wavedec(s,3,'db1')
% Extract approximation coefficients at level 3,
% from wavelet decomposition structure [c,l].
ca3 = appcoef(c,l,'db1',3);
% Extract detail coefficients at levels 1, 2 and 3,
% from wavelet decomposition structure [c,l].
cd3 = detcoef(c,l,3);
cd2 = detcoef(c,l,2);
cd1 = detcoef(c,l,1);
% Reconstruct approximation at level 3,
% from wavelet decomposition structure [c,l].
a3 = wrcoef('a',c,l,'db1',3);
% Reconstruct detail coefficients at levels 1,2 and 3,
% from the wavelet decomposition structure [c,l].
d3 = wrcoef('d',c,l,'db1',3);
d2 = wrcoef('d',c,l,'db1',2);
d1 = wrcoef('d',c,l,'db1',1);
% Reconstruct s from the wavelet decomposition structure [c,l].
a0 = waverec(c,l,'db1');
load leleccum; s = leleccum(1:3920);
ls = length(s);
% Perform one step decomposition of s using db1.
[ca1,cd1] = dwt(s,'db1');
% Perform one step reconstruction of ca1 and cd1.
a1 = upcoef('a',ca1,'db1',1,ls);
d1 = upcoef('d',cd1,'db1',1,ls);
% Now plot a1 + d1.
% Invert directly decomposition of s using coefficients.
a0 = idwt(ca1,cd1,'db1',ls);
% Perform decomposition at level 3 of s using db1.
[c,l] = wavedec(s,3,'db1')
% Extract approximation coefficients at level 3,
% from wavelet decomposition structure [c,l].
ca3 = appcoef(c,l,'db1',3);
% Extract detail coefficients at levels 1, 2 and 3,
% from wavelet decomposition structure [c,l].
cd3 = detcoef(c,l,3);
cd2 = detcoef(c,l,2);
cd1 = detcoef(c,l,1);
% Reconstruct approximation at level 3,
% from wavelet decomposition structure [c,l].
a3 = wrcoef('a',c,l,'db1',3);
% Reconstruct detail coefficients at levels 1,2 and 3,
% from the wavelet decomposition structure [c,l].
d3 = wrcoef('d',c,l,'db1',3);
d2 = wrcoef('d',c,l,'db1',2);
d1 = wrcoef('d',c,l,'db1',1);
% Reconstruct s from the wavelet decomposition structure [c,l].
a0 = waverec(c,l,'db1');
全部回答
- 1楼网友:一场云烟
- 2021-02-10 02:22
我也在做这个,不过跟你的方向不一样。不过也是用matlab做图像处理。 我不知道你说的"图像的一级、二级分解以及图像的合成"是什么。我做的是图像匹配,用“提取方向图->滤波,增强-〉细化-〉分类-〉提取奇异点-〉匹配”.当然根据具体的算法不同,顺序也会不不完全一样。 图像分割和增强在matl紶旦官秆擢飞规时海江ab中都有相应的函数。你看图像基础知识了吗,如果没看要先看,尤其要看图像在计算机中的表达方式。 我老师发过来的关于matlab的ppt,如果需要的话我给你发过去。
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯