bandPass method

void bandPass(
  1. int order,
  2. double sampleRate,
  3. double centerFrequency,
  4. double widthFrequency,
  5. double rippleDb, [
  6. int directFormType = DirectFormAbstract.direct_form_II,
])

Bandpass filter with custom topology

Param:

  • order - Filter order
  • sampleRate - Sampling rate
  • centerFrequency - Center frequency
  • widthFrequency - Width of the notch
  • rippleDb - pass-band ripple in decibel sensible value: 1dB
  • directFormType - The filter topology. Default direct_form_II

Implementation

void bandPass(
  int order,
  double sampleRate,
  double centerFrequency,
  double widthFrequency,
  double rippleDb,
  [int directFormType = DirectFormAbstract.direct_form_II]
  ) {
  _AnalogLowPass analogProto =  _AnalogLowPass(order);
  analogProto.design(rippleDb);
  LayoutBase digitalProto =  LayoutBase(order * 2);
  BandPassTransform(centerFrequency / sampleRate, widthFrequency / sampleRate, digitalProto, analogProto);
  setLayout(digitalProto, directFormType);
}