예제 #1
0
 private void AppendAggregateValues(StringBuilder builder, Aggregates aggregate)
 {
     foreach (var value in aggregate.PropertyValuesList)
     {
         builder.Append(value + "" + TABCHAR);
     }
 }
예제 #2
0
 public void AddFilesToWrite(List<Song> filesToWrite)
 {
     _writeList.AddRange(filesToWrite);
     if (_firstWrite)
     {
         _exampleSong = _writeList.First();
         _exampleSegmentStat = _exampleSong.SegmentStats;
         _exampleAggregate = _exampleSegmentStat.LoudnessMax;
     }
 }
예제 #3
0
 public SegmentStats(double confidenceMean, Aggregates loudnessStart, Aggregates loudnessMaxTime, 
     Aggregates loudnessMax, Aggregates duration, Aggregates[] pitches, Aggregates[] timbre)
 {
     ConfidenceMean = confidenceMean;
     LoudnessStart = loudnessStart;
     LoudnessMaxTime = loudnessMaxTime;
     LoudnessMax = loudnessMax;
     Duration = duration;
     Pitches = pitches;
     Timbre = timbre;
 }
예제 #4
0
 private static Aggregates Aggregate(IEnumerable<double> doubles)
 {
     var enumerable = doubles as double[] ?? doubles.ToArray();
     var stats = new DescriptiveStatistics(enumerable);
     var min = stats.Minimum;
     var max = stats.Maximum;
     var mean = stats.Mean;
     var median = enumerable.Median();
     var variance = stats.Variance;
     var skewness = stats.Skewness;
     var kurtosis = stats.Kurtosis;
     var valueRange = max - min;
     var result = new Aggregates(min, max, mean, median, variance, valueRange, skewness, kurtosis);
     return result;
 }
예제 #5
0
        private static Aggregates[] Aggregate(IEnumerable<double[]> doubles)
        {
            var segments = doubles.ToArray();
            var num_cols = segments[0].Length;
            var result = new Aggregates[num_cols];

            for (int j = 0; j < num_cols; j++)
            {
                var col = new double[segments.Length];
                for (int i = 0; i < segments.Length; i++)
                {
                    col[i] = segments[i][j];
                }
                result[j] = Aggregate(col);
            }

            return result;
        }
예제 #6
0
        Aggregates[] ReadAggregates(string[] fields, ref int ptr, int num_aggrs)
        {
            var pitches = new Aggregates[num_aggrs];

            for (int i = 0; i < num_aggrs; i++)
            {
                pitches[i] = ReadAggregate(fields, ref ptr);
            }

            return pitches;
        }