Mercurial > hg > emotion-detection-top-level
view Code/ProcessDatabase.m @ 4:92ca03a8fa99 tip
Update to ICASSP 2013 benchmark
author | Dawn Black |
---|---|
date | Wed, 13 Feb 2013 11:02:39 +0000 |
parents | a3d62264030c |
children |
line wrap: on
line source
function [] = ProcessDatabase( databaseName, functionName, sampleStartNum, OVERWRITE ) % run from D:\Dropbox\BUPTResearch2011\EmotionDetectionCode\Code machineName = getenv('COMPUTERNAME'); fclose('all'); switch machineName case 'LAPTOP' % for Dawn's laptop root = 'D:\Dropbox\' case 'SLATE1' % for Dawn's Slate root = 'E:\Dropbox\' case 'DAWNBLACK-PC' % for Dawn's work PC root = 'C:\Users\dawn\Dropbox\' end addpath ([root 'BUPTResearch2011\emotionDetectionCode\Code']) addpath ([root 'BUPTResearch2011\emotionDetectionCode\Code\Descriptors\Matlab\MPEG7']) addpath ([root 'BUPTResearch2011\emotionDetectionCode\Code\Descriptors\Matlab\Common']) addpath ([root 'BUPTResearch2011\emotionDetectionCode\Code\Descriptors\Matlab\MPEG7\FromWeb']) addpath ([root 'BUPTResearch2011\emotionDetectionCode\Code\Descriptors\PRAAT']) addpath ([root 'BUPTResearch2011\emotionDetectionCode\Code\Descriptors\Matlab\Speech']) addpath ([root 'BUPTResearch2011\emotionDetectionCode\Code\Descriptors\yin\']) addpath ([root 'BUPTResearch2011\emotionDetectionCode\Code\Collation']) addpath ([root 'BUPTResearch2011\emotionDetectionCode\Code\General']) switch databaseName case 'ChineseOperaTest' cd([root 'BUPTResearch2011/Data/Opera/TestDatabase']) startEmotion = 4; case 'ChineseOperaFull' cd([root 'BUPTResearch2011/Data/Opera/FullDatabase']) startEmotion = 3; case 'ChineseOperaPaper' cd([root 'BUPTResearch2011/Data/Opera/PaperDatabase']) startEmotion = 3; case 'MandarinSpeech' cd([root 'BUPTResearch2011/Data/Database/EditedRecording']) startEmotion = 3; case 'SpeechTestFiles' cd([root 'BUPTResearch2011\Data\SpeechTestFiles\MyAnnotatedFiles']) startEmotion = 3; end fileStructure = dir; % how many samples do we have? noOfSamples = size( fileStructure ); firstfileOpen = 1; if( sampleStartNum < 3 ) sampleStartNum = 3; end for sampleNum = sampleStartNum : noOfSamples(1) sampleDirName = fileStructure(sampleNum).name if( fileStructure(sampleNum).isdir == 1 ) % only directories cd( sampleDirName ); % how many emotions for that sample? validEmotionList = dir; noOfEmotions = size( validEmotionList ); % figure; for emotionNum = startEmotion : noOfEmotions(1) emotionName = validEmotionList(emotionNum).name; cd( emotionName ); % how many samples for that emotion? sampleNames = dir; noOfSamples = size( sampleNames ); for sampleNumber = 3 : noOfSamples(1) if( sampleNames(sampleNumber).isdir == 0 ) % skip directories currentSampleName = sampleNames(sampleNumber).name % get the file type extName = currentSampleName(length( currentSampleName ) - 3: end); % is it a .wav file? if strcmp( extName, '.wav' ) newDirName = currentSampleName( 1 : length( currentSampleName ) - 4 ); % if none exists, make a new directory for all the results of % our calculations. mkdir( [ newDirName '_metrics'] ); cd ( [ newDirName '_metrics'] ); % call your function here switch functionName % functions that start with 'get' simply read % from existing text files % functions that start with 'detect' check if % the results file already exists, if they do % not (or the OVERWRITE flag is true) then the % results are calculated afresh. % case 'getsampleDependantThresholds' % statsFileName = '../../../../FeatureSets/singingsampleDependantThresholds.txt'; % statsFileID = fopen( statsFileName, 'a' ); % % is this the first sample in this emotion for % % this sample? % if( sampleNumber == 3 ) % if ( firstfileOpen == 0 ) % if(strfind( oldDirName , 'fem') > 0 ) % sampleName = oldDirName( 6 : end ); % meanET = mean( energyThreshold ); % meanSCT = mean( spectralCentroidThreshold ); % fprintf( statsFileID, '%s \t %f \t %f \n', sampleName, meanET, meanSCT ); % elseif(strfind( oldDirName , 'male') > 0 ) % sampleName = oldDirName( 6 : end ); % meanET = mean( energyThreshold ); % meanSCT = mean( spectralCentroidThreshold ); % fprintf( statsFileID, '%s \t %f \t %f \n', sampleName, meanET, meanSCT ); % end % end % % spectralCentroidThreshold = []; % energyThreshold = []; % firstfileOpen = 0; % end % % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % [st , et] = getsampleDependantThresholds( newDirName, x, fs, statsFileID, frameLength, noOfFrames ); % spectralCentroidThreshold = [spectralCentroidThreshold st]; % energyThreshold = [energyThreshold et]; % oldDirName = newDirName; % % fclose( statsFileID ); case 'getPitchStatistics' switch databaseName case 'ChineseOperaTest' statsFileName = '../../../../../../../TestResults/test_singingPitchStats_Voiced.txt'; case 'ChineseOperaFull' statsFileName = '../../../../../../../TestResults/full_singingPitchStats.txt'; case 'ChineseOperaPaper' statsFileName = '../../../../../../../TestResults/paper_singingPitchStats_Voiced.txt'; case 'MandarinSpeech' statsFileName = '../../../../../../../TestResults/mandarinPitchStats.txt'; case 'SpeechTestFiles' statsFileName = '../../../../../../../TestResults/speechPitchStats.txt'; end statsFileID = fopen( statsFileName, 'a' ); get_Pitch( newDirName, statsFileID ); fclose( statsFileID ); case 'getHNRStatistics' switch databaseName case 'ChineseOperaTest' statsFileName = '../../../../../../../TestResults/test_singingHNRStats.txt'; case 'ChineseOperaPaper' statsFileName = '../../../../../../../TestResults/paper_singingHNRStats.txt'; case 'ChineseOperaFull' statsFileName = '../../../../../../../TestResults/full_singingHNRStats.txt' case 'MandarinSpeech' statsFileName = '../../../../../../../TestResults/mandarinHNRStats.txt'; case 'SpeechTestFiles' statsFileName = '../../../../../../../TestResults/speechHNRStats.txt'; end statsFileID = fopen( statsFileName, 'a' ); get_HNR( newDirName, statsFileID ); fclose( statsFileID ); case 'getEnergyStatistics' switch databaseName case 'ChineseOperaTest' statsFileName = '../../../../../../../TestResults/test_singingEnergyStats.txt'; case 'ChineseOperaPaper' statsFileName = '../../../../../../../TestResults/paper_singingEnergyStats.txt'; case 'ChineseOperaFull' statsFileName = '../../../../../../../TestResults/full_singingEnergyStats.txt' case 'MandarinSpeech' statsFileName = '../../../../../../../TestResults/mandarinEnergyStats.txt'; case 'SpeechTestFiles' statsFileName = '../../../../../../../TestResults/speechEnergyStats.txt'; end statsFileID = fopen( statsFileName, 'a' ); if( firstfileOpen == 1 ) fprintf( statsFileID, 'name \t mean energy \t energy variance \t min \t max \t mean voiced energy \t mean unvoiced energy \n'); firstfileOpen = 0; end get_AudioPower( newDirName, statsFileID ); fclose( statsFileID ); % % case 'getEnergyStatistics' % statsFileName = '../../../../FeatureSets/singingEnergyStats.txt'; % statsFileID = fopen( statsFileName, 'a' ); % if( firstfileOpen == 1 ) % fprintf( statsFileID, 'name \t mean energy \t mean voiced energy \t mean unvoiced energy \n'); % firstfileOpen = 0; % end % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % getEnergyStatistics( newDirName, x, fs, statsFileID, frameLength, noOfFrames ); % fclose( statsFileID ); % % % % %%%%% for energy-related features %%%%% % % case 'getOtherEnergyStatistics' % % statsFileName = '../../../../FeatureSets/singingOtherEnergyStats.txt'; % % statsFileID = fopen( statsFileName, 'a' ); % % if( firstfileOpen == 1 ) % % fprintf( statsFileID, 'name \t derivation of non silent energy \t derivation of voiced energy \t derivation of unvoiced energy \n'); % % firstfileOpen = 0; % % end % % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % % getOtherEnergyStatistics( newDirName, x, fs, statsFileID, frameLength, noOfFrames ); % % fclose( statsFileID ); % % % % case 'getBasicDescriptors' % % includes audio waveform and audio power % statsFileName = '../../../../FeatureSets/singingbasicDescriptors.txt'; % statsFileID = fopen( statsFileName, 'a' ); % if( firstfileOpen == 1 ) % fprintf( statsFileID, 'name \t meanAWF \t STDAWF \t minAWF \t maxAWF \t rangeAWF \t meanAP \t STDAP \t minAP \t maxAP \t rangeAP \t meanHR \t STDHR \t minHR \t maxHR \t rangeHR \n'); % firstfileOpen = 0; % end % % getBasicDescriptors( newDirName, statsFileID ); % fclose( statsFileID ); % case 'getBasicSpectralDescriptors' % % includes audio spectrum envelope, audio spectrum % % centroid, audio spectrum spread, audio spectrum flatness % statsFileName = '../../../../FeatureSets/singingbasicSpectralDescriptors.txt'; % statsFileID = fopen( statsFileName, 'a' ); % % Add a header column % if( firstfileOpen == 1 ) % fprintf( statsFileID, ' name \t meanASE \t STDASE \t minASE \t maxASE \t rangeASE \t meanASC \t STDASC \t minASC \t maxASC \t rangeASC \t meanASS \t STDASS \t minASS \t maxASS \t rangeASS \t meanASF \t STDASF \t minASF \t maxASF \t rangeASF \n'); % % fprintf( statsFileID, ' name \t meanAWE \t STDAWE \t minAWE \t maxAWE \t rangeAWE \t meanAP \t STDAP \t minAP \t maxAP \t rangeAP \n'); % firstfileOpen = 0; % end % % getBasicSpectralDescriptors1( newDirName, statsFileID ); % fclose( statsFileID ); % disp('NOT FINISHED'); % case 'getTemporalTimbralDescriptors' % % % includes log attack time and temporal % % centroid % statsFileName = '../../../../FeatureSets/singingtemporalTimbralDescriptors.txt'; % statsFileID = fopen( statsFileName, 'a' ); % % Add a header column % if( firstfileOpen == 1) % fprintf( statsFileID, ' name \t temporal centriod \t log attack time \n'); % firstfileOpen = 0; % end % % getTemporalTimbralDescriptors( newDirName, statsFileID ); % fclose( statsFileID ); % case 'getSpectralTimbralDescriptors' % % collate the Harmonic Spectral Centroid, % % Harmonmic Spectral Deviation, Harmonic % % Spectral Spread, Harmonic Spectral Variation % % and Spectral Centroid % % statsFileName = '../../../../FeatureSets/singingspectralTimbralDescriptors.txt'; % statsFileID = fopen( statsFileName, 'a' ); % % Add a header column % if( firstfileOpen == 1) % fprintf( statsFileID, ' name \t HSC \t HSD \t HSS \t HSV \t SC \n'); % firstfileOpen = 0; % end % % getSpectralTimbralDescriptors( newDirName, statsFileID ); % fclose( statsFileID ); case 'getMFCCs' switch databaseName case 'ChineseOperaTest' statsFileName = '../../../../../../../TestResults/test_singingMFCCStats_VoicedAndUnvoiced_Unsmoothed.txt'; case 'ChineseOperaFull' statsFileName = '../../../../../../../TestResults/full_singingMFCCStats_VoicedAndUnvoiced_Unsmoothed.txt'; case 'ChineseOperaPaper' statsFileName = '../../../../../../../TestResults/paper_singingMFCCStats.txt'; case 'MandarinSpeech' statsFileName = '../../../../../../../TestResults/mandarinMFCCStats.txt'; case 'SpeechTestFiles' statsFileName = '../../../../../../../TestResults/speechMFCCStats.txt'; end if( firstfileOpen == 1 ) statsFileID = fopen( statsFileName, 'w' ); firstfileOpen = 0; else statsFileID = fopen( statsFileName, 'a' ); end get_MFCCS( newDirName, statsFileID ); fclose( statsFileID ); case 'getPRAAT' % collate all PRAAT values switch databaseName case 'ChineseOperaTest' statsFileName = '../../../../../../../TestResults/test_singingPRAATStats.txt'; case 'ChineseOperaFull' statsFileName = '../../../../../../../TestResults/full_singingPRAATStats.txt'; case 'ChineseOperaPaper' statsFileName = '../../../../../../../TestResults/paper_singingPRAATStats.txt'; case 'MandarinSpeech' statsFileName = '../../../../../../../TestResults/mandarinPRAATStats.txt'; case 'SpeechTestFiles' statsFileName = '../../../../../../../TestResults/speechPRAATStats.txt'; end % Add a header row if( firstfileOpen == 1 ) statsFileID = fopen( statsFileName, 'w' ); fprintf( statsFileID, 'Metrics calculated using the PRAAT software. \n' ); fprintf( statsFileID, ' name \t JITTER: ddp \t local \t ppq5 \t rap \t SHIMMER: local \t dda \t apq3 \t apq5 \t apq11 \n'); fprintf( statsFileID, 'For each of the BURG FORMANTS: numberOfFormants \t meanFrequency \t varFrequency \t minFrequency \t maxFrequency \n'); fprintf( statsFileID, 'meanFrequencyDerivative \t varienceFrequencyDerivative \t minFrequencyDerivative \t max FrequencyDerivative \n'); fprintf( statsFileID, 'meanFrequency2ndDerivative \t varienceFrequency2ndDerivative \t minFrequency2ndDerivative \t max Frequency2ndDerivative \n'); fprintf( statsFileID, 'meanBandwidth \t varBandwidth \t minBandwidth \t maxBandwidth \n'); fprintf( statsFileID, 'meanBandwidthDerivative \t varBandwidthDerivative \t minBandwidthDerivative \t maxBandwidthDerivative \n'); fprintf( statsFileID, 'meanBandwidth2ndDerivative \t varBandwidth2ndDerivative \t minBandwidth2ndDerivative \t maxBandwidth2ndDerivative \n'); fprintf( statsFileID, 'For the mean of all three formants: meanFrequency \t varFrequency \t minFrequency \t maxFrequency \n'); fprintf( statsFileID, 'meanFrequencyDerivative \t varienceFrequencyDerivative \t minFrequencyDerivative \t max FrequencyDerivative \n'); fprintf( statsFileID, 'meanFrequency2ndDerivative \t varienceFrequency2ndDerivative \t minFrequency2ndDerivative \t max Frequency2ndDerivative \n'); firstfileOpen = 0; else statsFileID = fopen( statsFileName, 'a' ); end get_PRAAT( newDirName, statsFileID ); fclose( statsFileID ); case 'getJitter' % collate all Jitter values switch databaseName case 'ChineseOperaTest' statsFileName = '../../../../../../../TestResults/test_singingJitterStats.txt'; case 'ChineseOperaFull' statsFileName = '../../../../../../../TestResults/full_singingJitterStats.txt'; case 'ChineseOperaPaper' statsFileName = '../../../../../../../TestResults/paper_singingJitterStats.txt'; case 'MandarinSpeech' statsFileName = '../../../../../../../TestResults/mandarinJitterStats.txt'; case 'SpeechTestFiles' statsFileName = '../../../../../../../TestResults/speechJitterStats.txt'; end % Add a header row if( firstfileOpen == 1 ) statsFileID = fopen( statsFileName, 'w' ); fprintf( statsFileID, 'Metrics calculated using the PRAAT software. \n' ); fprintf( statsFileID, ' name \t JITTER: ddp \t local \t ppq5 \t rap \n'); firstfileOpen = 0; else statsFileID = fopen( statsFileName, 'a' ); end get_Jitter( newDirName, statsFileID ); fclose( statsFileID ); case 'getShimmer' % collate all Shimmer values switch databaseName case 'ChineseOperaTest' statsFileName = '../../../../../../../TestResults/test_singingShimmerStats.txt'; case 'ChineseOperaFull' statsFileName = '../../../../../../../TestResults/full_singingShimmerStats.txt'; case 'ChineseOperaPaper' statsFileName = '../../../../../../../TestResults/paper_singingShimmerStats.txt'; case 'MandarinSpeech' statsFileName = '../../../../../../../TestResults/mandarinShimmerStats.txt'; case 'SpeechTestFiles' statsFileName = '../../../../../../../TestResults/speechShimmerStats.txt'; end % Add a header row if( firstfileOpen == 1 ) statsFileID = fopen( statsFileName, 'w' ); fprintf( statsFileID, 'Metrics calculated using the PRAAT software. \n' ); fprintf( statsFileID, ' name \t SHIMMER: local \t dda \t apq3 \t apq5 \t apq11 \n'); firstfileOpen = 0; else statsFileID = fopen( statsFileName, 'a' ); end get_Shimmer( newDirName, statsFileID ); fclose( statsFileID ); case 'getFormants' % collate all Formants values switch databaseName case 'ChineseOperaTest' statsFileName = '../../../../../../../TestResults/test_singingFormantsStats.txt'; case 'ChineseOperaFull' statsFileName = '../../../../../../../TestResults/full_singingFormantsStats.txt'; case 'ChineseOperaPaper' statsFileName = '../../../../../../../TestResults/paper_singingFormantsStats.txt'; case 'MandarinSpeech' statsFileName = '../../../../../../../TestResults/mandarinFormantsStats.txt'; case 'SpeechTestFiles' statsFileName = '../../../../../../../TestResults/speechFormantsStats.txt'; end % Add a header row if( firstfileOpen == 1 ) statsFileID = fopen( statsFileName, 'w' ); fprintf( statsFileID, 'Metrics calculated using the PRAAT software. \n' ); fprintf( statsFileID, 'For each of the BURG FORMANTS: numberOfFormants \t meanFrequency \t varFrequency \t minFrequency \t maxFrequency \n'); fprintf( statsFileID, 'meanFrequencyDerivative \t varienceFrequencyDerivative \t minFrequencyDerivative \t max FrequencyDerivative \n'); fprintf( statsFileID, 'meanFrequency2ndDerivative \t varienceFrequency2ndDerivative \t minFrequency2ndDerivative \t max Frequency2ndDerivative \n'); fprintf( statsFileID, 'meanBandwidth \t varBandwidth \t minBandwidth \t maxBandwidth \n'); fprintf( statsFileID, 'meanBandwidthDerivative \t varBandwidthDerivative \t minBandwidthDerivative \t maxBandwidthDerivative \n'); fprintf( statsFileID, 'meanBandwidth2ndDerivative \t varBandwidth2ndDerivative \t minBandwidth2ndDerivative \t maxBandwidth2ndDerivative \n'); fprintf( statsFileID, 'For the mean of all three formants: meanFrequency \t varFrequency \t minFrequency \t maxFrequency \n'); fprintf( statsFileID, 'meanFrequencyDerivative \t varienceFrequencyDerivative \t minFrequencyDerivative \t max FrequencyDerivative \n'); fprintf( statsFileID, 'meanFrequency2ndDerivative \t varienceFrequency2ndDerivative \t minFrequency2ndDerivative \t max Frequency2ndDerivative \n'); firstfileOpen = 0; else statsFileID = fopen( statsFileName, 'a' ); end get_Formants( newDirName, statsFileID ); fclose( statsFileID ) % % %%%%% get all the pitch and energy related features % case 'getFeaturesOfDuration' % % collate number, mean and ratio duration of % % unvoiced and voiced sounds, median and % % standard deviation number of voiced sounds % statsFileName = '../../../../FeatureSets/singingDurationStats.txt'; % statsFileID = fopen( statsFileName, 'a' ); % getFeaturesOfDuration( newDirName, statsFileID ); % fclose( statsFileID ); % % case 'getFeaturesOfRelativePitch' % % collate relative pitch maximum, minimum and % % the position of those pitches % statsFileName = '../../../../FeatureSets/singingRelativePitchStats.txt'; % statsFileID = fopen( statsFileName, 'a' ); % getFeaturesOfRelativePitch( newDirName, statsFileID ); % fclose( statsFileID ); % % case 'getFeaturesOfRelativeEnergyGradient' % % collate the value and position of relative % % maximum of energy gradient % statsFileName = '../../../../FeatureSets/singingRelativeEnergyGradientStats.txt'; % statsFileID = fopen( statsFileName, 'a' ); % getFeaturesOfRelativeEnergyGradient( newDirName, statsFileID ); % fclose( statsFileID ); % % % case 'calculatePitch' detect_pitch( currentSampleName, OVERWRITE ); case 'calculateSilence' detect_Silence( currentSampleName, OVERWRITE ); case 'calculateVUV' % find the voiced and unvoiced frames using % the harmonic ratio and pitch information detect_VoicedUnvoiced( currentSampleName, OVERWRITE ); % case 'calculateAudioWaveform' % % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % AW_Detection( currentSampleName, x, fs, frameLength, noOfFrames ); % % case 'calculateAudioSpectrumEnvelope' % % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % ASE_Detection( currentSampleName, x, fs, frameLength, noOfFrames ); % % case 'calculateAudioSpectrumCentriodAndSpread' % % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % ASC_ASS_Detection( currentSampleName, x, fs, frameLength, noOfFrames ); % % case 'calculateAudioSpectrumBasisAndProjection' % % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % ASB_ASP_Detection( currentSampleName, x, fs, frameLength, noOfFrames ); % case 'calculateAudioPower' detect_AudioPower( currentSampleName, OVERWRITE ); % % case 'calculateLogAttackTIme' % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % LAT_Detection( currentSampleName, x, fs, frameLength, noOfFrames ); % % case 'calculateTemporalCentroid' % % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % TC_Detection( currentSampleName, x, fs, frameLength, noOfFrames ); % % case 'calculateHarmonicRatio' % % % can't find this function yet % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % HR_Detection( currentSampleName, x, fs, frameLength, noOfFrames ); % case 'calculateHarmonicNoiseRatio' detect_HNR( currentSampleName, OVERWRITE ); % % case 'calculateSpectralTimbralDescriptors' % % % these are best calculated together. % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % spectralTimbralDescriptors( currentSampleName, x, fs, frameLength, noOfFrames ); % case 'calculateAudioSpectrumFlatness' % % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % AudioSpectralFlatness_Detection( currentSampleName, x, fs, frameLength, noOfFrames ); case 'calculateMFCCs' detect_MFCC( currentSampleName, OVERWRITE ); % % case 'calculatesampleDependantThresholds' % % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % sampleDependantThresholds( currentSampleName, x, fs, frameLength, noOfFrames ); % % % %%%%% pitch related features %%%%% % case 'calculatesampleVoicedSoundDuration' % % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % getVoicedSoundDuration( currentSampleName, x, fs, noOfFrames, frameLength ); % % case 'calculatesampleRelativePitch' % % singingpitchStatsFileName = 'singingpitchStats.txt'; % singingpitchStatsFileID = fopen( singingpitchStatsFileName, 'r' ); % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % getRelativePitch( singingpitchStatsFileID, currentSampleName, x, fs, noOfFrames, frameLength, 7 ); % fclose(singingpitchStatsFileID); % % case 'calculatesampleRelativePitchFeatures' % % singingpitchStatsFileName1 = '../../../../FeatureSets/singingpitchStats.txt'; % singingpitchStatsFileID1 = fopen( singingpitchStatsFileName1, 'r' ); % singingpitchStatsFileName2 = 'singingpitchStats.txt'; % singingpitchStatsFileID2 = fopen( singingpitchStatsFileName2, 'r' ); % [averageValues1 averageValues2 averageValues3] = getRelativePitchFeatures( singingpitchStatsFileID1, 7 ); % getEachRelativePitchFeature( singingpitchStatsFileID2, currentSampleName, 7, averageValues1, averageValues2, averageValues3 ); % fclose(singingpitchStatsFileID1); % fclose(singingpitchStatsFileID2); % % case 'calculatesamplePitchPosition' % % singingpitchStatsFileName = 'singingpitchStats.txt'; % singingpitchStatsFileID = fopen( singingpitchStatsFileName, 'r' ); % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % getPitchPosition( singingpitchStatsFileID, currentSampleName, x, fs, noOfFrames, frameLength, 7 ); % fclose(singingpitchStatsFileID); % % % % %%%%% energy related features %%%%% % case 'calculatesampleRelativeEnergyByMeanAll' % % singingenergyStatsFileName = '../../../../FeatureSets/singingenergyStats.txt'; % singingenergyhStatsFileID = fopen( singingenergyStatsFileName, 'r' ); % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % getRelativeEnergyByMeanAll( singingenergyhStatsFileID, currentSampleName, x, fs, noOfFrames, frameLength, 3 ); % fclose(singingenergyhStatsFileID); % % case 'calculatesampleRelativeEnergyByMeanVoiced' % % singingenergyStatsFileName = '../../../../FeatureSets/singingenergyStats.txt'; % singingenergyhStatsFileID = fopen( singingenergyStatsFileName, 'r' ); % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % getRelativeEnergy( singingenergyhStatsFileID, currentSampleName, x, fs, noOfFrames, frameLength, 3 ); % fclose(singingenergyhStatsFileID); % % case 'calculatesampleRelativeEnergyGradientByMeanAll' % % statsFileName = '../../../../FeatureSets/singingenergyStats.txt'; % statsFileID = fopen( statsFileName, 'r' ); % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % getRelativeEnergyGradient( statsFileID, newDirName, x, fs, noOfFrames, frameLength, 3 ); % fclose( statsFileID ); % % case 'calculatesampleRelativeEnergyGradientFeaturesByMeanAll' % % [x, fs, frameLength, noOfFrames] = openFile( currentSampleName ); % getRelativeEnergyGradientFeatures( currentSampleName, x, fs, noOfFrames, frameLength ); % end cd ../ end end end cd ../ end cd ../ end end cd ../