%dsp_gen_spec_exam
m=6
dspl_char_f_iter
%%%%%%%%%%%%%%%%% B-splines 
figure;
subplot(1,2,1)
for kk=1:3
  W=1;
  r=2;
  fplot(@(v)(sin(v*2^(kk-1))/2^(kk)/sin(v/2))^(2*r),[-pi pi])
  
  hold on
end

hold off
title(['\fontsize{20}Spline order ' int2str(2*r)])
          set(gca,'XTick',-pi:0:pi)
  set(gca,'XTickLabel',['-\pi', '0','\pi'])     
  subplot(1,2,2)
for kk=1:3
  W=1;
  r=5;
  fplot(@(v)(sin(v*2^(kk-1))/2^(kk)/sin(v/2))^(2*r),[-pi pi])
  
  hold on
end

hold off
title(['\fontsize{20}Spline order ' int2str(2*r)])
          set(gca,'XTick',-pi:0:pi)
  set(gca,'XTickLabel',['-\pi', '0','\pi'])
 %%%%%%%%%%%%%%%%% Fundamental generators
figure;
subplot(1,2,1)
for kk=1:3
  W=U{kk+1};
  r=2;
  fplot(@(v)(W(v*2^(kk),r))^(-1)*(sin(v*2^(kk-1))/2^(kk)/sin(v/2))^(2*r),[-pi pi])
  
  hold on
end

hold off
title(['\fontsize{20}Spline order ' int2str(2*r)])
          set(gca,'XTick',-pi:0:pi)
  set(gca,'XTickLabel',['-\pi', '0','\pi'])     
  subplot(1,2,2)
for kk=1:3
  W=U{kk+1};
  r=5;
  fplot(@(v)(W(v*2^(kk),r))^(-1)*(sin(v*2^(kk-1))/2^(kk)/sin(v/2))^(2*r),[-pi pi])
  
  hold on
end

hold off
title(['\fontsize{20}Spline order ' int2str(2*r)])
          set(gca,'XTick',-pi:0:pi)
  set(gca,'XTickLabel',['-\pi', '0','\pi'])
  
  %%%%%%%%%%%%%%%%% Selfdual generators
figure;
subplot(1,2,1)
for kk=1:3
  W=U{kk+1};
  r=2;
  fplot(@(v)(W(v*2^(kk),2*r))^(-1/2)*(sin(v*2^(kk-1))/2^(kk)/sin(v/2))^(2*r),[-pi pi])
  
  hold on
end

hold off
title(['\fontsize{20}Spline order ' int2str(2*r)])
          set(gca,'XTick',-pi:0:pi)
  set(gca,'XTickLabel',['-\pi', '0','\pi'])     
  subplot(1,2,2)
for kk=1:3
  W=U{kk+1};
  r=5;
  fplot(@(v)(W(v*2^(kk),2*r))^(-1/2)*(sin(v*2^(kk-1))/2^(kk)/sin(v/2))^(2*r),[-pi pi])
  
  hold on
end

hold off
title(['\fontsize{20}Spline order ' int2str(2*r)])
          set(gca,'XTick',-pi:0:pi)
  set(gca,'XTickLabel',['-\pi', '0','\pi'])     