| Wavelet Toolbox | ![]() |
Example 1
Let us take the example of Binlets proposed by Strang and Nguyen in the 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:
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
| Adding a New Wavelet Family | Example 2 | ![]() |