Deembedding chip data

59 views
Skip to first unread message

prameela b

unread,
May 17, 2023, 2:15:12 PMMay 17
to scikit-rf
Hi,
I have a Raw_data. s2p file with the network containg Lg,Lsh and chip as shown below. I need to deembed the chip data from this Raw_data network.

Screenshot 2023-05-17 233941.png
It would be grateful if you check whether the below code is correct?
cnx = [
    [(port1, 0), (Lg.inv, 0)],
    [(Lg.inv, 1), (Lsh.inv, 0), (raw_data, 0)],
    [(raw_data, 1), (port2, 0)],
    [(Lsh.inv, 1), (ground, 0)],
]        
cir_deemb = rf.Circuit(cnx)
chip = cir.network

The Lg.inv is working fine. But the effect of Lsh.inv is not seen.
Thanks

Julien Hillairet

unread,
May 19, 2023, 5:15:54 AMMay 19
to scik...@googlegroups.com
If you already know the "Lg" and "Lsh" Network, then it is easy: getting the chip Network consists of "removing" (deembedding) the combination of Lg and Lsh using the "inverse" of this combination:

chip = (Lg ** Lsh).inv ** raw_data_ex

Here is an example to check it works:

import skrf as rf

#%% Generate a dummy example of "Raw_data"
chip_ref = rf.data.ring_slot  # dummy reference example

# create some Lg and Lsh Networks
media = rf.DefinedGammaZ0(frequency=chip_ref.frequency)
Lg = media.inductor(10e-9)
Lsh = media.shunt_inductor(20e-9)

# create a dummy example of your Raw_data
raw_data_ex = Lg ** Lsh ** chip_ref

#%% Deembedding the elements in front of the chip
chip = (Lg ** Lsh).inv ** raw_data_ex

print(chip == chip_ref)  # True

Julien

--
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/9a2e0c47-30ce-41ce-8c54-311093087f07n%40googlegroups.com.

Vincent Wang

unread,
May 22, 2023, 8:52:55 PMMay 22
to scikit-rf
Hi Sir,

I have a raw data “.s4p(normal mode)”, which is for the differential signals.

1.     Can I use “skrf” and then convert the file to “.s4p (mix mode)”?

2.     Can you give an example?

 

Thanks~

Vincent

julien.h...@gmail.com 在 2023年5月19日 星期五下午5:15:54 [UTC+8] 的信中寫道:

Denz Choe

unread,
May 22, 2023, 9:03:13 PMMay 22
to scik...@googlegroups.com

Denz Choe

unread,
May 22, 2023, 9:27:27 PMMay 22
to scikit-rf

prameela b

unread,
May 23, 2023, 1:59:13 PMMay 23
to scik...@googlegroups.com
Thank you for the response. This code works when using "Lsh = media.shunt_inductor(20e-9)". But if I am using s2p files of inductors Lg and Lsh, and use "chip = (Lg ** Lsh).inv ** raw_data_ex" the ground connection of Lsh will not work. So I have a few doubts:
1. When using s2p files how to deembed the Lg connected in series and Lsh connected to ground from rawdata using ** operator.
2. Is there a way to include the s2p file into .shunt_inductor()


Regards
Dr. Prameela B

Julien Hillairet

unread,
May 24, 2023, 5:38:04 AMMay 24
to scik...@googlegroups.com
If your shunt inductor is a two-port Network "ntwk", try the following:

Lsh = media.shunt(ntwk ** media.short())

Julien

王文頡

unread,
May 24, 2023, 10:14:17 PMMay 24
to scik...@googlegroups.com
Hi Sir,

Can I simply get the file "mixed mode.s4p" as shown below?

(but it seems fail) 


============python code==================================== 
import skrf as rf
normal_mode_file = 'normal_mode.s4p'
normal_mode_network = rf.Network(normal_mode_file)
mixed_mode_network = normal_mode_network.to_mixed_mode()
mixed_mode_file = 'mixed_mode.s4p'
mixed_mode_network.write_touchstone(mixed_mode_file)
===============================================================

============error message==================================== 
runfile('C:/Python_test/01_Normal_Mix_convert/01_Normal_to_Mix_2023.py', wdir='C:/Python_test/01_Normal_Mix_convert')
Traceback (most recent call last):

  File "C:\Python_test\01_Normal_Mix_convert\01_Normal_to_Mix_2023.py", line 16, in <module>
    mixed_mode_network = normal_mode_network.to_mixed_mode()

  File "C:\Users\vincent.wang\Anaconda3\lib\site-packages\skrf\network.py", line 944, in __getattr__
    raise AttributeError

AttributeError

Denz Choe <kinkha...@gmail.com> 於 2023年5月23日 週二 上午9:03寫道:

Julien Hillairet

unread,
May 25, 2023, 3:01:12 AMMay 25
to scik...@googlegroups.com
Dear Vincent,

I'm not sure about this specific file, but you can find example files in the documentation directory (doc/source/...) in the scikit-rf installation directory. Otherwise, directly on Github : https://github.com/scikit-rf/scikit-rf/tree/master/doc/source

Julien



Vincent Wang

unread,
Sep 17, 2023, 3:04:35 AM (4 days ago) Sep 17
to scikit-rf
Hi Sir,

I have a question about how to package an.exe file.

Actually, I use “scikit-rf ”, and using pyinstaller to package one file as below shown error massage.

cmd: pyinstaller --onefile 00_HSReport_xxx_FD_RV_alleq_20310917_2_one_ok.py

Do you have any suggestions for how I should go about doing this? or which tool I can package source with sciket-rf?

Thanks~

=============================================================================================
C:\Python_test\09_Project\01_xxx\00_Report>00_HSReport_xxxx_FD_RV_alleq_20310917_2_one_ok.exe

Traceback (most recent call last):
  File "00_HSReport_BB49_FD_RV_alleq_20310917_2_one_ok.py", line 9, in <module>
    import skrf as rf
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 385, in exec_module
  File "skrf\__init__.py", line 14, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 385, in exec_module
  File "skrf\media\__init__.py", line 40, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 385, in exec_module
  File "skrf\media\freespace.py", line 20, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 385, in exec_module
  File "skrf\data\__init__.py", line 35, in <module>
  File "skrf\network.py", line 447, in __init__
  File "skrf\util.py", line 268, in get_fid
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\VINCEN~1.WAN\\AppData\\Local\\Temp\\_MEI157082\\skrf\\data\\ntwk1.s2p'
[10732] Failed to execute script '00_HSReport_BB49_FD_RV_alleq_20310917_2_one_ok' due to unhandled exception!


julien.h...@gmail.com 在 2023年5月25日 星期四下午3:01:12 [UTC+8] 的信中寫道:

Franz Forstmayr

unread,
Sep 19, 2023, 4:15:55 PM (yesterday) Sep 19
to scikit-rf
This is probably because skrf tries to load some local files after importing, which are probably not packed by pyinstaller.

You could try this branch https://github.com/scikit-rf/scikit-rf/pull/957 which tries to remove the loading of the files if not needed initially.

BR Franz

Reply all
Reply to author
Forward
0 new messages