comparison Code/Test/plotAudioFrameByType.m @ 4:92ca03a8fa99 tip

Update to ICASSP 2013 benchmark
author Dawn Black
date Wed, 13 Feb 2013 11:02:39 +0000
parents ea0c737c6323
children
comparison
equal deleted inserted replaced
3:e1cfa7765647 4:92ca03a8fa99
1 function plotAudioFrameByType( x, noOfValidFrames, vuv, frameLength ); 1 function plotAudioFrameByType( x, noOfValidFrames, vuv, frameLength );
2 2
3 values = unique( vuv );
3 4
4 hold on 5
6 figure(1); hold off;
7
5 8
6 for frameIdx = 1:noOfValidFrames 9 for frameIdx = 1:noOfValidFrames
7 startPoint = ((frameIdx-1) * frameLength)+1; 10 startPoint = ((frameIdx-1) * frameLength)+1;
8 endPoint = frameIdx * frameLength; 11 endPoint = frameIdx * frameLength;
9 % if( vuv( frameIdx ) == 0 ) %silent 12 xTicks = frameIdx : 1/frameLength : (frameIdx+1)-(1/frameLength);
10 % plot( startPoint : endPoint , x( startPoint : endPoint ), 'w' ); 13
11 if( vuv( frameIdx ) == 1 ) % voiced 14 if( length( values) == 2 )
12 plot( startPoint : endPoint , x( startPoint : endPoint ), 'y' ); 15 type1 = values(1);
13 elseif( vuv( frameIdx ) == 2 ) %unvoiced 16 type2 = values(2);
14 plot( startPoint : endPoint , x( startPoint : endPoint ) , 'r' ); 17 if( vuv( frameIdx ) == type1 ) % voiced
18 % plot( startPoint : endPoint , x( startPoint : endPoint ), 'y' );
19 plot( xTicks , x( startPoint : endPoint ), 'y' );hold on
20 elseif( vuv( frameIdx ) == type2 ) %unvoiced
21 % plot( startPoint : endPoint , x( startPoint : endPoint ) , 'r' );
22 plot( xTicks , x( startPoint : endPoint ) , 'r' );hold on
23 end
24 elseif( length( values) == 3 )
25 type1 = values(1);
26 type2 = values(2);
27 type3 = values(3);
28 if( vuv( frameIdx ) == type1 ) % voiced
29 % plot( startPoint : endPoint , x( startPoint : endPoint ), 'y' );
30 plot( xTicks , x( startPoint : endPoint ), 'y' );hold on
31 elseif( vuv( frameIdx ) == type2 ) %unvoiced
32 % plot( startPoint : endPoint , x( startPoint : endPoint ) , 'r' );
33 plot( xTicks , x( startPoint : endPoint ) , 'g' );hold on
34 elseif( vuv( frameIdx ) == type3 ) %unvoiced
35 % plot( startPoint : endPoint , x( startPoint : endPoint ) , 'r' );
36 plot( xTicks , x( startPoint : endPoint ) , 'r' );hold on
37 end
15 end 38 end
16 end 39 end
17 hold off 40 hold off