Home > utility > cutLTzero.m

cutLTzero

PURPOSE ^

CUTZERO Cut leading/trailing zeros of a pitch vector

SYNOPSIS ^

function [newPitch, cutIndex] = cutLTzero(pitch);

DESCRIPTION ^

CUTZERO Cut leading/trailing zeros of a pitch vector

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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

Generated on Tue 01-Jun-2010 09:50:34 by m2html © 2003