% file:      	battle_lemarie.m, (c) Matthew Roughan, Mon Aug 14 2006
%
opts = struct('height',8, 'width', 8.5, 'Color', 'rgb');
n = 1024;
J = log2(n);
j_i = [5 6];
p_i = [1 3];
for i=1:length(pi)
  j = j_i(i);
  p = p_i(i);
  k = 2^(J-j-1);
  m = MakeWavelet(J-j,k,'Battle',p,'Mother',n).*2^(j/2);
  i_m = (((1:n)-n/2)./2^j);
  figure(1)
  p1 = plot(i_m,-m, 'b', 'linewidth', 3);
  set(gca, 'fontsize', 18, 'linewidth', 3);
  title(sprintf('mother wavelet \\psi(t), p = %d', p));
  axis([-5 5 -1.5 1])
  exportfig(gcf,sprintf('Plots/battle_lemarie_m_%05d.eps',p), opts, 'format', 'eps');

  f = MakeWavelet(J-j,k,'Battle',p,'Father',n).*2^(j/2);
  i_f = (((1:n)-n/2)./2^j)+1;
  figure(2)
  p2 = plot(i_f,f, 'b', 'linewidth', 3);
  set(gca, 'fontsize', 18, 'linewidth', 3);
  title(sprintf('scaling function \\phi(t), p = %d', p));
  axis([0 7 -0.5 1.5])
  exportfig(gcf,sprintf('Plots/battle_lemarie_f_%05d.eps',p), opts, 'format', 'eps');
end
