setLayout method

void setLayout(
  1. LayoutBase proto,
  2. int filterTypes
)
inherited

Implementation

void setLayout(LayoutBase proto, int filterTypes) {
  _numPoles = proto.getNumPoles();
  _numBiquads = (_numPoles + 1) ~/ 2;

  switch (filterTypes) {
    case DirectFormAbstract.direct_form_I:
      _states = List.generate(_numBiquads, (_) => DirectFormI());
      break;
    case DirectFormAbstract.direct_form_II:
    default:
      _states = List.generate(_numBiquads, (_) => DirectFormII());
      break;
  }
  _biquads = List.generate(_numBiquads, (i) {
    PoleZeroPair p = proto.getPair(i);
    final biquad = Biquad();
    biquad.setPoleZeroPair(p);
    return biquad;
  });

  applyScale(
      proto.normalGain / ((response(proto.normalW / (2 * math.pi)))).abs());
}