%% Frequency Response of SOS Filter
% This example plots the relative responses of the sections of a sixth-order filter with three sections. Each curve adds one more section to form the filter response.

Lowpass = fdesign.lowpass('n,fc',6,.4); ButterLowpass = butter(Lowpass,'SystemObject',true); 
CumSections = cumsec(ButterLowpass); hfvt = fvtool(CumSections{1},CumSections{2},CumSections{3}); 
legend(hfvt,'First Section','First Two Sections','Overall  Filter');

% Copyright 2012 The MathWorks, Inc.