%GensplConsP3
%design of generators of spline spaces using ternary subdivision

Rho=zeros(1,6);
tyge=[
    '1--interpol;        '
    '2--Bspl    ;        '
    '3--Battle;          '
    ];
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 subdiv. iterations;0--former; ?')
if Ll1>0
    Ll=Ll1;
    M=N*3^Ll;
end
Par1=[3 5 9 13];%input('spline orders;0--former; ?')
if Par1>0
    Par=Par1;
end


SP=[];fSP=[];
for kk=1:4
    P=Par(kk);
  
[spli]=spligenP3(type_gen,P,N,Ll);
[mas,m]=max(spli);
lo=M/2-m;
spli=circ_h(spli,lo);
SP=[SP;spli];
%fSP=[fSP;afspli];
end
x=(1:M)-M/2;y=x/3^Ll;

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

a=[SP(kk,:) ];
plot(y,a,'LineWidth',2);
axis([-16 16 -.4 1.1])
     title(['\fontsize{20}Spline order: '  int2str(Par(kk))])
set(gca,'FontSize',16)
end
