绘制allpass fi的Bode图

2024-05-13 21:23:35 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图绘制一个全通滤波器的Bode图。然而,输出结果与实际情况不同。大小不应该是恒定的吗? 我使用以下公式进行全通滤波器: enter image description here

from scipy import signal
import matplotlib.pyplot as plt

sys = signal.TransferFunction([0.5, 1], [1, 0.5])
print("Zeros {}".format(sys.zeros))
print("Poles {}".format(sys.poles))
w, mag, phase = sys.bode()

plt.figure()
plt.title("Mag")
plt.semilogx(w, mag)    # Bode magnitude plot
plt.figure()
plt.title("Phase")
plt.semilogx(w, phase)  # Bode phase plot
plt.show()

输出: 零[-2] 极[-0.5]

enter image description here

enter image description here


Tags: importformatsignalplottitlesys绘制plt