function LGnull=fft_null_track(fft_root,f_cent,f_del,Tlims,jrec,iifig);
%
% Call LGnull=fft_null_track(fft_root,f_cent,f_del,Tlims,jrec,iifig);
%
% Tracks nulls between peak frequencies near f_cent (+- f_del) and outputs
% frequency and amplitude (in dB) versus time in tfa_track;
% tfa_track is ntime by nf_cent by nrec;
%
% fft_root		= root of FFT file or LGRAM structure (result of lgram_3d)
%
if nargin<4, Tlims=[]; end
if nargin<5, jrec=[]; end
if nargin<6, iifig=1; end
%
%
f_cent=f_cent(:);
nf_cent=length(f_cent);
if isempty(f_del),
	df_c=diff(f_cent);
	f_del=[df_c(1);.5*(df_c(1:nf_cent-2)+df_c(2:nf_cent-1)); df_c(nf_cent-1)],
elseif length(f_del)==1,
	f_del=repmat(f_del,size(f_cent));
end
%
if ischar(fft_root),
	jfreq=[min(f_cent-f_del), max(f_cent+f_del)];
	dfnorm=1; iihr=1; iinorm=0;
	parms=[dfnorm,iihr,iinorm];	iifig=0; clim=[];	% lgram_3d parms;
	if isempty(jrec), jrec=[1:length(LG.x)]; end
	[LG,FFT]=lgram_3d(fft_root,Tlims,jrec,jfreq,parms,iifig,clim);
else
	LG=fft_root;
	jrec=[1:length(LG.x)];
end
ndf=size(LG.data,1);
jf_take=find(f_cent-f_del>=LG.y(1) & f_cent+f_del<=LG.y(ndf))
if length(jf_take)<nf_cent,
	f_cent=f_cent(jf_take);
	f_del=f_del(jf_take);
	nf_cent=length(f_cent);
end
%
[ndf,nrec,nseq]=size(LG.data);
%
fd2=f_del/2;
LGnull.fft_root=LG.fft_root;
LGnull.title=LG.fft_root;
LGnull.x=jrec;
LGnull.y=f_cent;
LGnull.z=LG.z
LGnull.data=zeros(nf_cent,nrec,nseq);
LGnull.data2=zeros(nf_cent,nrec,nseq);
LGnull.xlab='Receiver Number';
LGnull.ylab='Center Frequency - Hz';
LGnull.zlab=LG.zlab;
LGnull.z2=1; LGnull.z3=1; LGnull.z2lab=' '; LGnull.z3lab=' ';

for jcent=1:nf_cent,
	fc=f_cent(jcent); fd=fd2(jcent);
	iif=find(LG.y>=fc-fd & LG.y<=fc+fd); niif=length(iif);
	ndfh=floor(length(iif)/2); iifx=zeros(nseq,1);
	for jrec=1:nrec,
		lgram=squeeze(LG.data(iif,jrec,:));	% niif by nseq
		[lg_max,ii_max]=max(lgram,[],1);	% 1 by nseq;
		iilo=find(ii_max<=ndfh); iihi=find(ii_max>ndfh);
		iifx(iilo)=ii_max(iilo)+ndfh;
		iifx(iihi)=ii_max(iihi)-ndfh;
		idx=[0:nseq-1]'*niif + iifx;
		LGnull.data(jcent,jrec,:)=lgram(idx);
		LGnull.data2(jcent,jrec,:)=iifx;
	end
end
%
cmax=ceil(max(LGnull.data(:))/5)*5;
cmin=max(floor(min(LGnull.data(:))/5)*5,cmax-60);
LGnull.clim=[cmin,cmax];

if iifig, view5(LGnull); end
%
% COPYRIGHT (c) 2008
% 
% Applied Research Laboratories, The University of Texas at Austin
% (ARL:UT)
% All rights reserved.
% 
% This material may be reproduced by or for the U.S. Government
% only. This notice must appear in all copies of this file and its
% derivatives. Further distribution outside the U.S. Government is
% prohibited without the explicit written authorization from the
% Director of the Environmental Sciences Laboratory, ARL:UT.
% 
% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
% EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE
% IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
% PURPOSE, OR NONINFRINGEMENT.
% 
% IN NO EVENT WILL ARL:UT BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING
% OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN IF ARL:UT HAS
% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
