- wavedec: https://www.mathworks.com/help/wavelet/ref/wavedec.html
- wacerec: https://www.mathworks.com/help/wavelet/ref/waverec.html
- appcoef: https://www.mathworks.com/help/wavelet/ref/appcoef.html
- detcoef: https://www.mathworks.com/help/wavelet/ref/detcoef.html
How to reconstruction multilevel wavelet (DWT)
9 次查看(过去 30 天)
显示 更早的评论
I want to reconstruction a2, d2, and d1 to be x, but length of a2, d2 ,and d1 are different. How to solve it?. Please help me
x = [5 7 8 9];
[LoD,HiD,LoR,HiR] = wfilters('db2');
% Decomposition
% level 1
cA1 = dyaddown(conv(x,LoD));
cD1 = dyaddown(conv(x,HiD));
% level 2
cA2 = dyaddown(conv(cA1,LoD));
cD2 = dyaddown(conv(cA1,HiD));
%Reconstruction
a1 = conv(dyadup(cA1),LoR);
d1 = conv(dyadup(cD1),HiR);
a2 = conv(dyadup((conv(dyadup(cA2),LoR))),LoR);
d2 = conv(dyadup((conv(dyadup(cD2),HiR))),LoR);
% a2+d2+d1 = x
0 个评论
回答(1 个)
Binaya
2024-8-21
Hi grandong
I understand that you would like to reconstruct your signal from wavelet coefficients. You can use "wavedec" and "waverec" functions to decompose and reconstruct your signal instead of using "dyadup" and "dyaddown" functions.
Here is a sample code snippet to decompose a signal, calculate coefficients and reconstruct the signal:
% Original signal
x = [5 7 8 9]
% Wavelet decomposition using 'db2'
waveletName = 'db2';
level = 2;
% Decompose the signal
[c, l] = wavedec(x, level, waveletName);
% Extract coefficients
cA1 = appcoef(c, l, waveletName, level-1)
cD1 = detcoef(c, l, level-1)
% Reconstruct the signal
xReconstructed = waverec(c, l, waveletName)
You can refer to the following documentation links for more details on:
I hope this answers your query.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Discrete Multiresolution Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!