filterAnalysisOptions
Description
filterAnalysisOptions
specifies analysis options for filters displayed in
Filter Analyzer.
Creation
Syntax
Description
returns an
object containing magnitude-response analysis options. Use opts
= filterAnalysisOptionsopts
to
specify analysis options for the Filter Analyzer
app.
returns filter analysis options for the specified analysis type.
opts
= filterAnalysisOptions(analysis
)analysis
sets the Analysis
property.
specifies Properties using one or more name-value
arguments, in addition to any combination of input arguments from previous
syntaxes.opts
= filterAnalysisOptions(___,Name=Value
)
Input Arguments
analysis
— Analysis type
"magnitude"
(default) | "phase"
| "groupdelay"
| "phasedelay"
| "magestimate"
| "noisepsd"
| "impulse"
| "step"
| "polezero"
| "info"
| "coefficients"
Analysis type, specified as one of these options:
Frequency-domain analyses:
"magnitude"
— Magnitude response"phase"
— Phase response"groupdelay"
— Group delay response"phasedelay"
— Phase delay response"magestimate"
— Magnitude response estimate"noisepsd"
— Noise power spectral density (PSD)
Time-domain analyses:
"impulse"
— Impulse response"step"
— Step response
Other analyses:
"polezero"
— Pole-zero plot"info"
— Filter information"coefficients"
— Filter coefficients
You can also specify analysis
as a name-value
argument: filterAnalysisOptions(Analysis=analysis)
is equivalent to
filterAnalysisOptions(analysis)
.
For more information, see Analysis
.
overlay
— Overlaid analysis
string
Overlaid analysis, specified as a string.
If you set
analysis
to a frequency-domain analysis, thenoverlay
must be also a frequency-domain analysis.If you set
analysis
to a time-domain analysis, thenoverlay
must be also a time-domain analysis.analysis
andoverlay
must be set to different values.This argument is not supported if you set
analysis
to"polezero"
,"info"
, or"coefficients"
.
You can also specify overlay
as a name-value
argument:
filterAnalysisOptions(Analysis=analysis,OverlayAnalysis=overlay)
is equivalent to filterAnalysisOptions(analysis,overlay)
Properties
Analysis Type
Analysis
— Analysis type
"magnitude"
(default) | "phase"
| "groupdelay"
| "phasedelay"
| "magestimate"
| "noisepsd"
| "impulse"
| "step"
| "polezero"
| "info"
| "coefficients"
Analysis type, specified as one of these options:
Frequency-domain analyses:
"magnitude"
— Magnitude response"phase"
— Phase response"groupdelay"
— Group delay response"phasedelay"
— Phase delay response"magestimate"
— Magnitude response estimate"noisepsd"
— Noise power spectral density (PSD)
Time-domain analyses:
"impulse"
— Impulse response"step"
— Step response
Other analyses:
"polezero"
— Pole-zero plot"info"
— Filter information"coefficients"
— Filter coefficients
For more information, see Analysis on the Filter Analyzer page.
OverlayAnalysis
— Overlaid analysis
string scalar | character vector
Overlaid analysis, specified as a string scalar or character vector.
If you set
Analysis
to a frequency-domain analysis, thenOverlayAnalysis
must be also a frequency-domain analysis.If you set
Analysis
to a time-domain analysis, thenOverlayAnalysis
must be also a time-domain analysis.Analysis
andOverlayAnalysis
must be set to different values.This argument is not supported if you set
Analysis
to"polezero"
,"info"
, or"coefficients"
.
For more information, see Analysis on the Filter Analyzer page.
Frequency Normalization and Sample Rate
FrequencyNormalizationMode
— Frequency normalization mode
"auto"
(default) | "normalized"
| "unnormalized"
Frequency normalization mode, specified as one of these options:
"normalized"
— The app normalizes the response of each input filter with respect to its sample rate and computes responses using normalized frequencies expressed in rad/sample."unnormalized"
— The app computes responses in cyclical frequencies expressed in hertz. For filters with no sample rate, the app assumes a rate of 1 Hz."auto"
— The app uses the"unnormalized"
mode if all filters under analysis have a specified sample rate and the"normalized"
mode otherwise.
Data Types: char
| string
ReferenceSampleRateMode
— Reference sample rate selection mode
"max"
(default) | "specify"
Reference sample rate selection mode, specified as one of these options:
"max"
— The app uses the maximum sample rate of all the filters under analysis in a display."specify"
— Specify a sample rate value using theReferenceSampleRate
property.
This property does not apply if you set
FrequencyNormalizationMode
to
"normalized"
.
Data Types: char
| string
ReferenceSampleRate
— Reference sample rate
positive scalar
Reference sample rate, specified as a positive scalar. The app uses the specified
reference sample rate to normalize filter responses and to define the overall Nyquist
range over which to analyze the filters. This property applies only if you set
ReferenceSampleRateMode
to "specify"
.
Example: 44.1e3
Data Types: double
Frequency-Domain Analysis
FrequencyRange
— Analysis frequency range
"auto"
(default) | "onesided"
| "twosided"
| "centered"
| "freqvector"
Analysis frequency range, specified as one of these options:
"onesided"
— The app computes responses over the range [0, π) when using normalized frequencies and over the range [0,referenceSampleRate
/2) when using unnormalized frequencies."twosided"
— The app computes responses over the range [0, 2π) when using normalized frequencies and over the range [0,referenceSampleRate
) when using unnormalized frequencies."centered"
— The app computes responses over the range [–π, π) when using normalized frequencies and over the range [–referenceSampleRate
/2,referenceSampleRate
/2) when using unnormalized frequencies. This option does not apply when you setFrequencyScale
to"log"
."freqvector"
— The app computes responses at the frequency points specified usingFrequencyVector
."auto"
— The app computes one-sided responses if all filters under analysis in a display have real-valued coefficients and two-sided responses if at least one filter has complex-valued coefficients.
Data Types: char
| string
NFFT
— Number of discrete Fourier transform points
8192
(default) | positive integer
Number of discrete Fourier transform points used to compute filter responses,
specified as a positive integer. This property does not apply when you set
FrequencyRange
to "freqvector"
.
Example: 1024
Data Types: double
FrequencyScale
— Frequency scale for visualizing filter responses
"linear"
(default) | "log"
Frequency scale for visualizing filter responses, specified as
"linear"
for a linear frequency scale or "log"
for a logarithmic frequency scale. The "log"
option does not apply
if you set FrequencyRange
to
"centered"
.
Data Types: char
| string
FrequencyVector
— Frequency vector
vector of finite real values
Frequency vector over which to compute filters, specified as a vector of finite
real values. If you set FrequencyVectorUnits
to
"normalized"
, the analyzer assumes the vector is in units of
rad/sample. Otherwise, it assumes the vector in the selected units.
This property applies only when you set FrequencyRange
to
"freqvector"
. This property is not supported when you set either
Analysis
or OverlayAnalysis
to
"magestimate"
or "noisepsd"
.
Example: [-pi/3 0 pi/6 pi/2]
and [-200 0 100
300]
are equivalent when the sample rate is 600 Hz.
Data Types: double
FrequencyVectorUnits
— Units for frequency vector values
"normalized"
(default) | "Hz"
| "kHz"
| "MHz"
| "GHz"
Units for frequency vector values, specified as "normalized"
,
"Hz"
, "kHz"
, "MHz"
, or
"GHz"
. If you set this property to
"normalized"
, the analyzer assumes the frequency vector is
normalized in units of rad/sample. Otherwise, it assumes the vector is in the selected
units.
This property applies only when you set FrequencyRange
to
"freqvector"
. This property is not supported when you set either
Analysis
or OverlayAnalysis
to
"magestimate"
or "noisepsd"
.
Data Types: char
| string
Magnitude Response and Magnitude Estimate
MagnitudeMode
— Magnitude response mode
"db"
(default) | "linear"
| "squared"
| "zerophase"
Magnitude response mode, specified as one of these options:
"linear"
— The app computes the filter response as the absolute value of the frequency response."squared"
— The app computes the filter response as the magnitude squared of the frequency response."db"
— The app computes the filter response as the magnitude, in decibel scale, of the frequency response."zerophase"
— The app computes the filter response as the zero-phase response. This option does not apply if you set eitherAnalysis
orOverlayAnalysis
to"magestimate"
.
Data Types: char
| string
MagnitudeEstimateNumTrials
— Number of trials to compute frequency response estimate
12
(default) | positive integer
Number of trials to compute the frequency response estimate, specified as a
positive integer. This property applies only when you set either
Analysis
or OverlayAnalysis
to
"magestimate"
.
Example: 24
Data Types: double
NormalizeMagnitude
— Magnitude response normalization
false
or 0
(default) | true
or 1
Magnitude response normalization, specified as a logical 0
(false
) or 1
(true
). If you
set this property to true
, the analyzer normalizes the filter
magnitude response to 1.
Data Types: logical
Phase Response and Phase Delay Response
PhaseUnits
— Units for phase response or phase delay response
"radians"
(default) | "degrees"
Units for the phase response or phase delay response, specified as
"radians"
or "degrees"
.
Data Types: char
| string
ContinuousPhase
— Option to use continuous phase when computing phase response
false
or 0
(default) | true
or 1
Option to use continuous phase when computing phase response, specified as a
logical 0
(false
) or 1
(true
).
Data Types: logical
Group Delay Response
GroupDelayUnits
— Units for group delay response
"samples"
(default) | "time"
Units for the group delay response, specified as "samples"
or
"time"
.
Data Types: char
| string
Noise PSD
NoisePSDNumTrials
— Number of trials to compute noise PSD
12
(default) | positive integer
Number of trials to compute the noise power spectral density, specified as a positive integer.
Example: 10
Data Types: double
Time-Domain Analysis
ResponseLengthMode
— Response length mode
"auto"
(default) | "specify"
Response length mode, specified as one of these options:
"auto"
— The app uses theimpzlength
function to estimate the response length."specify"
— You set the response length using theResponseLength
property.
Data Types: char
| string
ResponseLength
— Length of time-domain response
positive integer
Length of the time-domain response, specified as a positive integer. This property
applies only if you set ResponseLengthMode
to
"specify"
.
Example: 128
Data Types: double
Coefficients
CoefficientsFormat
— Format for filter coefficients
"decimal"
(default) | "hex"
| "binary"
Format for the filter coefficients, specified as "decimal"
,
"hex"
, or "binary"
.
Data Types: char
| string
All Domains
ReferenceFilter
— Double-precision reference filter display
false
or 0
(default) | true
or 1
Double-precision reference filter display, specified as a logical
0
(false
) or 1
(true
). If you set this property to true
,
Filter Analyzer displays the responses of quantized filters and their
double-precision references.
Data Types: logical
PolyphaseDecomposition
— View of polyphase decomposition of polyphase filter
false
or 0
(default) | true
or 1
View of the polyphase decomposition of the polyphase filter, specified as a
logical 0
(false
) or 1
(true
).
Data Types: logical
CTFAnalysisMode
— Cascaded transfer function computation mode
"complete"
(default) | "individual"
| "cumulative"
| "specify"
Cascaded transfer function computation mode, specified as one of these options:
"complete"
— The app computes the overall response of the cascaded sections."individual"
— The app computes the response of each section."cumulative"
— The app computes cumulative responses."specify"
— You use theCTFAnalysisSections
property to specify the combination of sections over which to compute responses.
Data Types: char
| string
CTFAnalysisSections
— Section combinations for CTF response computation
cell array
Section combinations for cascaded transfer function (CTF) response computation,
specified as a cell array. This property applies only when you set
CTFAnalysisMode
to "specify"
.
Example: {[1 2 3],[4 5 6]}
directs the app to compute
responses for a cascade of sections 1, 2, and 3 and a cascade of sections 4, 5, and
6.
Data Types: cell
Examples
Filter Analysis Options
Design a lowpass FIR filter and display its phase response in Filter Analyzer. Use 1024 NFFT points, and display the phase in degrees.
d = designfilt("lowpassfir", ... PassbandFrequency=0.45,StopbandFrequency=0.55, ... PassbandRipple=1,StopbandAttenuation=60); opts = filterAnalysisOptions("phase")
opts = filterAnalysisOptions with properties: Analysis: "phase" OverlayAnalysis: "none" FrequencyNormalizationMode: "auto" ReferenceSampleRateMode: "max" FrequencyRange: "auto" NFFT: 8192 FrequencyScale: "linear" PhaseUnits: "radians" ContinuousPhase: 0 ReferenceFilter: 1 PolyphaseDecomposition: 0 CTFAnalysisMode: "complete"
opts.NFFT = 1024;
opts.PhaseUnits = "degrees";
filterAnalyzer(d,AnalysisOptions=opts)
Version History
Introduced in R2024a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)