function PlotTracking(SineFreq, pitch)
%function PlotTracking(SineFreq, pitch)
%
%==> plot the partial tracking
% data:
% SineFreq: frequencies of the tracks
% pitch: frequency of the pitch
[nSines, nFrames] = size(SineFreq);
for n=1:nSines
f=1;
while (f<=nFrames)
while (f<=nFrames && SineFreq(n,f)==0)
f = f+1;
end
iStart = min(f,nFrames);
while (f<=nFrames && SineFreq(n,f)>0)
f = f+1;
end
iEnd = min(max(1,f-1),nFrames);
if (iEnd > iStart)
% line((iStart:iEnd), SineFreq(n,iStart:iEnd));
plot((iStart:iEnd), SineFreq(n,iStart:iEnd),'k'); hold on;
end
end
end
% h = line((1:nFrames),pitch(1:nFrames));%octave/matlab compat prob
plot((1:nFrames),pitch(1:nFrames),'r');
hold off;
% set(h,'linewidth', 2,'Color','black'); %octave/matlab compat prob 
%gset title "Partials"
%gset xlabel "Frame number"  
%gset ylabel "Frequency (Hz)"
title('Partials')
xlabel('Frame number')
ylabel('Frequency (Hz)')
