function Hd = filterek
%FILTEREK Returns a discrete-time filter object

%
% M-File generated by MATLAB(R) 7.0 and the Signal Processing Toolbox 6.2.
%
% Generated on: 21-Dec-2006 11:53:44
%

% Butterworth Bandpass filter designed using the BUTTER function.

% All frequency values are in Hz.
Fs = 500;  % Sampling Frequency

N   = 6;     % Order
Fc1 = 7.9;   % First Cutoff Frequency
Fc2 = 12.1;  % Second Cutoff Frequency

% Calculate the zpk values using the BUTTER function.
[b,a] = butter(N/2, [Fc1 Fc2]/(Fs/2));

% To avoid round-off errors, do not use the transfer function.  Instead
% get the zpk representation and convert it to second-order sections.
[sos_var,g] = zp2sos(z, p, k);
Hd          = dfilt.df2sos(sos_var, g);


% [EOF]
