function [t,z] = ytimet(v)
%Antaa konvoluutioytimen valinnalla
%1=gauss
%2=dirichlet
%3=fejer
%
%[t,z] = ytimet(1)
if v==1,
prompt='Anna parametri väliltä (0,1):';
r=input(prompt);
t=linspace(-r,r,1000);
z=exp(-1./(r^2-t.^2));
A=mean(z)*2*r;
z=z/A;
plot(t,z)
legend('gauss')
elseif v==2,
prompt='Anna parametri 1,2,...:';
r=input(prompt);
t=linspace(-2,2,1000);
z=0*t;
for k=0:r
z(k+2,:)=z(k+1,:)+cos(k*t);
end
z=z(end,:);
A=mean(z)*2*r;
z=z/A;
plot(t,z)
legend('dirichlet')
elseif v==3,
prompt='Anna parametri 1,2,...:';
r=input(prompt);
t=linspace(-2,2,1000);
z=0*t;
for k=0:r
z(k+2,:)=z(k+1,:)+cos(k*t);
end
z=mean(z);
A=mean(z)*2*r;
z=z/A;
plot(t,z)
legend('fejer')
end
end

