有人可以解释为什么这两个 smith chart plot function for exactly same circle of plotly 和 scikit-rf 如此不同吗? 我怎样才能像 scikit-rf 那样绘制 plotly plot,因为我需要从 smith chart 读取值,而 scikit-rf plot 并不容易?
def calc_circle(c, r):
theta = np.linspace(0, 2*np.pi, 1000)
return c + r*np.exp(1.0j*theta)
c,r=0.4,0.2
fig = go.Figure(go.Scattersmith(imag=np.imag(calc_circle(c, r)), real=np.real(calc_circle(c, r)),marker_color="green",showlegend=True,name='Hello'))
fig.show()
n = rf.Network(name="out", s=calc_circle(c, r))
n.plot_s_smith(lw=2,draw_labels=True)
最佳答案
Plotly Scattersmith 要求以归一化阻抗值而不是反射系数值的形式提供图像和实际数据。这意味着您的函数 calc_circle
的结果需要使用简单公式 z = (1 + rho)/(1 - rho)
进行转换,其中 z
是归一化阻抗,rho
是您使用 calc_circle
函数获得的反射系数。
关于python plotly smith 图表函数行为与 scikit-rf 不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70649445/