function plotAudioFrameByType( x, noOfValidFrames, vuv, frameLength );

values = unique( vuv );


figure(1); hold off;


for frameIdx = 1:noOfValidFrames
    startPoint = ((frameIdx-1) * frameLength)+1;
    endPoint = frameIdx * frameLength;
    xTicks = frameIdx : 1/frameLength : (frameIdx+1)-(1/frameLength);

    if( length( values) == 2 )
        type1 = values(1);
        type2 = values(2);
        if( vuv( frameIdx ) == type1 ) % voiced
    %         plot( startPoint : endPoint , x( startPoint : endPoint ), 'y' );
            plot( xTicks , x( startPoint : endPoint ), 'y' );hold on
        elseif( vuv( frameIdx ) == type2 ) %unvoiced
    %         plot( startPoint : endPoint , x( startPoint : endPoint ) , 'r' );
            plot( xTicks , x( startPoint : endPoint ) , 'r' );hold on
        end
    elseif( length( values) == 3 )
        type1 = values(1);
        type2 = values(2);
        type3 = values(3);
        if( vuv( frameIdx ) == type1 ) % voiced
    %         plot( startPoint : endPoint , x( startPoint : endPoint ), 'y' );
            plot( xTicks , x( startPoint : endPoint ), 'y' );hold on
        elseif( vuv( frameIdx ) == type2 ) %unvoiced
    %         plot( startPoint : endPoint , x( startPoint : endPoint ) , 'r' );
            plot( xTicks , x( startPoint : endPoint ) , 'g' );hold on
        elseif( vuv( frameIdx ) == type3 ) %unvoiced
    %         plot( startPoint : endPoint , x( startPoint : endPoint ) , 'r' );
            plot( xTicks , x( startPoint : endPoint ) , 'r' );hold on
        end
    end
end
hold off