isallpass

Determine whether filter is allpass

Syntax

flag = isallpass(b,a)
flag = isallpass(sos)
flag = isallpass(d)
flag = isallpass(___,tol)

Description

flag = isallpass(b,a) returns a logical output equal to 1 if the specified filter is allpass. Specify a filter with numerator coefficients b and denominator coefficients a.

example

flag = isallpass(sos) returns 1 if the filter specified by the second-order sections matrix sos is allpass.
flag = isallpass(d) returns 1 if the digital filter d is allpass.
flag = isallpass(___,tol) specifies a tolerance tol to determine when two numbers are close enough to be considered equal.

Examples

collapse all

Create an allpass filter and verify that the frequency response is allpass.

b = [1/3 1/4 1/5 1]; a = fliplr(b); flag = isallpass(b,a)
flag = logical 1 
freqz(b,a)

Create a lattice allpass filter and verify that the filter is allpass.

k = [1/2 1/3 1/4 1/5]; [b,a] = latc2tf(k,"allpass"); flag_isallpass = isallpass(b,a)
flag_isallpass = logical 1 
freqz(b,a)

Input Arguments

collapse all

Filter coefficients, specified as a vector. The values of b and a represent the numerator and denominator polynomial coefficients, respectively.

Example: [b,a] = cheby2(5,30,0.7) creates a digital 5th-order Butterworth lowpass filter with coefficients b and a, having a normalized 3 dB frequency of 0.7π rad/sample and 30 dB attenuation at stopband.

Data Types: single | double
Complex Number Support: Yes

Second-order section representation, specified as an L-by-6 matrix, where L is the number of second-order sections. The matrix

$\text{sos}=\left[\begin{array}{cccccc}{b}_{01}& {b}_{11}& {b}_{21}& 1& {a}_{11}& {a}_{21}\\ {b}_{02}& {b}_{12}& {b}_{22}& 1& {a}_{12}& {a}_{22}\\ ⋮& ⋮& ⋮& ⋮& ⋮& ⋮\\ {b}_{0L}& {b}_{1L}& {b}_{2L}& 1& {a}_{1L}& {a}_{2L}\end{array}\right]$

represents the second-order sections of H(z):

$H\left(z\right)=\prod _{k=1}^{L}{H}_{k}\left(z\right)=\prod _{k=1}^{L}\frac{{b}_{0k}+{b}_{1k}{z}^{-1}+{b}_{2k}{z}^{-2}}{1+{a}_{1k}{z}^{-1}+{a}_{2k}{z}^{-2}}.$

Example: [z,p,k] = butter(3,1/32); sos = zp2sos(z,p,k) specifies a third-order Butterworth filter with a normalized 3 dB frequency of π/32 rad/sample.

Data Types: single | double
Complex Number Support: Yes

Digital filter, specified as a digitalFilter object. Use designfilt to generate d based on frequency-response specifications.

Example: designfilt("lowpassfir",FilterOrder=10,CutoffFrequency=0.55) generates a digitalFilter object for a 10th order FIR lowpass filter with a normalized 3 dB frequency of 0.55π rad/sample.

Data Types: digitalFilter

Tolerance to distinguish between close numbers, specified as a positive scalar. The tolerance value determines when two numbers are close enough to be considered equal.

Data Types: single | double

Output Arguments

collapse all

Allpass filter flag, returned as a logical scalar. The function returns 1 when the input is an allpass filter.

Version History

Introduced in R2013a