changeset 3:e1cfa7765647

initial commit - this file calculates the basic set of metrics (mean, variance, min and max, from an array of supplied data.
author Dawn Black <dawn.black@eecs.qmul.ac.uk>
date Mon, 10 Sep 2012 09:20:12 +0100
parents 5fd388fdd6ef
children 92ca03a8fa99
files Code/Collation/basicMetricSet.m
diffstat 1 files changed, 36 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Code/Collation/basicMetricSet.m	Mon Sep 10 09:20:12 2012 +0100
@@ -0,0 +1,36 @@
+function [metrics] = basicMetricSet( frameByFrameMetric, statsFileID )
+% from ShahHewlitt2008
+
+    metrics = [];
+
+    meanValue = mean( frameByFrameMetric );
+    metrics = [metrics meanValue];
+    fprintf( statsFileID, '\t %f ', meanValue );
+%     % median F0
+%     medianValue = median( frameByFrameMetric );
+%     metrics = [metrics medianValue];
+%     fprintf( statsFileID, '\t %f ', medianValue );
+%     % Standard deviation
+%     stdValue = std( frameByFrameMetric );
+%     metrics = [metrics stdValue];
+%     fprintf( statsFileID, '\t %f ', stdValue );
+
+    % the varience seemed to make the pitch calculations worse, but I'm not
+    % sure I am using it correctly - Dawn
+    % Variance
+    varValue = var(frameByFrameMetric);
+    metrics = [metrics varValue];
+    fprintf( statsFileID, '\t %f ', varValue );
+    % Minimum
+    minValue = min( frameByFrameMetric );
+    metrics = [metrics minValue];
+    fprintf( statsFileID, '\t %f ', minValue );
+    % Maximum
+    maxValue = max( frameByFrameMetric );
+    metrics = [metrics maxValue];
+    fprintf( statsFileID, '\t %f ', maxValue );
+    % range
+%     rangeValue = max( frameByFrameMetric ) - min( frameByFrameMetric );
+%     metrics = [metrics rangeValue];
+%     fprintf( statsFileID, '\t %f ', rangeValue );
+end
\ No newline at end of file