- 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)
조회 수: 2 (최근 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!