hann static method

Float32List hann(
  1. Float32List frame
)

Implementation

static Float32List hann(Float32List frame) {
  final n = frame.length;

  final result = Float32List(n);

  for (int i = 0; i < n; i++) {
    final w = 0.5 * (1 - math.cos(2 * math.pi * i / (n - 1)));

    result[i] = frame[i] * w;
  }

  return result;
}