%% Highpass Butterworth Filter
% Design a 9th-order highpass Butterworth filter. Specify a cutoff frequency of 300 Hz, which, for data sampled at 1000 Hz, corresponds to 0.6\pi rad/sample. Plot the magnitude and phase responses. Convert the zeros, poles, and gain to second-order sections for use by fvtool.

[z,p,k] = butter(9,300/500,'high');
sos = zp2sos(z,p,k);
fvtool(sos,'Analysis','freq')

% Copyright 2015 The MathWorks, Inc.