| Wavelet Toolbox | |
| Provide feedback about this page |
Adding a New Wavelet Family
To add a new wavelet, use the wavemngr command in one of two forms:
Here are a few examples to illustrate how you would use wavemngr to add some of the predefined wavelet families:
Example 1
Let us take the example of Binlets proposed by Strang and Nguyen in pages 216-217 of the book Wavelets and Filter Banks (see [StrN96] in References).
The full family name is Binlets.
The short name of the wavelet family is binl.
The wavelet type is 2 (Biorthogonal with FIR filters).
The order of the wavelet within the family is 7.9 (we just use one in this example).
The M-file used to generate the filters is binlwavf.m
Then to add the new wavelet, type
% Add new family of biorthogonal wavelets. wavemngr('add','Binlets','binl',2,'7.9','binlwavf') % List wavelets families. wavemngr('read') ans = =================================== Haar haar Daubechies db Symlets sym Coiflets coif BiorSplines bior ReverseBior rbio Meyer meyr DMeyer dmey Gaussian gaus Mexican_hat mexh Morlet morl Complex Gaussian cgau Shannon shan Frequency B-Spline fbsp Complex Morlet cmor Binlets binl ===================================
If you want to get online information on this new family, you can build an associated help file which would look like the following:
function binlinfo %BINLINFO Information on biorthogonal wavelets (binlets). % % Biorthogonal Wavelets (Binlets) % % Family Binlets % Short name binl % Order Nr,Nd Nr = 7 , Nd = 9 % % Orthogonal no % Biorthogonal yes % Compact support yes % DWT possible % CWT possible % % binl Nr.Nd ld lr % effective length effective length % of LoF_D of HiF_D % binl 7.9 7 9
The associated M-file to generate the filters (binlwavf.m) is
function [Rf,Df] = binlwavf(wname) %BINLWAVF Biorthogonal wavelet filters (Binlets). % [RF,DF] = BINLWAVF(W) returns two scaling filters % associated with the biorthogonal wavelet specified % by the string W. % W = 'binlNr.Nd' where possible values for Nr and Nd are: Nr = 7 Nd = 9 % The output arguments are filters: % RF is the reconstruction filter % DF is the decomposition filter % Check arguments. if errargn('binlwavf',nargin,[0 1],nargout,[0:2]), error('*'); end % suppress the following line for extension Nr = 7; Nd = 9; % for possible extension % more wavelets in 'Binlets' family %---------------------------------- if nargin==0 Nr = 7; Nd = 9; elseif isempty(wname) Nr = 7; Nd = 9; else if ischar(wname) lw = length(wname); ab = abs(wname); ind = find(ab==46 | 47<ab | ab<58); li = length(ind); err = 0; if li==0 err = 1; elseif ind(1)~=ind(li)-li+1 err = 1; end if err==0 , wname = str2num(wname(ind)); if isempty(wname) , err = 1; end end end if err==0 Nr = fix(wname); Nd = 10*(wname-Nr); else Nr = 0; Nd = 0; end end % suppress the following lines for extension % and add a test for errors. %------------------------------------------- if Nr~=7 , Nr = 7; end if Nd~=9 , Nd = 9; end if Nr == 7 if Nd == 9 Rf = [-1 0 9 16 9 0 -1]/32; Df = [ 1 0 -8 16 46 16 -8 0 1]/64; end end
Example 2
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.
% List initial wavelets families. wavemngr('read') ans = =================================== Haar haar Daubechies db Symlets sym Coiflets coif BiorSplines bior ReverseBior rbio Meyer meyr DMeyer dmey Gaussian gaus Mexican_hat mexh Morlet morl Complex Gaussian cgau Shannon shan Frequency B-Spline fbsp Complex Morlet cmor =================================== % List all wavelets. wavemngr('read',1) ans = =================================== Haar haar =================================== Daubechies db ------------------------------ db1 db2 db3 db4 db5 db6 db7 db8 db9 db10 db** =================================== Symlets sym ------------------------------ sym2 sym3 sym4 sym5 sym6 sym7 sym8 sym** =================================== Coiflets coif ------------------------------ coif1 coif2 coif3 coif4 coif5 =================================== 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 =================================== ReverseBior rbio ------------------------------ rbio1.1 rbio1.3 rbio1.5 rbio2.2 rbio2.4 rbio2.6 rbio2.8 rbio3.1 rbio3.3 rbio3.5 rbio3.7 rbio3.9 rbio4.4 rbio5.5 rbio6.8 =================================== Meyer meyr =================================== DMeyer dmey =================================== Gaussian gaus ------------------------------ gaus1 gaus2 gaus3 gaus4 gaus5 gaus6 gaus7 gaus8 gaus** =================================== Mexican_hat mexh =================================== Morlet morl =================================== Complex Gaussian cgau ------------------------------ cgau1 cgau2 cgau3 cgau4 cgau5 cgau** =================================== Shannon shan ------------------------------ shan1-1.5 shan1-1 shan1-0.5 shan1-0.1 shan2-3 shan** =================================== Frequency B-Spline fbsp ------------------------------ fbsp1-1-1.5 fbsp1-1-1 fbsp1-1-0.5 fbsp2-1-1 fbsp2-1-0.5 fbsp2-1-0.1 fbsp** =================================== Complex Morlet cmor ------------------------------ cmor1-1.5 cmor1-1 cmor1-0.5 cmor1-1 cmor1-0.5 cmor1-0.1 cmor** =================================== % 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. % The 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 Symlets sym Coiflets coif BiorSplines bior ReverseBior rbio Meyer meyr DMeyer dmey Gaussian gaus Mexican_hat mexh Morlet morl Complex Gaussian cgau Shannon shan Frequency B-Spline fbsp Complex Morlet cmor Lemarie lem ===================================
| Provide feedback about this page |
![]() | Preparing to Add a New Wavelet Family | After Adding a New Wavelet Family | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |