Mercurial > hg > emotion-detection-top-level
view Code/Descriptors/Matlab/Common/detect_VoicedUnvoiced.m @ 0:ea0c737c6323
first commit
author | Dawn Black <dawn.black@eecs.qmul.ac.uk> |
---|---|
date | Thu, 26 Jul 2012 14:46:25 +0100 |
parents | |
children | a3d62264030c |
line wrap: on
line source
function [vuv] = Detect_VoicedUnvoiced( sampleWavFileName, x, fs, frameLength, noOfFrames ) sampleFileName = sampleWavFileName( 1 : length( sampleWavFileName ) - 4 ); fileName = [ sampleFileName '_VUV.txt']; fileID = fopen( fileName ); % if( fileID < 0 ) %---------------- GET THE SILENT FRAME VALUES ------------------- % only wish to consider pitch values from voiced frames. % silent and unvoiced frames will produce pitch values that % are random and therefore will bias our results segmentFrames = detect_Silence( sampleFileName, 0 ); % remove the silent frames [ silentFrames ] = removeSilentData( segmentFrames, noOfFrames ); % [vuv] = voicingByClustering( nonSilentAudio, fs, noOfFrames, frameLength ); [vuv] = calculate_VoicedUnvoicedDecision( sampleFileName, x, fs, frameLength, noOfFrames, silentFrames ); noOfValidFrames = length(vuv); % plotAudioFrameByType( nonSilentAudio, noOfValidFrames, vuv, frameLength ); % fclose( fileID ); fileID = fopen( fileName, 'w'); for i = 1 : length(vuv) fprintf(fileID,'%d %d \n', i, vuv(i)); end fclose( fileID ); fileID = fopen( fileName ); end vuv = fscanf( fileID, '%d', inf ); vuv = vuv( 2:2:end ); fclose( fileID );