function y=Gabor51(x,tau,t,f,sgm)     % using f and the standard definition  % for large size data
% output t-axis is adjusted
dtau=tau(2)-tau(1);   
df=f(2)-f(1);
% 1/delta_f > 1.9143*2/sgm^.5
N=round(1/dtau/df);
B=1.9143/sgm^.5;
Q=floor(B/dtau);
n=round(tau/dtau);          % t -> n
n1=round(t/dtau);
m=round(f/df)';             % f -> m
m0=mod(m,N)+1;
n31=min(min(n),min(n1)-Q);   % minimal index n
n32=max(max(n),max(n1)+Q);   % maximal index n
x1=[zeros(min(n)-n31,1);x.'*dtau;zeros(n32-max(n),1)];
ln=length(t);
gs=exp(-pi*dtau^2*[-Q:Q]'.^2*sgm)*sgm^0.25;
y=zeros(length(m),ln);
pha=j*2*pi/N*m;
a2=n1-n31+1;
for a=1:ln
    x1a=fft(x1(a2(a)-Q:a2(a)+Q).*gs,N);
    y(:,a)=x1a(m0).*exp(pha*(Q-n1(a)));
end





