예제 #1
0
        int IComparable <EqualizerFilter> .CompareTo(EqualizerFilter other)
        {
            if (other == null)
            {
                return(1);
            }

            return(AverageFrequency.CompareTo(other.AverageFrequency));
        }
예제 #2
0
 public void WriteToStream(StreamWriter sw)
 {
     sw.Write(StartTime.ToString(CultureInfo.InvariantCulture) + ";");
     sw.Write(Duration.ToString(CultureInfo.InvariantCulture) + ";");
     sw.Write(AverageFrequency.ToString(CultureInfo.InvariantCulture) + ";");
     sw.Write(MedianFrequency.ToString(CultureInfo.InvariantCulture) + ";");
     sw.Write(BestChannel + ";");
     sw.Write(FrequencyInBestChannel.ToString(CultureInfo.InvariantCulture) + ";");
 }
예제 #3
0
파일: Algorithm.cs 프로젝트: lulzzz/openECA
        public static AverageFrequency Execute(FrequencyCollection input)
        {
            AverageFrequency output = new AverageFrequency();

            output.Value = input.Frequencies
                           .Where(value => value != 0)
                           .DefaultIfEmpty(double.NaN)
                           .Average();

            string avg = output.Value.ToString("0.000").PadLeft(10);

            MainWindow.WriteMessage($"Avg: {avg}");

            return(output);
        }