function out = sinc2(t,tau) % This function is the squared sinc window % with main lobe width 2*TAU: % % sig = sinc2(t,tau), where SIG and T are vectors of the same dimension. % % elements of SIG are (abs(sin(pi*T/TAU)./ (pi*T/TAU)).^2. % % % written by Kevin D. Donohue 2/93 % % out = zeros(size(t)); % set up output array if min(abs(t)) == 0, % if t-axis includes a 0, take limit elm_1 = find(t == 0); % find place where t-axis is zero out(elm_1) = 1; % Special case for t=0 end elm_1 = find(t ~= 0); % find all the other points out(elm_1) = abs(sin(pi*t(elm_1)/tau)./(pi*t(elm_1)/tau)).^2; % plug into sinc