% Compute and plot the Alias-Free Generalized 
% Discrete Time-Frequency Distribution of two arbitrary Gabor atoms.

clear all;
t=-10:0.05:12;
ta=-10:0.05:10;
b1=0;a1=1.5;
b3=-5;
b2=6;
oo=3.5;

gt3=(exp((-((ta-b3)).^2)).*(exp(i.*((oo).*pi).*((ta-b3)))));
g2=(exp((-((t-b2)).^2)).*(exp(i.*((5.5).*pi).*((t-b2)))));

s=gt3(20:170);
s1=g2(80:440);
J=[s s1];
po=real(J);

fg=figure;
r1=subplot(211);
l1=plot(po,'b','markersize',5);
axis([1 length(J) min(po) max(po)]);
ylabel('2 Atoms'); 

r2=subplot(212);
tfdist(po);
axis([0 1 0 0.4]);

set(r1,'position',[0.1 0.77 0.85 0.2]);
set(r2,'position',[0.1 0.1 0.85 0.66]);


% "Complex and Chaotic Nonlinear Dynamics. 
% Advances in Economics and Finance, 
% Mathematics and Statistics" 
% T.Vialar, Springer 2009.
% Copyright(c).