| Wavelet Toolbox | Search  Help Desk |
| wavemngr | Examples |
wavemngr('create')
wavemngr('add',FN,FSN,WT,NUMS,FILE)
wavemngr('add',FN,FSN,WT,NUMS,FILE,B)
wavemngr('del',N)
wavemngr('restore')
wavemngr('restore',IN2)
OUT1 = wavemngr('read')
OUT1 = wavemngr('read',IN2)
OUT1 = wavemngr('read_asc')
wavemngr is a type of wavelets manager. It allows you to create, add, delete, restore, or read wavelets.
wavemngr('create') creates the wavelets.inf MAT-file using the wavelets.asc ASCII-file.
wavemngr('add',FN,FSN,WT,NUMS,FILE) or wavemngr('add',FN,FSN,WT,NUMS,FILE,B), adds a new wavelet family to the toolbox.
FN = Family Name (string)
FSN = Family Short Name (string of length less than four characters)
WT = Wavelet type
WT = 1, orthogonal wavelets
WT = 3, wavelet with scaling function
WT = 4, wavelet without scaling function
FILE = MAT-file or M-file name (string). See the example for usage.
B = [lb ub] lower and upper bounds of effective support for wavelets of wavemngr('del',N), deletes a wavelet family. FSN = Family Short Name or Wavelet Name (in the family).
wavemngr('restore') or wavemngr('restore',IN2), restores previous or initial wavelets. If nargin = 1, the previous wavelets.asc file is restored; otherwise the initial wavelets.asc file is restored. Here IN2 is a dummy argument.
OUT1 = wavemngr('read') OUT1 gives all wavelets families.
OUT1 = wavemngr('read',IN2) returns all wavelets, IN2 is a dummy OUT1 = wavemngr('read_asc') reads wavelets.asc ASCII-file and OUT1 gives all wavelets information.
% List initial wavelets families.
wavemngr('read')
ans =
===================================
Haar haar
Daubechies db
BiorSplines bior
Coiflets coif
Symlets sym
Morlet morl
Mexican_hat mexh
Meyer meyr
===================================
% List all wavelets.
wavemngr('read',1)
ans =
===================================
Haar haar
===================================
Daubechies db
------------------------------
db1 db2 db3 db4
db5 db6 db7 db8
db9 db10 dbxx
===================================
BiorSplines bior
------------------------------
bior1.1 bior1.3 bior1.5 bior2.2
bior2.4 bior2.6 bior2.8 bior3.1
bior3.3 bior3.5 bior3.7 bior3.9
bior4.4 bior5.5 bior6.8
===================================
Coiflets coif
------------------------------
coif1 coif2 coif3 coif4
coif5
===================================
Symlets sym
------------------------------
sym2 sym3 sym4 sym5
sym6 sym7 sym8
===================================
Morlet morl
===================================
Mexican_hat mexh
===================================
Meyer meyr
===================================
In the following example, new compactly supported orthogonal wavelets are added to the toolbox. These wavelets, which are a slight generalization of the Daubechies wavelets, are based on the use of Bernstein polynomials and are due to Kateb and Lemarié in an unpublished work.
Note: The M-files used in this example can be found in the wavedemo directory.
% Add new family of orthogonal wavelets.
% You must define:
%
% Family Name: Lemarie
% Family Short Name: lem
% Type of wavelet: 1 (orth)
% Wavelets numbers: 1 2 3 4 5
% File driver: lemwavf
%
% The function lemwavf.m must be as follow:
% function w = lemwavf(wname)
% where the input argument wname is a string:
% wname = 'lem1' or 'lem2' ... i.e.,
% wname = sh.name + number
% and w the corresponding scaling filter.
% Ten addition is obtained using:
wavemngr('add','Lemarie','lem',1,'1 2 3 4 5','lemwavf');
% The ascii file 'wavelets.asc' is saved as
% 'wavelets.prv', then it is modified and
% the MAT file 'wavelets.inf' is generated.
% List wavelets families.
wavemngr('read')
ans =
===================================
Haar haar
Daubechies db
BiorSplines bior
Coiflets coif
Symlets sym
Morlet morl
Mexican_hat mexh
Meyer meyr
Lemarie lem
===================================
% Remove the added family.
wavemngr('del','Lemarie');
% List wavelets families.
wavemngr('read')
ans =
===================================
Haar haar
Daubechies db
BiorSplines bior
Coiflets coif
Symlets sym
Morlet morl
Mexican_hat mexh
Meyer meyr
===================================
% Restore the previous ascii file
% 'wavelets.prv', then build
% the MAT-file 'wavelets.inf'.
wavemngr('restore');
% List restored wavelets.
wavemngr('read',1)
ans =
===================================
Haar haar
===================================
Daubechies db
------------------------------
db1 db2 db3 db4
db5 db6 db7 db8
db9 db10 dbxx
===================================
BiorSplines bior
------------------------------
bior1.1 bior1.3 bior1.5 bior2.2
bior2.4 bior2.6 bior2.8 bior3.1
bior3.3 bior3.5 bior3.7 bior3.9
bior4.4 bior5.5 bior6.8
===================================
Coiflets coif
------------------------------
coif1 coif2 coif3 coif4 coif5
===================================
Symlets sym
------------------------------
sym2 sym3 sym4 sym5
sym6 sym7 sym8
===================================
Morlet morl
===================================
Mexican_hat mexh
===================================
Meyer meyr
===================================
Lemarie lem
------------------------------
lem1 lem2 lem3 lem4 lem5
===================================
% Restore initial wavelets.
%
% Restore the initial ascii file
% 'wavelets.ini' and initial
% MAT-file 'wavelets.bin'.
wavemngr('restore',0);
% List wavelets families.
wavemngr('read')
ans =
===================================
Haar haar
Daubechies db
BiorSplines bior
Coiflets coif
Symlets sym
Morlet morl
Mexican_hat mexh
Meyer meyr
===================================
% Add new family of orthogonal wavelets.
wavemngr('add','Lemarie','lem',1,'1 2 3','lemwavf');
% All command line capabilities are available for
% the new wavelets.
%
% Example 1: compute the four associated filters.
[Lo_D,Hi_D,Lo_R,Hi_R] = wfilters('lem3');
% Example 2: compute scale and wavelet functions.
[phi,psi,xval] = wavefun('lem3');
% Add a new family of orthogonal wavelets: special form
% for the GUI mode.
%
% The M-file lemwavf allows you to compute the filter for
% any order. If you want to get a popup of the form
% 1 2 3 **, associated with the family, then wavelets are
% appended for GUI mode using:
wavemngr('restore',0);
wavemngr('add','Lemarie','lem',1,'1 2 3 **','lemwavf');
% After this sequence, all GUI capabilities are available for
% the new wavelets.
% Note that the last command allows a short cut in the
% order definition only if possible orders are integers.
Caution: wavemngr works on the current directory. If you add a new wavelet family, it is available in this directory only. Refer to Chapter 7, "Adding Your Own Wavelets ."
wavemngr allows you to add a new wavelet. You must verify that it is truly a wavelet. No check is performed either about this point or about the type of the new wavelet.