%% Analog and Digital Butterworth Filters
% Convert a sixth-order analog Butterworth lowpass filter to a digital filter using impulse invariance. Specify a sample rate of 10 Hz and a cutoff frequency of 2 Hz. Display the frequency response of the filter.

f = 2;
fs = 10;

[b,a] = butter(6,2*pi*f,'s');
[bz,az] = impinvar(b,a,fs);

freqz(bz,az,1024,fs)

% Copyright 2012 The MathWorks, Inc.