%% Design a Filter Using firgr
% Design an FIR filter with two single-band notches at 0.25 and 0.55.

b1 = firgr(42,[0 0.2 0.25 0.3 0.5 0.55 0.6 1],[1 1 0 1 1 0 1 1],... 
{'n' 'n' 's' 'n' 'n' 's' 'n' 'n'});

%
% Design a highpass filter whose gain at 0.06 is forced to be zero. The gain at 0.055 is indeterminate since it should abut the band.

b2 = firgr(82,[0 0.055 0.06 0.1 0.15 1],[0 0 0 0 1 1],...
{'n' 'i' 'f' 'n' 'n' 'n'});

%
% Design a second highpass filter with forced values and independent approximation errors.

b3 = firgr(82,[0 0.055 0.06 0.1 0.15 1], [0 0 0 0 1 1], ...
{'n' 'i' 'f' 'n' 'n' 'n'}, [10 1 1] ,{'e1' 'e2' 'e3'});

%
% Use the filter visualization tool to view the results of the filters.

fvtool(b1,1,b2,1,b3,1)
legend('Filter b1','Filter b2','Filter b3');

% Copyright 2012 The MathWorks, Inc.