view Code/Collation/basicMetricSet.m @ 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
children 92ca03a8fa99
line wrap: on
line source
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