Skip to content

MunclesBeard/smith-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smith Lab

Smith Lab is an interactive Python/Tkinter desktop application for learning how impedance, reflection, matching networks, and S-parameters fit together on a Smith chart.

Smith Lab showing an imported antenna sweep and matching analysis

  • Release: 0.1.0-beta
  • Primary tested platform: Windows 10/11
  • Recommended Python: 3.12

This is a source beta for learners, radio hobbyists, students, and engineers who want to inspect the math behind the chart instead of treating it as a black box.

Highlights

  • Enter or drag a load and see normalized impedance, reflection coefficient, VSWR, return loss, and reflected power update together.
  • Add series, shunt, and transmission-line matching steps, or synthesize an automatic two-component L match.
  • Optionally search nearby E24 component values and compare the remaining mismatch with the ideal solution.
  • Watch incident and reflected wavefronts form a standing wave on a simplified transmission line.
  • Import Touchstone files and inspect S11, S22, S21, S12, differential/common reflections, differential transmission, and mode conversion.
  • Link A/B markers across the Smith chart, return-loss/VSWR sweep, transmission plots, and the selected frequency.
  • View the matching schematic and before/after 10 dB return-loss bandwidth.
  • Save a portable .smithlab project and export publication-quality PNG, SVG, or PDF charts with concise values and matching context.
  • Open the calculation pane or hover over controls for plain-language help.

Quick Start on Windows

Install 64-bit Python 3.12 with Tkinter, then open PowerShell in the project folder and run:

py -3.12 -m venv .venv
.\.venv\Scripts\python.exe -m pip install --upgrade pip
.\.venv\Scripts\python.exe -m pip install -r requirements.txt
.\.venv\Scripts\python.exe main.py

If py -3.12 reports that no matching Python is installed, install Python 3.12 or substitute a Python 3.10-3.12 executable after confirming its version with python --version.

After .venv exists, python main.py also works: the launcher detects a different interpreter and restarts with the project environment. Every path is derived from the location of main.py; no username or machine-specific path is embedded in the application.

VS Code

  1. Open this folder in VS Code.
  2. Select .venv\Scripts\python.exe as the Python interpreter.
  3. Open Run and Debug.
  4. Choose Run Smith Lab.

The included launch settings and test discovery use paths relative to the workspace folder.

RF File Support

The full installation uses scikit-rf for Touchstone/network handling and pysmithchart with Matplotlib for publication exports.

  • Touchstone import accepts .s1p, .s2p, and higher-port .sNp files supported by scikit-rf.
  • Single-ended views expose available port reflections and transmissions.
  • Even-port files can be converted to generalized mixed mode. Smith Lab pairs adjacent physical ports as (1,2), (3,4), and so on.
  • A pair of 50 ohm single-ended conductors naturally uses a 100 ohm differential reference and a 25 ohm common-mode reference.
  • Transmission plots provide magnitude, unwrapped phase, and group delay.
  • Unload removes imported data while preserving the selected impedance and matching network for manual study.

The examples folder contains synthetic matched, reactive, resonant, antenna, cable, amplifier, filter, and balanced-pair sweeps. See examples/README.md for the lesson behind each file. These files are illustrative data, not hardware measurements.

Typical Workflow

  1. Enter an impedance manually or import a Touchstone measurement.
  2. Select a frequency directly, with the sweep slider, or with marker A/B.
  3. Add matching components manually or choose Auto match current point.
  4. Compare before/after return loss and bandwidth in the lower analysis tabs.
  5. Open Show math to inspect the equations and each matching step.
  6. Save the analysis as a .smithlab project or export a chart for a report.

Projects and Privacy

Smith Lab performs its analysis locally and does not upload measurement data. A .smithlab project embeds the original Touchstone bytes so the project can be moved to another computer without depending on the original file path. Treat a shared project as you would treat its source measurement.

Tests

Run the complete test suite from PowerShell:

.\.venv\Scripts\python.exe -m unittest -v

The tests cover Smith chart transforms, matching networks, fixed-component frequency behavior, project round trips, every bundled Touchstone example, mixed-mode conversion, publication exports, transmission math, and portable interpreter selection. GitHub Actions runs the suite on Python 3.10, 3.11, and 3.12 for Windows.

Current Limitations

  • 0.1.0-beta is a source release; there is not yet a signed executable or installer. Windows with Python 3.12 is the primary tested setup.
  • Matching elements use ideal lumped-component and lossless-line models. E24 selection does not yet include tolerance, parasitics, Q, current/voltage limits, or manufacturer-specific values.
  • The after-matching sweep describes input reflection. Smith Lab deliberately does not invent an after-match S21/S12 result without a complete two-port cascade model.
  • Mixed-mode conversion assumes adjacent +/- port ordering. Confirm the port order of real measurement files before interpreting differential results.
  • The included examples are synthetic educational fixtures. Smith Lab is not a substitute for VNA calibration, circuit simulation, or electromagnetic validation of real hardware.
  • Numerical behavior is extensively unit tested, but automated end-to-end GUI interaction coverage is still limited.

License

Smith Lab is available under the MIT License. See CHANGELOG.md for release history.

About

Interactive Smith chart learning app with Touchstone analysis, impedance matching, and linked RF plots.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages