%D_wp_level2P

lole1=8%input('loglength of signal;0--former; ?')
if lole1>0
    lole=lole1;
    N=2^lole;
end
 N=256;
 M=N;
 n1=-N/2:N/2-1;
 n=0:N-1;
 p1=input('spline order;0--former; ?')
 if p1>0
     p=p1;
 end
 
 [Uc,Uc1,Uc2,cU,cU1,cU2]=D_u_co_siP(p,N,n);



SP=zeros(4,N);;fSP=SP;
fs=cU1.*Uc;
s=real(ifft(fs));
fSP(4,:)=fs;
SP(4,:)=s;
fs=Uc1.*cU;
s=real(ifft(fs));
fSP(2,:)=fs;
SP(2,:)=s;
fs=Uc1.*Uc;
s=real(ifft(fs));
fSP(3,:)=fs;
SP(3,:)=s;
fs=cU1.*cU;
s=real(ifft(fs));
fSP(1,:)=fs;
SP(1,:)=s;

%plot(n1,cU1.*Uc,'b--',n1,Uc1.*cU,'k',n1,Uc1.*Uc,'b:',n1,cU1.*cU,'k-.','LineWidth',2)

x=(1:M)-M/2;
y=x;

figure;
subplot(2,1,1)
for kk=1:4
a=[SP(kk,:) ];
a=circ_h(a,(kk-2)*M/4-M/8);
plot(y,a,'LineWidth',2);
hold on
axis([y(1) y(end) -1 1])
    set(gca,'FontSize',16)

end
  title(['\fontsize{16}Spline order: '  int2str(p)])
 
subplot(2,1,2)
for kk=1:4
a=[fSP(kk,:) ];
a=circ_h(a,N/2);
a=a(1:N/2);
plot(a,'LineWidth',2);
hold on
axis([1,N/2+1, 0 2.2])
 set(gca,'XTick',[1 32 64 96 128])
 %set(gca,'XTickLabel',{'-2\pi','-\pi','0','pi','2pi'})
 set(gca,'XTickLabel',{'0','N/8','N/4','3N/8','N/2'})   
end

set(gca,'FontSize',16)
