Ondelettes Matlab PDF
Ondelettes Matlab PDF
Ondelettes Matlab PDF
Jérôme LANDRÉ
http://jlandre.ifrance.com
1 / 20
Table des matières
1. INTRODUCTION...................................................................................................................... 3
1.1. Matlab................................................................................................................................ 3
1.2. Les ondelettes................................................................................................................... 3
2. DESCRIPTION DE LA BOÎTE A OUTILS ONDELETTES........................................................ 4
REFERENCES........................................................................................................................... 20
BIBLIOGRAPHIE........................................................................................................................ 20
Conventions:
2 / 20
1. INTRODUCTION
1.1. Matlab
Matlab est un environnement de calcul intégré basé sur un langage de programmation qui
permet le développement rapide d'applications. Le langage permet la manipulation d'objets
mathématiques à l'aide de fonctions. Matlab a été conçu à l'origine pour le calcul matriciel
(MATrix LABoratory).
Matlab dispose de fonctions de calcul de base ainsi que de bibliothèques plus spécialisées
appelées boîtes à outils (toolboxes). Nous allons nous intéresser à l'une d'elles en particulier, la
boîte à outils ondelettes.
La théorie des ondelettes [1] est apparue au début des années 1990, elle touche de
nombreux domaines des mathématiques, notamment le traitement du signal et des images. La
boîte à outils Ondelettes de Matlab propose de nombreuses fonctions de manipulation des
ondelettes.
V-2 W-2 V0 : Espace de départ, V-1 : Approx. Niv. 1, W-1 : Détails niv. -1, ...
...
3 / 20
2. DESCRIPTION DE LA BOÎTE A OUTILS ONDELETTES
Wavelets: General.
biorfilt - Biorthogonal wavelet filter set.
centfrq - Wavelet center frequency.
dyaddown - Dyadic downsampling.
dyadup - Dyadic upsampling.
intwave - Integrate wavelet function psi.
orthfilt - Orthogonal wavelet filter set.
qmf - Quadrature mirror filter.
scal2frq - Scale to frequency.
wavefun - Wavelet and scaling functions.
wavefun2 - Wavelets and scaling functions 2-D.
wavemngr - Wavelet manager.
wfilters - Wavelet filters.
wmaxlev - Maximum wavelet decomposition level.
Wavelet Families.
biorwavf - Biorthogonal spline wavelet filters.
cgauwavf - Complex Gaussian wavelet.
cmorwavf - Complex Morlet wavelet.
coifwavf - Coiflet wavelet filter.
dbaux - Daubechies wavelet filter computation.
dbwavf - Daubechies wavelet filters.
fbspwavf - Complex Frequency B-Spline wavelet.
gauswavf - Gaussian wavelet.
mexihat - Mexican Hat wavelet.
4 / 20
meyer - Meyer wavelet.
meyeraux - Meyer wavelet auxiliary function.
morlet - Morlet wavelet.
rbiowavf - Reverse Biorthogonal spline wavelet filters.
shanwavf - Complex Shannon wavelet.
symaux - Symlet wavelet filter computation.
symwavf - Symlet wavelet filter.
Lifting Functions
addlift - Adding primal or dual lifting steps.
5 / 20
bswfun - Biorthogonal scaling and wavelet functions.
displs - Display lifting scheme.
filt2ls - Filters to lifting scheme.
ilwt - Inverse 1-D lifting wavelet transform.
ilwt2 - Inverse 2-D lifting wavelet transform.
liftfilt - Apply elementary lifting steps on filters.
liftwave - Lifting scheme for usual wavelets.
lsinfo - Information about lifting schemes.
lwt - Lifting wavelet decomposition 1-D.
lwt2 - Lifting wavelet decomposition 2-D.
lwtcoef - Extract or reconstruct 1-D LWT wavelet coefficients.
lwtcoef2 - Extract or reconstruct 2-D LWT wavelet coefficients.
wave2lp - Laurent polynomial associated to a wavelet.
wavenames - Wavelet names information.
6 / 20
ntree - Constructor for the class NTREE.
plot - Plot tree object.
read - Read values in tree object fields.
readtree - Read wavelet packet decomposition tree from a figure.
set - Set tree object field contents.
tnodes - Determine terminal nodes (obsolete - use LEAVES).
treedpth - Tree depth.
treeord - Tree order.
wptree - Constructor for the class WPTREE.
wpviewcf - Plot wavelet packets colored coefficients.
write - Write values in tree object fields.
wtbo - Constructor for the class WTBO.
wtreemgr - NTREE object manager.
General Utilities.
wcodemat - Extended pseudocolor matrix scaling.
wextend - Extend a Vector or a Matrix.
wkeep - Keep part of a vector or a matrix.
wrev - Flip vector.
wtbxmngr - Wavelet Toolbox manager.
Other.
wvarchg - Find variance change points.
Wavelets Information.
waveinfo - Information on wavelets.
Demonstrations.
wavedemo - Wavelet Toolbox demos.
demolift - Demonstrates Lifting functions in the Wavelet Toolbox.
>>
>> wavemenu
7 / 20
3.2. wavemenu 1D
8 / 20
3.3. wavemenu 2D
>> wavedemo
9 / 20
La partie Command line mode détaille la programmation des fonctions d'analyse
multirésolution.
10 / 20
4. LANGAGE DE PROGRAMMATION
>> clear
>> load noisbump.mat;
>> sig=noisbump;
>> whos
Name Size Bytes Class
>> figure;plot(sig);
11 / 20
b) Analyse multirésolution à un niveau et affichage du résultat :
>> [a,d]=dwt(sig,'db2');
>> figure;
>> subplot(2,2,1);plot(sig);subplot(2,2,3);plot(a);subplot(2,2,4);plot(d);
Dans l'exemple ci-dessous, on calcule la transformée (analyse) d'un signal à trois niveaux
de résolution, ensuite on effectue la reconstruction (synthèse). Cette transformée utilise les
ondelettes symlets d'ordre 3.
12 / 20
b) Reconstruction à trois niveaux de résolution et affichage du résultat :
>> orig=waverec(c,l,'sym3');
>> figure;subplot(2,2,1);plot(sig);
>> subplot(2,2,2);plot(orig);
>> subplot(2,2,3);plot(sig-orig);
13 / 20
4.2. Analyse Multirésolution 2D
>> [ap,dh,dv,dd]=dwt2(img,'db4');
>> figure;imshow([ap,dh;dv,dd]);
14 / 20
>> figure;imshow([ap/2,dh*8;dv*8,dd*8]);
15 / 20
>> figure;mesh([ap,dh;dv,dd]);
>> size(dv)
ans =
303 403
>> dv=zeros(303,403);
>> size(dd)
ans =
303 403
>> dd=zeros(303,403);
c) Reconstruction et affichage :
>> new=idwt2(ap,dh,dv,dd,'db4');
>> figure;imshow(new);
16 / 20
4.2.2. Analyse à deux niveaux de résolution :
Dans l'exemple suivant, on calcule la transformée (analyse) d'une image à deux niveaux
de résolution.
>> [c,s]=wavedec2(img,2,'haar');
>> a2=appcoef2(c,s,'haar',2);
>> a1=appcoef2(c,s,'haar',1);
>> figure;
>> subplot(1,3,1);imshow(img);
>> subplot(1,3,2);imshow(a1/2);
>> subplot(1,3,3);imshow(a2/4);
17 / 20
>> dh2=detcoef2('h',c,s,2);
>> dh1=detcoef2('h',c,s,1);
>> dv2=detcoef2('v',c,s,2);
>> dv1=detcoef2('v',c,s,1);
>> dd2=detcoef2('d',c,s,2);
>> dd1=detcoef2('d',c,s,1);
>> figure;
>> subplot(1,3,1);imshow(img);
>> subplot(1,3,2);imshow([a1/2,dh1;dv1,dd1]);
>> subplot(1,3,3);imshow([a2/4,dh2;dv2,dd2]);
18 / 20
5. CONCLUSION
Dans la dernière version, la boîte ondelettes apporte les transformées lifting scheme (ou
ondelettes de seconde génération) définies par Sweldens [2], y compris les transformées en
nombres entiers définies par Calderbank [3].
Il existe d'autres boîtes à outils ondelettes sous Matlab qui ont l'avantage d'être gratuites
comme WaveLab (http://www-stat.stanford.edu/~wavelab) ou bien encore Yamwt
(http://www.fyma.ucl.ac.be/projects/yawtb).
19 / 20
REFERENCES
- Matlab, http://www.mathworks.com
- ...
BIBLIOGRAPHIE
20 / 20