Design IIR Butterworth Filter

Medium MATLAB DSP Asked at Analog Devices
Solve this problem

Design a digital Butterworth low-pass filter and return its second-order section coefficients, which is the form you actually want for a fixed-point implementation.

Constraints

  • Function: [sos, g] = design_butter(order, fc, fs).
  • Cutoff is given in Hz along with the sample rate.
  • Return second-order sections, not a single high-order transfer function.
  • Must reject a cutoff at or above the Nyquist frequency.
  • Use butter with the 'sos' output form.
  • Report the overall gain separately.
Starter codeMATLAB
1function [sos, g] = design_butter(order, fc, fs)2% TODO3end