%% Second-Order Section Form of a Filter
% Design a 5th-order Butterworth lowpass filter using the butter function. Specify a cutoff frequency of 0.2\pi rad/sample. Express the output in state-space form. Convert the state-space result to second-order sections. Visualize the frequency response of the filter.

[A,B,C,D] = butter(5,0.2);
sos = ss2sos(A,B,C,D)
freqz(sos)

% Copyright 2015 The MathWorks, Inc.