% imageTF.m
%
% P. Flandrin, 2005
%
% displays an ambiguity function
%
% input - M : Ambiguity function matrix
%       - dyn : dynamic range (in dB)
%       - c : choice of colormap, 1 = jet (default), else = b&w
%       - b : colorbar, 1 = yes (default), else = no

function imageAF(M,dyn,c,b) ;

if (nargin == 2)
    
    c = 1 ;
    b = 1 ;
    
end

if (nargin == 3)
    
    b = 1 ;
    
end

M = M/max(max(M)) ;
M = max(M,10^(-dyn/10)) ;
imagesc(flipud(10*log10(M)),[-dyn 0])
set(gca,'YTick',[]);set(gca,'XTick',[])
xlabel('delay')
ylabel('Doppler')

if c == 1
    
    colormap(jet)
    
else
    
    colormap(flipud(gray))
    
end

if b == 1
    
    colorbar
    
end

