applyAll method

List<List<double>> applyAll(
  1. List<List<double>> data, {
  2. bool leadstateFn(
    1. int
    )?,
  3. bool enableDelayCanceling = true,
})

Implementation

List<List<double>> applyAll(
  List<List<double>> data, {
  bool Function(int)? leadstateFn,
  bool enableDelayCanceling = true,
}) {
  assert(data.length == channelCount);
  return [
    for (var i = 0; i < this.channelCount; i++)
      [
        for (var j = 0; j < data[i].length; j++)
          applyFilter(i, data[i][j], leadstateFn?.call(j) ?? true),
        if (enableDelayCanceling)
          for (var j = data[i].length - 1;
              j >= data[i].length - delaySample(i) - 1;
              j--)
            applyFilter(i, data[i][j], leadstateFn?.call(j) ?? true),
      ]..removeRange(0, enableDelayCanceling ? delaySample(i) : 0),
  ];
}