Documentation

zerophase

Zero-phase response for filter

Syntax

[hr,w] = zerophase(hfilt)
[hr,w] = zerophase(hfilt,n)
zerophase(hfilt)
[hr,w] = zerophase(hs)
[hr,w] = zerophase(hs,n)
[hr,w] = zerophase(hs,Name,Value)
zerophase(hs)

Description

zerophase returns the zero-phase response based on the current filter coefficients. This section describes common zerophase operation with adaptive, discrete-time, and multirate filters. For more input options, refer to zerophase in Signal Processing Toolbox™ documentation.

[hr,w] = zerophase(hfilt) returns the instantaneous zero-phase response hr and the frequencies w in radians at which zerophase evaluated the response. The zero-phase response is evaluated at 8192 points equally spaced around the upper half of the unit circle.

[hr,w] = zerophase(hfilt,n) returns the instantaneous zero-phase response hr and the frequencies w in radians at which zerophase evaluated the response. The zero-phase response is evaluated at n points equally spaced around the upper half of the unit circle.

zerophase(hfilt) displays the zero-phase response of ha in the Filter Visualization Tool (FVTool).

[hr,w] = zerophase(hs) returns a zero-phase response for the filter System object™ hs using 8192 samples.

[hr,w] = zerophase(hs,n) returns a zero-phase response for the filter System object hs using n samples.

[hr,w] = zerophase(hs,Name,Value) returns a zero-phase response with additional options specified by one or more Name,Value pair arguments.

zerophase(hs) uses FVTool to plot the zero-phase response of the filter System object hs.

Input Arguments

expand all

hfilt

hfilt is either:

  • An adaptive adaptfilt, discrete-time dfilt, or multirate mfilt filter object

  • A vector of adaptive, discrete-time, or multirate filter objects

The multirate filter zero-phase response is computed relative to the rate at which the filter is running. When you specify fs (the sampling rate) as an input argument, zerophase assumes the filter is running at that rate.

For multistage cascades, zerophase forms a single-stage multirate filter that is equivalent to the cascade. It then computes the response relative to the rate at which the equivalent filter is running. zerophase does not support all multistage cascades. The function analyzes only those cascades for which there exists an equivalent single-stage filter.

As an example, consider a 2-stage interpolator where the first stage has an interpolation factor of 2 and the second stage has an interpolation factor of 4. In this case, an equivalent single-stage filter exists with an overall interpolation factor of 8. zerophase uses this equivalent filter for the analysis. If a sampling frequency fs is specified as an input argument to zerophase, the function interprets fs as the rate at which the equivalent filter is running.

hs

Filter System object.

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

Filter System objects
dsp.FIRFilter
dsp.FIRInterpolator
dsp.CICInterpolator
dsp.FIRDecimator
dsp.CICDecimator
dsp.FIRRateConverter
dsp.BiquadFilter
dsp.IIRFilter
dsp.AllpoleFilter
dsp.AllpassFilter
dsp.CoupledAllpassFilter

n

Number of samples. For an FIR filter where n is a power of two, the computation is done faster using FFTs.

Default: 8192

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

'Arithmetic' — Value type:‘double' | 'single' | 'fixed'

For filter System object inputs only, specify the arithmetic used during analysis. When you specify 'double' or 'single', the function performs double- or single-precision analysis. When you specify 'fixed' , the arithmetic changes depending on the setting of the CoefficientDataType property and whether the System object is locked or unlocked.

 Details for Fixed-Point Arithmetic

When you do not specify the arithmetic for non-CIC structures, the function uses double-precision arithmetic if the filter System object is in an unlocked state. If the System object is locked, the function performs analysis based on the locked input data type. CIC structures only support fixed-point arithmetic.

Output Arguments

hr

Complex, n-element zero-phase response vector. If hfilt is a vector of filters, hr is a complex, length(hfilt)-by-n matrix of phase response vectors whose columns correspond to each filter in hfilt. If n is not specified, the function uses a default value of 8192.

For adaptive filters, hr is the instantaneous zero-phase response.

w

Frequency vector of length n, in radians/sample. w consists of n points equally spaced around the upper half of the unit circle (from 0 to π radians/sample). If hfilt is a vector of filters, w is a complex, length(hfilt)-by-n matrix of phase response vectors whose columns correspond to each filter in hfilt. If n is not specified, the function uses a default value of 8192.

Was this topic helpful?