%% Set Frequency Response Options
% This example uses the freqrespopts function to set options which are used by the freqrespest function. hd and hd2 are bandpass filters that use different design methods. The opts object makes it easier to set the same conditions for the frequency response estimate when using the freqrespest function with different filter objects..

d = fdesign.bandpass('fst1,fp1,fp2,fst2,ast1,ap,ast2',...
0.25,0.3,0.45,0.5,60,0.1,60);
hd = design(d,'butter','SystemObject',true)

%

hd2 = design(d,'cheby2','SystemObject',true)

%

opts = freqrespopts(hd)

%

opts.NFFT = 256; % Same as set(opts,'nfft',256).
opts.NormalizedFrequency = false;
opts.fs = 1.5e3;
opts.CenterDC = true

%
% With the opts object configured as needed, use it as an input argument for the freqrespest function.

[h2,w2] = freqrespest(hd2,20,opts);
[h1,w1] = freqrespest(hd,20,opts);

% Copyright 2012 The MathWorks, Inc.