freqrespopts

Options for filter frequency response analysis

Syntax

```opts = freqrespopts(H) ```

Description

`opts = freqrespopts(H)` uses the settings in 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:

In addition, `dsp.FarrowRateConverter` and `dsp.FilterCascade` support this analysis method.

Examples

collapse all

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','SystemObject',true)```
```hd = dsp.BiquadFilter with properties: Structure: 'Direct form II' SOSMatrixSource: 'Property' SOSMatrix: [18x6 double] ScaleValues: [19x1 double] InitialConditions: 0 OptimizeUnityScaleValues: true Show all properties ```
`hd2 = design(d,'cheby2','SystemObject',true)`
```hd2 = dsp.BiquadFilter with properties: Structure: 'Direct form II' SOSMatrixSource: 'Property' SOSMatrix: [9x6 double] ScaleValues: [10x1 double] InitialConditions: 0 OptimizeUnityScaleValues: true Show all properties ```
`opts = freqrespopts(hd)`
```opts = struct with fields: FreqPoints: 'All' 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 = struct with fields: FreqPoints: 'All' 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);```