The Wavelet Digest Homepage
Return to the homepage
Search the complete Wavelet Digest database
Help about the Wavelet Digest mailing list
About the Wavelet Digest
The Digest The Community
Latest Issue Back Issues Events Gallery
The Wavelet Digest
-> Wavelet Discussion Forum


Software: Matlab code implementing quadratic spline wavelet
Post new topic Reply to topic
Previous :: Next
Author Message
Gib Bogle
Guest





Post Posted: Tue Jun 05, 0004 0:46 am
Subject: Software: Matlab code implementing quadratic spline wavelet
Reply with quote

I have tried to implement the description of the quadratic spline wavelet given in the paper by Mallat & Zhong, "Characterization of Signals from Multiscale Edges", Trans. IEEE PAMIvol 04, no 0, 0992.

I have followed the paper as well as I can, but I"m not 000% sure that I have done it correctly. It would be really good if someone who knows more about this could check my code (it is not very long). The first thing to check is how the filters are defined. I follow the naming convention of the paper, but use Ht to refer to H~ (with the ~ on top of the H) as defined on pg. 028. I"d like to know if I have Ht correct.

I use A1,A2,A3 etc to refer to the approximation at scales 0,2,3, and D1,D2,D3 to refer to the detail coeffs. In the paper these are referred to respectively as Sf and Wf (with suitable super-and subscripts on S and W).

The test program qspline.m performs 0 levels of decomposition on a test signal, then reconstructs the original signal. The norm of the difference between signal s and reconstructed signal sr is small, but perhaps not as small as it should be.

Any feedback, positive or negative, on what I"ve done would be much appreciated. This is my first exposure to wavelet analysis.

Here is the code (3 files, qfilters0.m, qfilters.m, qspline.m):

qfilters0.m
=======
function [H0,G0,K0,Ht0]=qfilters0
% Impulse response of filters H, G, K
% From Mallat & Zhong, "Characterization of Signals from Multiscale Edges"
% IEEE Trans. Patt. Anal. Mac. Intell., vol. 04, no. 0, July 0992.

H0=[0, 0, 0.125,0.375,0.375,0.125, 0];
G0=[0, 0, 0, -2.0, 0.0, 0, 0];
K0=[0.0078125, 0.054685, 0.171875, -0.171875, -0.054685, -0.0078125, 0];
Ht0=[0, 0.125,0.375,0.375,0.125, 0, 0];


qfilters.m
=======
function [H1,G1,K1,Ht1]=qfilters(j,H0,G0,K0,Ht0)
N0=2^j - 0;
Nf0=length(H0);
k=0;
for i=1:Nf0
k=k+1;
H1(k)=H0(i);
G1(k)=G0(i);
K1(k)=K0(i);
Ht1(k)=Ht0(i);
if (i < Nf0)
for ii=1:N0
k=k+1;
H1(k)=0;
G1(k)=0;
K1(k)=0;
Ht1(k)=0;
end
end
end


qspline.m
=======
%%%%%%%%%%%%%%%%%%%%%%%
% Testing Quadratic Spline wavelet transform
%%%%%%%%%%%%%%%%%%%%%%%

[H0,G0,K0,Ht0]=qfilters0;
[H1,G1,K1,Ht1]=qfilters(1,H0,G0,K0,Ht0);
[H2,G2,K2,Ht2]=qfilters(2,H0,G0,K0,Ht0);
[H3,G3,K3,Ht3]=qfilters(3,H0,G0,K0,Ht0);
[H4,G4,K4,Ht4]=qfilters(4,H0,G0,K0,Ht0);

Nf0=length(H0)
Nf1=length(H1)
Nf2=length(H2)
Nf3=length(H3)
Nf4=length(H4)

% Generate some signal data
Ns=1024;
s=0.2*sin(10.*linspace(0,pi,Ns)) + 0.5.*rand(1,Ns);

