%Di_gen_wp_L1P
%Discrete-time wavelets of first level




% type_gen1=input('[level,block]; 0--former; ?')
% if max(type_gen1)~=0
%     type_gen=type_gen1;
% end
lole1=input('loglength of signal;0--former; ?')
if lole1>0
    lole=lole1;
    N=2^lole;
end
shi=1;
Par1=[2:2:10];%input('spline orders;0--former; ?')
if Par1>0
    Par=Par1;
end


SP0=[];fSP0=[];
SP1=[];fSP1=[];
for kk=1:5
    P=Par(kk);
   % rho=Rho(kk);
[q fspli0]=wp_genP([1 0],P,N,1);
spli0=real(ifft(fspli0));
spli0=circ_h(spli0,N/4);
SP0=[SP0;spli0];
fSP0=[fSP0;fspli0];
[q fspli1]=wp_genP([1 1],P,N,1);
spli1=real(ifft(fspli1));
spli1=circ_h(spli1,3*N/4);
SP1=[SP1;spli1];
fSP1=[fSP1;abs(fspli1)];
end
x=(1:N)-N/2;
y=x;

figure;
for kk=1:5
eval(['subplot(5,2,' int2str(2*kk-1) ')'])
a0=[SP0(kk,:) ];
plot(y,a0,'LineWidth',2);hold on
a1=[SP1(kk,:) ];
plot(y,a1,'r','LineWidth',2);
hold off
     title(['\fontsize{16}Spline order: '  int2str(Par(kk))])

 axis([y(1) y(end) -.5 1])
 set(gca,'FontSize',16)
eval(['subplot(5,2,' int2str(2*kk) ')'])
a0=[fSP0(kk,:) ];
a0=circshift(a0',N/2)';
plot(a0,'LineWidth',2);hold on
a1=[fSP1(kk,:) ];
a1=circshift(a1',N/2)';
plot(a1,'--','LineWidth',2);hold off

     title(['\fontsize{16}Spline order: '  int2str(Par(kk))])

 axis([1,N+1, 0 2])
set(gca,'XTick',[1 64 128 192 256]/2)
%set(gca,'XTickLabel',{'-2\pi','-\pi','0','pi','2pi'})
set(gca,'XTickLabel',{'-64','-32','0','32','64'})
set(gca,'FontSize',16)
end
% Copyright (c) 2013. Valery A. Zheludev