%% Design Notch Filter
% Design a direct-form I notching filter that has a filter order of 6, center frequency of 0.5, quality factor of 10, and a passband ripple of 1 dB.
% Create a notch filter design specification object using the fdesign.notch function and specify these design parameters.

notchSpecs  = fdesign.notch('N,F0,Q,Ap',6,0.5,10,1);

% Design the notch filter using the design function. The resulting filter is a dsp.BiquadFilter System object™. For details on how to apply this filter on streaming data, refer to dsp.BiquadFilter.

notchFilt = design(notchSpecs,'SystemObject',true)

% Visualize the frequency response of the designed filter using fvtool.

fvtool(notchFilt)

%
%
% Copyright 2012 The MathWorks, Inc.