Haar Wavelet..
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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????
0 comentarios
Respuestas (2)
Wayne King
el 25 de Ag. de 2011
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
mukala gayatri
el 23 de Sept. de 2020
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 comentario
Ver también
Categorías
Más información sobre Discrete Multiresolution Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!