Multiresolution Discrete Wavelet Transforms
4 次查看(过去 30 天)
显示 更早的评论
Hi,
I am currently working on a problem related to the above subject. I get how to perform the transforms to various levels but do not seem to get the inverse right on any level beyond the first level. I understand that to reconstruct the original signal, certain elements of the decomposition need to be considered. The implementation of this is what i think I am getting wrong. I would appreciate if any pointers can be given. Below is a copy of the code I used modified to get the second level transformations.
Thanks
% program for haar wavelet transform
% it shows the plot of input signal as well as the transformed parts of the
% signal i.e. Low Frequencies and High Frequencies
function haarTransform2(f)
v=[1/sqrt(2) 1/sqrt(2)]; % Describes the haar scaling function
w=[1/sqrt(2) -1/sqrt(2)]; % Describes the haar wavelet function
% haar wavelet transform %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Second level transformation
d=length(f);
m=1:d/4;
a1=f(2*m-1).*v(1) + f(2*m).*v(2);
d1=f(2*m-1).*w(1) + f(2*m).*w(2);
% Inverse Wavelet Tranform
a2= idwt(a1, d1, 'haar');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%plots of transformation
figure(1)
subplot(4,1,1), plot(f)
title('Original Signal') %plot of the original signal
ylabel('Amplitude')
xlabel('Time')
axis tight
subplot(4,1,2), plot(a1)
title('Low Frequencies') %plot of low frequencies after haar wavelet transform
ylabel('Amplitude')
xlabel('Time')
axis tight
subplot(4,1,3), plot(d1)
title('High Frequencies') %plot of high frequencies after haar wavelet transform
ylabel('Amplitude')
xlabel('Time')
axis tight
subplot(4,1,4), plot(a2)
title('Reconstructed Signal') %plot of reconstructed signal after haar wavelet transform
ylabel('Amplitude')
xlabel('Time')
axis tight
end
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Signal Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!