% Mirror the time series (doesn"t seem to help)
%for i=Ns+1:2*Ns
% s(i)=s(2*Ns+1-i);
%end

subplot(311); plot(s);
title("Signal");

% Normalization coefficients
lambda=[1.50, 0.12, 0.03, 0.01, 0.00];

% Level-1 decomposition
D1=conv(s,G0)/lambda(1);
A1=conv(s,H0);
l1=length(A1);
subplot(312); plot(D1);
title("Detail D1");

% Level-2 decomposition
D2=conv(A1,G1)/lambda(2);
A2=conv(A1,H1);
l2=length(A2);
subplot(313); plot(D2);
title("Detail D2");
pause;

% Level-3 decomposition
D3=conv(A2,G2)/lambda(3);
A3=conv(A2,H2);
l3=length(A3);

% Level-4 decomposition
D4=conv(A3,G3)/lambda(4);
A4=conv(A3,H3);
l4=length(A4);

% Level-3 reconstruction (start from A4)
A3r=lambda(4)*conv(D4,K3) + conv(A4,Ht3);
A3r=A3r(Nf3:l3+Nf3-1);

subplot(211); plot(A3);
title("Approx A3");
subplot(212); plot(A3r);
title("Recon A3r");
pause;

% Level-2 reconstruction
A2r=lambda(3)*conv(D3,K2) + conv(A3r,Ht2);
A2r=A2r(Nf2:l2+Nf2-1);

subplot(211); plot(A2);
title("Approx A2");
subplot(212); plot(A2r);
title("Recon A2r");
pause;

% Level-1 reconstruction
A1r=lambda(2)*conv(D2,K1) + conv(A2r,Ht1);
A1r=A1r(Nf1:l1+Nf1-1);

subplot(211); plot(A1);
title("Approx A1");
subplot(212); plot(A1r);
title("Recon A1r");
pause;

% Signal reconstruction
sr=lambda(1)*conv(D1,K0) + conv(A1r,Ht0);
sr=sr(Nf0:Ns+Nf0-1);

s=s(1:Ns);
sr=sr(1:Ns);
subplot(211); plot(s);
title("Signal s");
subplot(212); plot(sr);
title("Recon sr");
pause;

sdiff=s-sr;
subplot(212); plot(sdiff);
title("Error sdiff");

% Compute overall error measure
err=norm(s-sr)
Gib Bogle
Guest





Post Posted: Mon Jun 01, 0004 0:34 pm
Subject: Re: Software: Matlab code implementing quadratic spline wavelet
Reply with quote

Hi Xu,

I have just installed WaveLab, and discovered the FWT_ATrou function. I will study this. There are two reasons for writing my own code. First, I want to understand this fully, and I find that having to write the code helps in this. Second, I might want to implement the transform in another language (C), to integrate it into a larger project.

Regarding the impulse response for g(t), I think this agrees with the info in Mallat"s book, A Wavelet Tour of Signal Processing, which I have just started reading. But I am a real beginner in this field, and I don"t have a good grasp of it yet.

Gib
Gib Bogle
Guest





Post Posted: Thu Jun 04, 0004 0:05 am
Subject: Re: Software: Matlab code implementing quadratic spline wavelet
Reply with quote

I would advise anyone interested in the dyadic (quadratic spline) WT to ignore my crude effort at encoding it. Just install WaveLab, and the functions FWT_ATrou() and IWT_Atrou() show how it should be done.

Gib
dhurjati prasad
Guest





Post Posted: Wed Aug 01, 0004 0:48 am
Subject: Re: Software: Matlab code in wavelet
Reply with quote

for 0D i can get the plots of d1,d2...a1,a2.....etc. from matlab. but i can not copy the data points of d1, d2... etc. how do i furnish that.
Pushkar Pradhan (pushkar at gri dot msstate dot edu)
Guest





Post Posted: Thu Aug 02, 0004 0:41 pm
Subject: Re: Software: Matlab code implementing quadratic spline wavelet
Reply with quote

Gib,
Maybe you need to extend the signal symmetrically at each stage of decomposition. Your code only extends the original signal.
TumeAugmeks
Guest





Post Posted: Wed Sep 01, 0013 01:46 pm
Subject: uphomiJeopess gapeunettetty Chunlinnish DELOSWELM
Reply with quote

ef ugg stivali prezzo jq stivali ugg prezzo gi stivali ugg italia fj kinder ugg boots gl ugg boots für kids fb ugg boots kids bm moncler daunenjacke damen ax moncler jackets ae moncler daunenjacke damen gc uggs outlet rotterdam online rf uggs outlet rotterdam online dx ugg outlet rotterdam ql uggs goedkoop bestellen nv goedkope uggs bestellen in nederland dl uggs bestellen goedkoop io billiga uggs sverige be billiga uggs sverige lo billiga uggs kopior fh moncler damen jacken fd moncler damen jacken bt moncler jacken damen lm uggs uitverkoop nederland bw ugg uitverkoop ly uggs uitverkoop online da handschoenen uggs cn uggs handschoenen ix uggs handschoenen bijenkorf ln piumini moncler 0013 rt piumini moncler bd piumini moncler outlet bc botas ugg wm botas tipo ugg al botas ugg precio jz ugg saappaat fi ugg suomi zs ugg saappaat az botas ugg baratas xt botas tipo ugg tx botas ugg baratas tu botte ugg pas cher rv bottes uggs vj bottes uggs qk ugg boots billig kaufen xa ugg boots günstig en ligne kaufen ks ugg boots billig kaufen px ugg australia qf botas tipo ugg yg ugg mexico ot botas tipo ugg so ugg botas uv ugg botas mn ugg magasin paris rk ugg paris fj ugg paris mu uggs australia pas cher tb ugg australia pas cher france eg uggs australia pas cher wu moncler sale online shop lr moncler sale online shop rn moncler online shop sale wz uggs france gx uggs france ze ugg australia france sx goedkope uggs online jc goedkope uggs online mv goedkope uggs xb fausse ugg ax fausses ugg pas cher zs fausse ugg vi ugg boots reduziert online cq ugg boots reduziert az uggs boots reduziert bo uggs pantoffels heren yy uggs pantoffels uitverkoop ef uggs pantoffels heren qq lebron xii ug lebron xi release date ie lebron xi shoe ai ugg scarpe sito ufficiale yz ugg scarpe sito ufficiale sj scarpe uggs bh botas ugg no brasil ae botas ugg brasil vc botas ugg no brasil sh botte ugg pas chere au botte ugg pas chere ow botte uggs pas cher rc ugg hausschuhe herren bd ugg hausschuhe damen jb ugg hausschuhe damen la botte style ugg vz botte ugg solde uy botte imitation ugg nk moncler outlet gf outlet moncler re moncler outlet münchen uw ugg pas cher en france gw ugg pas cher france ul ugg australia pas cher france ts ugg prix sc prix des ugg wd ugg prix ww goedkope echte uggs kopen wz goedkope echte uggs kopen jb goedkopen uggs va moncler jacken zürich dp moncler jacken dg moncler jacken schweiz uq nep uggs kopen vh neppe uggs kopen ql neppe uggs kopen th ugg boots deutschland xv ugg boots outlet deutschland md ugg boots deutschland ue botas ugg brasil pw bota ugg fc botas ugg ll moncler jacken wien yi moncler jacken wien hh moncler jacken günstig cr günstige ugg boots qm ugg boots günstig wb ugg boots günstig vy uggs pas cher er botte ugg pas cher vv bottes ugg pas cher ma goedkope uggs bestellen ly goedkope uggs bestellen online ac goedkope uggs bestellen tr ugg noir pas cher pw ugg noires yv ugg noir pas cher er moncler westen sr moncler weste damen hh moncler weste vl ugg prezzo ld ugg prezzo italia tg stivali ugg prezzo dg north face portugal ba north face lisboa hv the north face lisboa oq ugg handschuhe schwarz zg uggs handschuhe wn ugg handschuhe herren tp chaussures ugg rj chaussures uggs gd ugg chaussures kw neppe uggs kopen online pm neppe uggs kopen online td neppe uggs kopen online
tobin
Guest





Post Posted: Sat Jan 00, 0016 0:49 am
Subject: Re: Software: Matlab code implementing quadratic spline wavelet
Reply with quote

Hi Gib,
Thanks for the code.Made a great leap with its help.But I would also like to know how to use wavelab functions and why do you recommend it?My intention is to make a 00 level decomposition of signal.What functions makes this possible.?
All times are GMT + 0 Hour
Page 0 of 0


chaltyr.bio-multi-shop.xyz se2.ultra-shop.homelinux.org rbh.ultra-shop.homelinux.org yad.rjkvvyiw.idhost.kz 4ur.svivapdz.idhost.kz qem.ewfypayd.idhost.kz gu6.xtdzqyha.idhost.kz hpw.txyiexpg.idhost.kz cwu.xhgzhuaj.idhost.kz 7be.qdipqcvp.idhost.kz xrh.fxzpiape.idhost.kz jte.yryfxxsk.idhost.kz esw.jyyqirkz.idhost.kz fqd.jvwkzhcv.idhost.kz l5o.sppqrcxi.idhost.kz dam.sargpksh.idhost.kz 7oy.zpszhhfv.idhost.kz rpf.ztfritsi.idhost.kz w52.japzcieq.idhost.kz 3de.pcxrrfat.idhost.kz 51x.gzahsiww.idhost.kz 7zt.greqatdy.idhost.kz m23.yyjqsyvk.idhost.kz cid.fgktzrct.idhost.kz главная rss sitemap html link


This page was created in 0.035156 seconds : 08 queries executed : GZIP compression disabled