/// <summary> /// Initializes a new instance of the <see cref="Tempogram"/> class. /// </summary> public Tempogram() { LongTempogram = new Histogram(size); ShortTempogram = new Histogram(size); }
public float Distance(Histogram other) { if (other == null) return 1; var size = Size; var res = 0f; if (size == other.Size) for (int i = 0; i < size; i++) res += Math.Abs(values[i] - other.values[i]) / 255f; else for (int i = 0; i < size; i++) res += Math.Abs(values[i] / 255f - other[1f * i / size]); return res / size; }