


CUTZERO Cut leading/trailing zeros of a pitch vector


0001 function [newPitch, cutIndex] = cutLTzero(pitch); 0002 %CUTZERO Cut leading/trailing zeros of a pitch vector 0003 0004 newPitch = pitch; 0005 idx = find(pitch~=0); 0006 cutIndex = []; 0007 if ~isempty(idx), 0008 index1 = 1:idx(1)-1; 0009 index2 = idx(end)+1:length(pitch); 0010 cutIndex = [index1, index2]; 0011 newPitch(cutIndex)=[]; 0012 end