int IComparable <EqualizerFilter> .CompareTo(EqualizerFilter other) { if (other == null) { return(1); } return(AverageFrequency.CompareTo(other.AverageFrequency)); }
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) + ";"); }
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); }