Documentation

曲相

Zero-phase response of digital filter

Syntax

[Hr,w] = zerophase(b,a)
[Hr,w] = zerophase(sos)
[Hr,w] = zerophase(d)
[HR,W] = Zerophase(...,NFFT)
[Hr,w] = zerophase(...,nfft,'whole')
[HR,W] = Zerophase(...,W)
[Hr,f] = zerophase(...,f,fs)
[Hr,w,phi] = zerophase(...)
曲相(...)

Description

[Hr,w] = zerophase(b,a)返回零相响应Hr,频率向量w(在弧度/样品中)Hris computed, given a filter defined by numeratorband denominatora。For FIR filters wherea = 1, you can omit the valuea从命令。评估零相响应512equally spaced points on the upper half of the unit circle.

The zero-phase response,Hr(ω),与频率响应有关,H(e), by

H ( e j ω ) = H r ( ω ) e j φ ( ω ) ,

whereφ(ω)is the continuous phase.

Note

零相响应始终是真实的,但不相当于幅度响应。前者可能是负面的,而后者不能负面。

[Hr,w] = zerophase(sos)返回零相响应for the second order sections matrix,SOSSOSis aK-by-6 matrix, where the number of sections,K, must be greater than or equal to 2. If the number of sections is less than 2,曲相considers the input to be the numerator vector,b。Each row ofSOScorresponds to the coefficients of a second order (biquad) filter. Theith row of theSOS矩阵对应于[bi(1) bi(2) bi(3) ai(1) ai(2) ai(3)]

[Hr,w] = zerophase(d)返回零相响应for the digital filter,d。利用designfiltto generatedbased on frequency-response specifications.

[HR,W] = Zerophase(...,NFFT)返回零相响应Hrand frequency vectorw(radians/sample), usingnfftfrequency points on the upper half of the unit circle. For best results, setnfftto a value greater than the filter order.

[Hr,w] = zerophase(...,nfft,'whole')返回零相响应Hrand frequency vectorw(radians/sample), usingnfftfrequency points around the whole unit circle.

[HR,W] = Zerophase(...,W)返回零相响应Hrand frequency vectorw(radians/sample) at frequencies in vectorw。The vectorwmust have at least two elements.

[Hr,f] = zerophase(...,f,fs)返回零相响应Hrand frequency vectorf(Hz), using the sampling frequencyfs(in Hz), to determine the frequency vectorf(in Hz) at whichHris computed. The vectorfmust have at least two elements.

[Hr,w,phi] = zerophase(...)返回零相响应Hr,频率向量w(RAD/样品)和连续相分量,。(Note that this quantity is not equivalent to the phase response of the filter when the zero-phase response is negative.)

曲相(...)plots the zero-phase response versus frequency. If you input the filter coefficients or second order sections matrix, the current figure window is used. If you input adigitalFilter, the step response is displayed inFVTool

Note

If the input to曲相is single precision, the zero-phase response is calculated using single-precision arithmetic. The output,Hr,是单个精度。

Examples

collapse all

利用designfiltto design a 54th-order FIR filter with a normalized cutoff frequency of 0.3π rad/sample, a passband ripple of 0.7 dB, and a stopband attenuation of 42 dB. Use the method of constrained least squares. Display the zero-phase response.

Nf = 54; Fc = 0.3; Ap = 0.7; As = 42; d = designfilt('lowpassfir','FilterOrder',nf,'CutoffFrequency',fc,。。。'PassbandRipple',Ap,“ stopbandAttantuation”,As,'DesignMethod','cls');曲相(d)

使用相同的过滤器使用fircls1, which uses linear units to measure the ripple and attenuation. Display the zero-phase response.

人民行动党= 10 ^(美联社/ 40);Apl = (pAp)1)/(pAp+1); pAs = 10^(As/20); Asl = 1/pAs; b = fircls1(Nf,Fc,Apl,Asl); zerophase(b)

Design a 10th-order elliptic lowpass IIR filter with a normalized passband frequency of 0.4π rad/sample, a passband ripple of 0.5 dB, and a stopband attenuation of 20 dB. Display the zero-phase response of the filter on 512 frequency points around the whole unit circle.

d = distionfilt(“ Lowpassiir”,'FilterOrder',10,“ PassBandFquency',0.4,。。。'PassbandRipple',0.5,“ stopbandAttantuation”,20,'DesignMethod',“椭圆”);Zerophase(D,512,'whole')

Create the same filter using椭圆。绘制其零相响应。

[b,a] = ellip(10,0.5,20,0.4); zerophase(b,a,512,'whole')

在R2006a之前引入