Public Documentation
Documentation for SmithChart.jl
public interface.
Contents
Index
SmithChart.CGCircle
SmithChart.NFCircle
SmithChart.StabilityCircle
SmithChart.datamarkers
SmithChart.smithplot
SmithChart.smithscatter
SmithChart.vswr
Public Interface
SmithChart.smithplot
— Functionsmithplot(z; kwargs...)
Plot lines on the Smith Chart.
Valid Keywords:
color
sets the color of the marker. Read? scatter
.colormap = :viridis
sets the colormap that is sampled for numeric colors.linestyle = :rect
sets the pattern of the line e.g. :solid, :dot, :dashdot.line_width = 2.8
sets the width of the line in pixel units.label = nothing
reflection = false
: Specifies whether it is a normalized impedance or a reflection coefficient.freq = Float64[]
Array of frequencies associated with each represented value. Mainly used byDataInspector
.
Examples
using SmithChart
using CairoMakie
fig = Figure(size = (800, 600))
sc = SmithAxis(fig[1, 1], cutgrid = true)
r = 0.6 .+ 0.15 * exp.(1im .* range(0, 2π; length = 300))
smithplot!(sc, r; color = :dodgerblue, linewidth = 2)
fig
```
SmithChart.smithscatter
— Functionsmithscatter(z; kwargs...)
Scatter points on the Smith Chart.
Valid Keywords:
color
sets the color of the marker. Read? scatter
.colormap = :viridis
sets the colormap that is sampled for numeric colors.marker = :rect
sets the scatter marker.markersize = 9
sets the size of the marker.label = nothing
reflection = false
: Specifies whether it is a normalized impedance or a reflection coefficient.freq = Float64[]
Array of frequencies associated with each represented value. Mainly used Mainly used byDataInspector
.
Examples
using SmithChart
using CairoMakie
fig = Figure(size = (800, 600))
sc = SmithAxis(fig[1, 1], cutgrid = true)
r = 0.6 .+ 0.15 * exp.(1im .* range(0, 2π; length = 300))
smithscatter!(sc, r; color = :dodgerblue, linewidth = 2)
fig
SmithChart.vswr
— Functionvswr(v; args...)
Plots reflection data on a Smith chart, configured to visualize Voltage Standing Wave Ratio (VSWR) characteristics.
This function is a convenience wrapper around smithplot
, with the keyword reflection = true
set by default. It is intended for use when plotting reflection coefficients or S-parameter data, where impedance normalization is not needed.
Arguments
v
: VSWR valueargs...
: Additional keyword arguments forwarded tosmithplot
, allowing customization of plot appearance and behavior.
Example
vswr(2.0; color = :red, linewidth = 2)
This plots a VSWR = 2 circle centered at the origin with radius 1/3.
See also: smithplot
, smithscatter
SmithChart.datamarkers
— Functiondatamarkers(ax::SmithAxis, gp::GridPosition, priority = 100; fontsize = 10.0, title = true, kwargs...)
Allows creating data markers with double click on the lines or scatter plots.
Arguments
- ax::SmithAxis is the
SmithAxis
. - gp::GridPosition is a GridPosition. Example: fig[1,2]
- markerdict::Dict{Int, ComplexF64} is a Dict that stores the data of each marker. If you don't need
the values you can ignore this argument.
Examples
using SmithChart
using GLMakie
fig = Figure(size = (800, 600))
sc = SmithAxis(fig[1, 1], cutgrid = true)
r = 0.6 .+ 0.35 * cis.(range(0, 2π; length = 300))
smithplot!(sc, r; color = :dodgerblue, linewidth = 2)
datamarkers(sc, fig[1,2])
fig
SmithChart.NFCircle
— FunctionNFCircle(F, Fmin, Γopt, Rn, Zo)
Computes the points of the constant Noise Figure Circle.
Arguments
- F: noise factor
- Fmin: minimum noise factor
- Γopt: optimimum source reflection coefficient related to Zopt or Yopt.
- Rn: noise resistance parameter
- Zo: Reference Impedance
- Np: Number of points
Example
using SmithChart
NF_to_F(nf) = 10.0^(nf/10.0)
Γopt = 0.5 * cis(130 * pi / 180)
NFmin = 1.6 # dB
Fmin = NF_to_F(NFmin)
F2dB = NF_to_F(2.0)
nf2 = NFCircle(F2dB, Fmin, Γopt, 20.0, 50.0, 361)
SmithChart.CGCircle
— FunctionCGCircle(gi, Sii)
Computes the points of the Constant Gain Circle.
Arguments
- gi: It's gsource or gload and it's value is G / Gmax
- Sii: Reflection S parameter. S11 for Gs and S22 for Gl.
- Np: Number of points
Example
using SmithChart
S11 = 0.533 * cis(176.6 / 180 * π)
Gs_max = 1 / (1 - abs2(S11))
gain(dB) = 10.0^(dB/10.0)
g1 = gain(0.0) / Gs_max
c1 = CGCircle(g1, S11, 361)
SmithChart.StabilityCircle
— FunctionStabilityCircle(S11, S12, S21, S22, inout::Symbol, Np; stable = false)
Computes the region of stability (or unstability) and returns a Makie.Polygon.
Arguments
- Sii: S-parameter
- inout: a symbol selecting source or load regions. Valid values are :load or :source.
- Np: Number of points.
- stable: Selects if the region corresponds to the stable (true) or unstable (false) region.
Examples
using SmithChart
S11, S12, S21, S22 = [0.438868-0.778865im 1.4+0.2im; 0.1+0.43im 0.692125-0.361834im]
A = StabilityCircle(S11, S12, S21, S22, :source, 361; stable = false)