Documentation

freqrespopts

Options for filter frequency response analysis

Syntax

opts = freqrespopts(H)

Description

opts = freqrespopts(H) uses the settings in the dfilt object or the filter System object™, H, to create an object, opts. This object contains parameters and values for estimating the filter frequency response. You pass opts as an input argument to freqrespest to specify values for the input parameters.

freqrespopts allows you to use the same settings for freqrespest with multiple filters without specifying all of the parameters as input arguments to freqrespest.

The following Filter System objects are supported by this analysis function:

Filter System objects
dsp.FIRFilter
dsp.BiquadFilter
dsp.IIRFilter
dsp.AllpoleFilter
dsp.AllpassFilter
dsp.CoupledAllpassFilter

Examples

This example shows freqrespopts in use for setting options for freqrespest. 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 in freqrespest.

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');
hd.arithmetic='fixed';
hd2=design(d,'cheby2')
hd2.arithmetic='fixed';
opts=freqrespopts(hd)
 
opts =
 
                   NFFT: 512
    NormalizedFrequency: true
                     Fs: 'Normalized'
          SpectrumRange: 'Half'
               CenterDC: false

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

With opts configured as needed, use it as an input argument for freqrespest.

[h2,w2]=freqrespest(hd2,20,opts);
[h1,w1]=freqrespest(hd,20,opts);
Was this topic helpful?