% BuildDict helps you to construct a multiresolution-like spline wavelet dictionary or a
% B-spline dictionary
%
% To create a dictionary of your choice, edit this file and set the desired values of the
% variables.
%
% Available multiresolution-like dictionaries are:
%
% name='1'           Haar dictionary (cut-off construction)
%     ='2'           linear dictionary (cut-off construction)
%     ='4'           cubic dictionary (cut-off construction)
%     ='chui_cubic'  cubic spline wavelet basis (multiple knots)
%
% Available B-spline dictionaries are:
%
% name='1b'           piece-wise constant B-spline dictionary 
%     ='2b'           linear B-spline dictionary (cut-off construction)
%     ='4b'           cubic B-spline dictionary (cut-off construction)
%     ='Nb'           B-spline dictionary of order N (any positive integer)
%     ='chui_cubicb'  cubic B-spline dictionary (multiple knots)
%
% 
% Description of other parameters
%
%   a       dilation factor (positive integer)
%   b       translation factor (b=1 for basis, keep 1/b being integer)
%           use b=1 only for 'chui_cubic' and 'chui_cubicb'
%   sp      array sp=[c,d] stands for interval [c,d]
%   j       array containing all the scales to be considered
%           note that larger 'j' implies finer scale
%   L       number of points partitioning the interval sp=[sp(1) sp(2)]
%           it must be a positive integer value satisfying 
%           L=J*(sp(2)-sp(1))/(b*(a^(-jmax)))+1 where jmax stands for the
%           finest scale to be considered and J is a positive integer
% 
% Outputs:
%   x       dicretization of the interval sp containing L nodes
%   D       desired dictionary
%   ind     array of indices separating different scales in D 
%
% EXAMPLE:
% The following example constructs a cubic multiresolution-like wavelet dictionary D on
% the interval [0,8] with scale factor a=2, b=0.5, j=[0:4] The interval [0,8] will be
% partitioned into L=2049 points.
%
% name='4';b=0.5;a=2;
% sp=[0 8];
% j=[0:4]; 
% L=2049;
% [D, ind] =gdictfast(name,{L;sp;j;a;b});
%
% Comments:
% For B-spline dictionaries see also TestSpline
% For a cut-off multiresolution-like wavelet basis see ElimBound
%
% References:
%   M. Andrle and L. Rebollo-Neira, "Spline wavelet dictionaries for non-linear signal 
%   approximation", preprint, 2005.
%   M. Andrle and L. Rebollo-Neira, "Cardinal B-spline dictionaries on a compact 
%   interval", Applied and Computational Harmonic Analysis, Vol(18,3), 336-346 (2005).
%   C.K. Chui and E. Quak, "Wavelets on a Bounded Interval", in Numerical Methods of 
%   Approximation Theory, Vol. 9 (Eds. D. Braess and  L.L. Schumaker), pp. 53-75, 
%   Birkhauser, Basel, 1992.

% See http://www.ncrg.aston.ac.uk/Projects/BiOrthog/ for more details
name='4';b=0.25;a=2;
sp=[0 8];
j=[0:4]; 
L=2049;
%x is a dicretization of the interval sp=[sp(1) sp(2)]
x=linspace(sp(1),sp(2),L);
%creating of dictionary
[D, ind] =GDictFast(name,{L;sp;j;a;b});
%if want to set to zero the first and the last point of all functions in D
%D([1 end],:)=0;

%to plot the dictionary
%plot(x,D);


%Copyright (C) 2006 Miroslav ANDRLE and Laura REBOLLO-NEIRA
%
%This program is free software; you can redistribute it and/or modify it under the terms 
%of the GNU General Public License as published by the Free Software Foundation; either 
%version 2 of the License, or (at your option) any later version.
%
%This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
%without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%See the GNU General Public License for more details.
%
%You should have received a copy of the GNU General Public License along with this program;
%if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
%Boston, MA  02110-1301, USA.
