主要内容

zplane

离散时间系统的零极点图

说明

zplane(z,p) 在当前图窗窗口中绘制离散时间系统的零极点。在列向量 z 中指定零点,在列向量 p 中指定极点。符号 'o' 表示零点,符号 'x' 表示极点。绘图包括单位圆作为参考。

如果 zp 是矩阵,则 zplane 用不同颜色绘制 zp 列中的零极点。

示例

zplane(b,a) 先使用 roots 找到由分子系数 b 和分母系数 a 表示的传递函数的零极点,然后 zplane 在当前图窗窗口中绘制零极点。将 ba 指定为行向量。

示例

zplane(B,A,"ctf") 找出并绘制表示为Cascaded Transfer Functions (CTF) 的数字滤波器的零极点,分子系数为 B,分母系数为 A (自 R2024b 起)

示例

[hz,hp,ht] = zplane(___) 返回零点值线 hz 和极点值线 hp 的句柄向量。ht 是坐标区/单位圆线和文本对象的句柄向量,它们在有多个零点或极点时出现。

zplane(d) 求出数字滤波器 d 所表示的传递函数的零极点。使用 designfilt 根据频率响应设定生成 d

[vz,vp,vk] = zplane(d) 返回与数字滤波器 d 对应的零点 vz、极点 vp 和增益 vk

示例

全部折叠

对于以 1000 Hz 频率采样的数据,绘制截止频率为 200 Hz、通带波纹为 3 dB、阻带衰减为 30 dB 的四阶椭圆低通数字滤波器的零极点。

[z,p,k] = ellip(4,3,30,200/500);
zplane(z,p)
grid
title('4th-Order Elliptic Lowpass Digital Filter')

Figure contains an axes object. The axes object with title 4th-Order Elliptic Lowpass Digital Filter, xlabel Real Part, ylabel Imaginary Part contains 3 objects of type line. One or more of the lines displays its values using only markers

使用 designfilt 创建相同的滤波器。使用 zplane 绘制零极点。

d = designfilt('lowpassiir','FilterOrder',4,'PassbandFrequency',200, ...
               'PassbandRipple',3,'StopbandAttenuation',30, ...
               'DesignMethod','ellip','SampleRate',1000);
zplane(d)

Figure contains an axes object. The axes object with title Pole-Zero Plot, xlabel Real Part, ylabel Imaginary Part contains 3 objects of type line. One or more of the lines displays its values using only markers

设计一个阻带衰减为 20 dB 的 8 阶切比雪夫 II 型带通滤波器。将阻带边缘频率指定为 π/8 弧度/采样点和 5π/8 弧度/采样点。

[b,a] = cheby2(8/2,20,[1 5]/8);

使用 zplane 绘制传递函数的零极点。

zplane(b,a)

Figure contains an axes object. The axes object with title Pole-Zero Plot, xlabel Real Part, ylabel Imaginary Part contains 3 objects of type line. One or more of the lines displays its values using only markers

可视化滤波器的零相位响应。叠加单位圆以及零极点位置。

[hw,fw] = zerophase(b,a,1024,"whole");

z = roots(b);
p = roots(a);

plot3(cos(fw),sin(fw),hw)
hold on
plot3(cos(fw),sin(fw),zeros(size(fw)),'--')
plot3(real(z),imag(z),zeros(size(z)),'o')
plot3(real(p),imag(p),zeros(size(p)),'x')
hold off
xlabel("Real")
ylabel("Imaginary")
view(35,40)
grid

Figure contains an axes object. The axes object with xlabel Real, ylabel Imaginary contains 4 objects of type line. One or more of the lines displays its values using only markers

自 R2024b 起

设计一个 40 阶低通切比雪夫 II 型数字滤波器,阻带边缘频率为 0.4,阻带衰减为 50 dB。使用 CTF 格式的滤波器系数,在 z 平面上绘制滤波器的零极点。

[B,A] = cheby2(40,50,0.4,"ctf");

zplane(B,A,"ctf")

Figure contains an axes object. The axes object with title Pole-Zero Plot, xlabel Real Part, ylabel Imaginary Part contains 3 objects of type line. One or more of the lines displays its values using only markers

输入参数

全部折叠

零极点,指定为列向量或矩阵。如果 zp 是矩阵,则 zplane 用不同颜色绘制 zp 列中的零极点。

数据类型: single | double
复数支持:

传递函数系数,指定为行向量。传递函数使用 z-1 定义:

H(z)=B(z)A(z)=b(1)+b(2)z1++b(n+1)zna(1)+a(2)z1++a(m+1)zm

示例: b = [1 3 3 1]/6a = [3 0 1 0]/3 用于指定归一化 3 dB 频率为 0.5π 弧度/采样点的三阶巴特沃斯滤波器。

数据类型: single | double
复数支持:

自 R2024b 起

级联传递函数 (CTF) 系数,指定为标量、向量或矩阵。BA 分别列出级联传递函数的分子系数和分母系数。

B 的大小必须为 L×(m + 1),A 的大小必须为 L×(n + 1),其中:

  • L 表示滤波器节的数量。

  • m 表示滤波器分子的阶。

  • n 表示滤波器分母的阶。

有关级联传递函数格式和系数矩阵的详细信息,请参阅以 CTF 格式指定数字滤波器

注意

如果 A(:,1) 的任一元素不等于 1,则 zplaneA(:,1) 对滤波器系数进行归一化。在这种情况下,A(:,1) 必须为非零。

数据类型: double | single
复数支持:

数字滤波器,指定为 digitalFilter 对象。使用 designfilt 根据频率响应设定生成数字滤波器。

示例: d = designfilt('lowpassiir','FilterOrder',3,'HalfPowerFrequency',0.5) 用于指定归一化 3 dB 频率为 0.5π 弧度/采样点的三阶巴特沃斯滤波器。

输出参量

全部折叠

由零极点图的零点值线 hz 和极点值线 hp 的句柄组成的向量。ht 是坐标区/单位圆线和文本对象的句柄向量,它们在有多个零或极点时出现。如果没有零点或极点,则 hzhp 是空矩阵 []

数字滤波器 d 的零点、极点和增益,以列向量和标量形式返回。

详细信息

全部折叠

提示

  • 您可以使用下式覆盖 zplane 的自动缩放:

    axis([xmin xmax ymin ymax])

    (在调用 zplane 后执行)。如果一个或多个零点或极点的幅值很大,使得其他零点或极点紧紧围绕原点而难以区分,则这种缩放非常有用。

参考

[1] Lyons, Richard G. Understanding Digital Signal Processing. Upper Saddle River, NJ: Prentice Hall, 2004.

版本历史记录

在 R2006a 之前推出

全部展开