Add Limit Line for Return Loss

60 views
Skip to first unread message

MrLapDong

unread,
Jun 28, 2022, 3:57:09 AM6/28/22
to scik...@googlegroups.com
Hi,
        I would like to add Limit Line for Return Loss as expressions below:
Mated HCB-MCB SDD11, SDD22 < -20+f dB         for     f < 4 GHz
Mated HCB-MCB SDD11, SDD22 > -18+f/2 dB      for     4 GHz < f < 16 GHz
Mated HCB-MCB SDD11, SDD22 <-10 dB             for     16 GHz < f < 48 GHz

image.png
        Does anyone know how to do that?

Regards,
Dong

mhuser

unread,
Jun 28, 2022, 4:43:51 AM6/28/22
to scikit-rf
Hi,
if you only need a visual hint and no software comparison, you can do something like below, else you will need to construct f_lim and db_lim from network.frequency.f.

from matplotlib import pyplot as plt
import numpy as np
rf.stylely()
f_lim = np.array([0, 4e9, 16e9, 48e9])
db_lim = np.array([-20, -20, -10, -10])

plt.figure()
# network is the network to plot
network.plot_s_db(0,0, label = 'example, SDD11')
plt.plot(f_lim, db_lim, linestyle = 'dashed', color = 'red', linewidth = 2, label = 'limit')

Best regards,
Matthias

MrLapDong

unread,
Jun 28, 2022, 9:19:19 PM6/28/22
to scik...@googlegroups.com, matt...@huser.ch
Thanks Matthias.
Anyway, do you have any example of constructing f_lim and db_lim from network.frequency.f.

Regards,
Dong

--
You received this message because you are subscribed to the Google Groups "scikit-rf" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scikit-rf+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scikit-rf/b8726de8-b418-48f0-95f5-df08583b70dfn%40googlegroups.com.

mhuser

unread,
Jun 29, 2022, 5:01:21 AM6/29/22
to scikit-rf
Of course:
import skrf as rf
from skrf.media import MLine

from matplotlib import pyplot as plt
import numpy as np
rf.stylely()

# fake microstrip line
f = rf.Frequency(1, 50, 100, 'GHz')
m = MLine(frequency = f, w=2.5e-3, h=1.55e-3, ep_r=4.5)
l = m.thru(z0 = 50) ** m.line(5, 'mm') ** m.thru(z0 = 50)
l.name = 'dut'

#limit line
f_lim = l.frequency.f
db_lim = np.zeros(l.frequency.f.shape)
for i, ff in enumerate(f_lim):
    if ff < 4e9:
        db_lim[i] = -20 + ff * 1e-9
    elif ff < 16e9:
        db_lim[i] = -18 + ff * 1e-9 / 2
    elif ff < 48e9:
        db_lim[i] = -10
    else:
        db_lim[i] = np.nan
       
# is there something above limit ? (ignoring nans, will be 0 if not found)
x = np.nanargmax(l.s_db[:, 0,0] > db_lim)


plt.figure()
# network is the network to plot
l.plot_s_db(0,0)

plt.plot(f_lim, db_lim, linestyle = 'dashed', color = 'red', linewidth = 2,
         label = 'limit')
if x > 0:
    plt.plot(f_lim[x], db_lim[x], linestyle = 'none', marker = 'o', color = 'green',
         label = 'first excursion')
plt.legend()
Figure_1.png
Best regards,
Matthias

MrLapDong

unread,
Jun 29, 2022, 9:20:11 PM6/29/22
to scik...@googlegroups.com
Thank you very much.

Ahmad mureed

unread,
Oct 1, 2022, 10:31:49 AM10/1/22
to scikit-rf
Hallo Mathias.   

thanks for your kind answers.   

i am new in this platform .   actually i have tow questions from you.   first.   how can i found skrf library in pycharm.  i tried to install from pypi. but there is no library in this name.    

second question is.  i need a pycharm script which i can read the S parameters of Anritsu MS46122B.   if you have any example or something. kindly please let me know about.   


sincerly yours. 

A. Mureed

mhuser

unread,
Oct 1, 2022, 2:41:30 PM10/1/22
to scikit-rf
Hello Mureed,

Unfortunately, I am not skilled in pycharm. I usually install scikit-rf via the conda package manager or pip using this doc. From this help page, it seems possible to do this into a pycharm project but I never used pycharm so I am not able to test it.

Last time I did a measurement with an Anritsu VNA, I followed the artisanal way: saving the s-parameters on a USB drive and processing them later on computer. Of course, this is not adapted to automation or bulk measurements. Maybe Others with experience in this could be of better help.

Best regards,
Matthias
Reply all
Reply to author
Forward
0 new messages