function E=ps12_6242_2004(N) % function E=ps12_6242_2004(N) % % estimates H-Infinity norm of (1-exp(-s))/s-1/(1+0.5s) % larger N means better quality of estimation if nargin<1, N=10000; end % default number of samples W=4*sqrt(N/3); % optimal W e=8/W; % error bound w=(1:N)*W/N; % w-samples s=j*w; % s-samples G=(1-exp(-s))./s; % G-hamples Ghat=1./(1+0.5*s); % Ghat-samples E=max(abs(G-Ghat)); % calculated H-Infinity norm fprintf('\nThe norm is between %f and %f\n',E-e,E+e); close(gcf) subplot(2,1,1); plot(w,real(G),w,real(Ghat)); grid subplot(2,1,2); plot(w,imag(G),w,imag(Ghat)); grid