www.pudn.com > audioProcessingtoolbox.rar > amdfPlot.m


function amdfPlot(amdfMat, frameTime, A) 
% amdfPlot: AMDF plot, with DP optional path 
%	Usage1: amdfPlot(amdfMat, frameTime, A) 
%		where A is obtained from wave2pitchByDp.m 
%	Usage2: amdfPlot(amdfMat, frameTime, pp) 
%		where pp is the pitch point obtained obtained from external programs. 
 
%	Roger Jang, 20050113 
 
if nargin<2, frameTime=1:size(amdfMat,2); end 
if nargin<3, A=[]; end 
 
pcolor(frameTime, 1:size(amdfMat,1), amdfMat); shading flat; axis xy 
title('AMDF matrix'); 
if isstruct(A) 
	for i=1:length(A) 
		for j=1:length(A(i).ppc) 
			if A(i).ppc(j).index>0 
				line(frameTime(i), A(i).ppc(j).index, 'marker', '.', 'color', 'w'); 
			end 
		end 
		if isfield(A, 'pp') 
			if A(i).pp>0 
				line(frameTime(i), A(i).pp, 'marker', 'o', 'color', 'r'); 
			end 
		end 
	end 
end 
 
if isnumeric(A)		% A is actually pp 
	for i=1:length(A) 
		line(frameTime(i), A(i), 'marker', '.', 'color', 'w'); 
	end 
end