view Code/Test/plotAudioFrameByType.m @ 1:a3d62264030c

tested and working
author Dawn Black <dawn.black@eecs.qmul.ac.uk>
date Mon, 10 Sep 2012 09:13:53 +0100
parents ea0c737c6323
children 92ca03a8fa99
line wrap: on
line source
function plotAudioFrameByType( x, noOfValidFrames, vuv, frameLength );


hold on

for frameIdx = 1:noOfValidFrames
    startPoint = ((frameIdx-1) * frameLength)+1;
    endPoint = frameIdx * frameLength;
%     if( vuv( frameIdx ) == 0 ) %silent
%         plot( startPoint : endPoint  , x( startPoint : endPoint ), 'w' );
    if( vuv( frameIdx ) == 1 ) % voiced
        plot( startPoint : endPoint , x( startPoint : endPoint ), 'y' );
    elseif( vuv( frameIdx ) == 2 ) %unvoiced
        plot( startPoint : endPoint , x( startPoint : endPoint ) , 'r' );
    end
end
hold off