Haar Wavelet..

조회 수: 15 (최근 30일)
Aditya
Aditya 2011년 8월 25일
댓글: Laura Carballo-Sigler 2023년 2월 19일
Hey, I have to basically input a 128*128 Haar Wavelet Matrix. Thing is, I'll either have to code it in or hardcode the values myself. Does anyone know any inbuilt class or any function I can use to save any time????

답변 (2개)

Wayne King
Wayne King 2011년 8월 25일
Hi Aditya, Can you be more specific what you mean by the Haar wavelet matrix? Are you attempting to implement a 1-D DWT using the Haar wavelet? And if so, is it necessary that you implement as a matrix multiplication. If you have the Wavelet Toolbox, there are much more efficients ways to do it.
Wayne
  댓글 수: 1
Aditya
Aditya 2011년 8월 25일
Hey! Thanks for your quick reply. I want a 2-D Haar Matrix...
like... 1 1 1 1
1 1 -1 -1
1 -1 0 0
0 0 1 -1
only well, for 128 rows and columns. I will then carry out the squaring of elements and division. Is there any inbuilt function or code which foes all this? Or will I have to do it on my own?

댓글을 달려면 로그인하십시오.


mukala gayatri
mukala gayatri 2020년 9월 23일
function H=haarmtx(n)
% HAARMTX Compute Haar orthogonal transform matrix.
%
% H = HAARMTX(N) returns the N-by-N HAAR transform matrix. H*A
% is the HAAR transformation of the columns of A and H'*A is the inverse
% transformation of the columns of A (when A is N-by-N).
% If A is square, the two-dimensional Haar transformation of A can be computed
% as H*A*H'. This computation is sometimes faster than using
% DCT2, especially if you are computing large number of small
% Haar transformation, because H needs to be determined only once.
%% Class Support
% -------------
% N is an integer scalar of class double. H is returned
% as a matrix of class double.
%
%
% I/O Spec
% N - input must be double
% D - output DCT transform matrix is double
%
% Author : Frederic Chanal (f.j.chanal@student.tue.nl) - 2004
a=1/sqrt(n);
for i=1:n
H(1,i)=a;
end
for k=1:n-1
p=fix(log2(k));
q=k-2^p+1;
t1=n/2^p;
sup=fix(q*t1);
mid=fix(sup-t1/2);
inft=fix(sup-t1);
t2=2^(p/2)*a;
for j=1:inft
H(k+1,j)=0;
end
for j=inft+1:mid
H(k+1,j)=t2;
end
for j=mid+1:sup
H(k+1,j)=-t2;
end
for j=sup+1:n
H(k+1,j)=0;
end
end
  댓글 수: 1
Laura Carballo-Sigler
Laura Carballo-Sigler 2023년 2월 19일
this is awesome!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Discrete Multiresolution Analysis에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by