%GensplConsP
%display of generators of even-order spline spaces (using binary subdivision) and their SHA spectra


tyge=[
    '1--inter;        '
    '2--Bsp-dual;     '
    '3--inter-dual;   '
    '4--Battle;       '
    '5--B spline      '
    '6--smoothing     '
    %'7--B wavelet     '
    ];
disp(tyge)

type_gen=input('type of generator; ?')
lole1=input('loglength of signal;0--former; ?')
if lole1>0
    lole=lole1;
    N=2^lole;
end
shi=1;%input('shift to the center--1; ?')
Ll1=input('number of subdivision steps;0--former; ?')
if Ll1>0
    Ll=Ll1;
    M=N*2^Ll;
end
Par1=input('set of four spline orders  ;0--former; ?')
if Par1>0
    Par=Par1;
end
if type_gen==6
    rho1=input('set of four regularization parameters rho;0--former; ?')
    if max(rho1)>0
        Rho=rho1;
    end
end

SP=[];fSP=[];
for kk=1:4
    P=Par(kk);
    rho=Rho(kk);
[spli]=spligenP(type_gen,P,N,Ll,rho);
SP=[SP;spli];
fspli=s_spegenP(type_gen,P,N,rho);
fSP=[fSP;fspli];
end
x=(1:M)-M/2;y=x/2^Ll;

figure;
for kk=1:4
eval(['subplot(4,2,' int2str(2*kk-1) ')'])

a=[SP(kk,:) ];rho=Rho(kk); 
plot(y,a,'LineWidth',2);
set(gca,'FontSize',16)
if type_gen==6
  
  
%title(['\fontsize{16}Spline order: '  int2str(Par(kk)) ', \rho=' num2str(rho)])

else
     %title(['\fontsize{16}Spline order: '  int2str(Par(kk))])
end
% if kk==1
% 
ma=min(a);Ma=max(a);
axis([-16 16 ma-.1 Ma+.1])

end
%figure;
for kk=1:4
eval(['subplot(4,2,' int2str(2*kk) ')'])
a=fSP(kk,:);
%a=circ_h(fSP(kk,:),N/2)';
rho=Rho(kk);
plot(a,'LineWidth',2);
set(gca,'FontSize',16)
if type_gen==6
   
title(['\fontsize{16}Spline order: '  int2str(Par(kk)) ', \rho=' num2str(rho)])
else
     title(['\fontsize{16}Spline order: '  int2str(Par(kk))])
end
ma=max(a);
%   
axis([0 N/2  0 ma+.1])
set(gca,'XTick',0:N/4:N/2)
%set(gca,'XTickLabel',{'-2\pi','-\pi','0','pi','2pi'})
set(gca,'XTickLabel',{'0','N/4','N/2'})
% end
% %hold on
 end
