
function y = win(t,t1,d1,t2,d2);

n=log(d2/d1)/log(t2/t1);
%n=2*round(n/2);
alpha=log(10)*(t1^(-n))*(d1/20);
y=zeros(size(t));
I=find(abs(t) < (-log(1e-6)/alpha)^(1/n)); % cut at -120 dB
y(I)=exp(-alpha*(abs(t(I)).^n));
