The Touchstone Visualizer is a GUI-based tool for visualizing S-parameter files (.s2p, .s4p) using scikit-rf and PyQt6. It allows users to:
-
Load multiple Touchstone files simultaneously.
-
Enable/disable specific files for plotting.
-
Toggle between standard and mixed-mode S-parameters.
Port Numbering Convention:
Single Ended 4-port Differential 2-port _________ | | 1 ___| --> |___3 _________ | | translates into | | 2 ___| --> |___4 1--| --> |--2 | | |_________| |_________| -
Interactively resize the Matplotlib canvas.
-
Export plotted data for further analysis.
-
Generate an executable version for standalone use.
✅ Load multiple S-parameter files (.s2p, .s4p).
✅ Enable/disable specific files using checkboxes.
✅ Convert to Mixed-Mode (se2gmm) for 4-port networks.
✅ Log-magnitude (dB) plots with frequency in GHz.
✅ Interactive resizing of plots.
✅ Standalone executable via PyInstaller.
Ensure you have Python 3.13.2 installed.
Run the following command to install required packages:
pip install numpy matplotlib pyqt6 scikit-rfTo start the Touchstone Viewer, execute:
python touchstone_viewer.py- Click "Open File" and select one or more
.s2por.s4pfiles. - Use the checkboxes to enable/disable specific files.
- If applicable, check "Enable Mixed-Mode" for 4-port networks.
- Select desired S-parameters using checkboxes.
- Click "Plot S-Parameters" to visualize the data.
- Resize the plot interactively using the mouse.
- Click "Plot TDR to visualize the data. It will visualize S11 for Single Ended and SDD11 for Mixed Mode.
- Resize the plot interactively using the mouse.
-
Select desired S-parameters using checkboxes.
-
Click "Run Passivity Check" to check for Passivity of the network
- Ensures that the network doe not generate energy, meaning no S-Parameter magnitued should exceed 1 (0 dB)
- This check is crucial for passive components like filters, attenuator and cables.
-
Click "Run Causality Check" to check for Causality of the network
- Ensures that future signals do not influence past signals (i.e. real-world behaviour)
- A non-causal response suggests incorrect time-domain beahavior, such as truncation artifacts in frequency-domain measurements.
-
Click "Run Reciprocity Check" to check for Reciprocity of the network according to:
- Ensures that the network behaves the same in both directions (common for passive reciprocal devices like cables, filters and antennas)
To build an .exe file:
pyinstaller --onefile --windowed --name TouchstoneVisualizer ./TouchstoneVisualizer.pyThis generates an executable in the dist/ folder.
- PyInstaller not recognized? Ensure it is installed:
pip install pyinstaller
- PyQt6-related errors? Try reinstalling:
pip install --force-reinstall pyqt6
- Plot labels cut off? Ensure the window is resized properly.
For issues or feature requests, feel free to contribute by pull requests!
This project is licensed under the GNU General Public License (GPL) – you are free to use, modify, and distribute it, but any derivative work must also be open-source under the same license.
Ey, I am Edgar👋🏼
I’m an electronics designer and with 15+ years of experience in companies across automotive, industrial, medical, and IoT sectors. Ever since I was interested in computers and finally let my passion come true by becoming a Motherboard Designer. I created x86 and ARM based motherboards with AMD, Intel and Nvidia Chipsets. During that time I specialized in Signal and Power Integrity.

