Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python plotly smith chart function behaviour is different from scikit-rf

Tags:

python

plotly

Can someone explain why this two smith chart plot function for exactly same circle of plotly and scikit-rf are so different? And how can I make plotly plot like scikit-rf because I need reading values from smith chart which is not easy by 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()

This is what plotly plot

    n = rf.Network(name="out", s=calc_circle(c, r))
    n.plot_s_smith(lw=2,draw_labels=True)

This is what scikit-rf plot

like image 324
Farzin Khodaveisi Avatar asked Sep 28 '26 16:09

Farzin Khodaveisi


1 Answers

Plotly Scattersmith requires that the imag and real data are provided in terms of normalized impedance values instead of reflection coefficient values. What this means is that results from your function calc_circle needs a conversion using the simple formula z = (1 + rho) / (1 - rho), where z is the normalized impedance and rho is the reflection coefficients that you obtain using the calc_circle function.

like image 160
Aleksander Avatar answered Oct 01 '26 05:10

Aleksander



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!