dawn@0: function plotAudioFrameByType( x, noOfValidFrames, vuv, frameLength ); dawn@0: Dawn@4: values = unique( vuv ); dawn@0: Dawn@4: Dawn@4: figure(1); hold off; Dawn@4: dawn@0: dawn@0: for frameIdx = 1:noOfValidFrames dawn@0: startPoint = ((frameIdx-1) * frameLength)+1; dawn@0: endPoint = frameIdx * frameLength; Dawn@4: xTicks = frameIdx : 1/frameLength : (frameIdx+1)-(1/frameLength); Dawn@4: Dawn@4: if( length( values) == 2 ) Dawn@4: type1 = values(1); Dawn@4: type2 = values(2); Dawn@4: if( vuv( frameIdx ) == type1 ) % voiced Dawn@4: % plot( startPoint : endPoint , x( startPoint : endPoint ), 'y' ); Dawn@4: plot( xTicks , x( startPoint : endPoint ), 'y' );hold on Dawn@4: elseif( vuv( frameIdx ) == type2 ) %unvoiced Dawn@4: % plot( startPoint : endPoint , x( startPoint : endPoint ) , 'r' ); Dawn@4: plot( xTicks , x( startPoint : endPoint ) , 'r' );hold on Dawn@4: end Dawn@4: elseif( length( values) == 3 ) Dawn@4: type1 = values(1); Dawn@4: type2 = values(2); Dawn@4: type3 = values(3); Dawn@4: if( vuv( frameIdx ) == type1 ) % voiced Dawn@4: % plot( startPoint : endPoint , x( startPoint : endPoint ), 'y' ); Dawn@4: plot( xTicks , x( startPoint : endPoint ), 'y' );hold on Dawn@4: elseif( vuv( frameIdx ) == type2 ) %unvoiced Dawn@4: % plot( startPoint : endPoint , x( startPoint : endPoint ) , 'r' ); Dawn@4: plot( xTicks , x( startPoint : endPoint ) , 'g' );hold on Dawn@4: elseif( vuv( frameIdx ) == type3 ) %unvoiced Dawn@4: % plot( startPoint : endPoint , x( startPoint : endPoint ) , 'r' ); Dawn@4: plot( xTicks , x( startPoint : endPoint ) , 'r' );hold on Dawn@4: end dawn@0: end dawn@0: end dawn@0: hold off