%This script will use the filter defined in transferfcn.m (the transfer
%function rather).  It does this by calling identme.m with an input of a
%cosine and the resolution of the grid

resolution=0.001;
t=0:resolution:10;
nu=0;
input=cos(2*pi*nu*t);
output=identme(input,resolution);
H=max(output)
nuarray=0;

for nu=0:40 
input=cos(2*pi*nu*t);
output=identme(input,resolution);
H=[H,max(output)];
nuarray=[nuarray,nu];
end

N = length(input);
s = (-floor(N/2):floor((N-1)/2))/resolution/N;
sl = 3; sh = 12; N = 10;  
RealH = (s/sl).^(2*N)./(1+(s/sl).^(2*N))./(1+(s/sh).^(2*N));

plot(nuarray,H,s,RealH);
xlabel('s');ylabel('H(s)');
axis([0,20,0,2]);
legend('Approximated Filter','Filter from transfercn.m');
