You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-184Lines changed: 3 additions & 184 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ This project originated as an exploration of the interactive possibilities that
7
7
8
8
**Note**: Some of the features are experimental. They might not function fully as expected or could be subject to changes in future versions.
9
9
10
+
Some examples are shown below. For more information and other examples, visit the documentation.
11
+
10
12
## Usage
11
13
12
14
```julia
@@ -39,7 +41,6 @@ fig
39
41
40
42

41
43
42
-
43
44
## Integration with Makie
44
45
45
46
This example showcases the seamless integration of the Smith chart with Makie.jl's interactive functionalities. It demonstrates a typical scenario used to teach impedance matching, where we aim to transform a source impedance of 50+100j $\Omega$ to a load impedance of 50 $\Omega$. To achieve this, we utilize a transmission line and a parallel stub, and control their lengths via sliders. By dynamically adjusting these lengths, users can observe how the source impedance seen by the load evolves on the Smith chart, visually illustrating the impedance matching process.
@@ -91,190 +92,8 @@ fig
91
92
92
93

93
94
94
-
## Plot Reflection Coefficientes
95
-
96
-
You can also draw reflection data with the `reflection = true` keyword. This is useful, for example, when you want to visualize the S-parameters of a simulation or measurement.
Interactive data markers can be added to your Smith chart using the `datamarkers(sc::SmithAxis, gp::GridPosition)` function. Double-click on lines or scatter plots to place a marker. To remove a marker, double-click on it. It is possible to move the marker by dragging it with the left click.
122
98
123
-

124
-
125
-
126
-
## Stability, Gain and Noise Circles
127
-
128
-
SmithChart.jl allows visualization of constant gain circles, constant noise circles, and stability regions, essential for amplifier design and stability analysis. These features can be useful for tasks such as designing low-noise amplifiers (LNAs), power amplifiers, and ensuring the stability of circuits over a range of frequencies and impedances.
129
-
130
-
This example shows how to use the `NFCircle` and `CGCircle`. This functions returns an array of `Point2f` that can be used with Makie functions like `lines!` or `poly!`.
131
-
132
-
```julia
133
-
using CairoMakie
134
-
f =Figure(size = (1200, 660))
135
-
sc =SmithAxis(f[1,1], cutgrid =true, title ="Constant NF Circles")
sc =SmithAxis(f[1,2], cutgrid =true, title ="Constant Gs Circles")
163
-
164
-
S11 =0.533*cis(176.6/180* π)
165
-
S22 =0.604*cis(-58.0/180* π)
166
-
Go =abs2(S11)
167
-
Gs_max =1/ (1-abs2(S11))
168
-
gain(dB) =10.0^(dB/10.0)
169
-
170
-
g1 =gain(0.0) / Gs_max
171
-
g2 =gain(0.5) / Gs_max
172
-
g3 =gain(1.0) / Gs_max
173
-
g4 =gain(1.4) / Gs_max
174
-
175
-
c1 =CGCircle(g1, S11, 361)
176
-
c2 =CGCircle(g2, S11, 361)
177
-
c3 =CGCircle(g3, S11, 361)
178
-
c4 =CGCircle(g4, S11, 361)
179
-
180
-
smithscatter!(sc, [conj(S11)], reflection =true, color =:blue, linewidth =1.9)
181
-
text!(sc, "S11*", position =Point2f(real(S11), -imag(S11)),
182
-
offset = (-5, 7), color =:blue, font =:bold, fontsize =9)
183
-
184
-
poly!(sc, c1, color = (:green, 0.1), strokecolor =:green, strokewidth =1.9)
185
-
text!(sc, "0.0 dB", position = c1[125], offset = (17, 0), color =:green, font =:bold)
186
-
187
-
lines!(sc, c2, color =:red, linewidth =1.9)
188
-
text!(sc, "0.5 dB", position = c2[110], offset = (-27, 3), color =:red, font =:bold)
189
-
190
-
lines!(sc, c3, color =:magenta, linewidth =1.9)
191
-
text!(sc, "1.0 dB", position = c3[260], offset = (2, 0), color =:magenta, font =:bold)
192
-
193
-
lines!(sc, c4, color =:purple, linewidth =1.9)
194
-
text!(sc, "1.4 dB", position = c3[45], offset = (2, 2), color =:purple, font =:bold)
195
-
```
196
-
197
-

198
-
199
-
When calculating the stability regions, you can select whether you want to display the stable or unstable region. To do this, modify the keyword `stable` in the `StabilityCircle` function.
200
-
201
-
```julia
202
-
using CairoMakie
203
-
f =Figure(size = (800, 500))
204
-
Label(f[0, 1:2] , "Stable Regions", fontsize =24, font =:bold)
region =poly!(ax, B, strokecolor =:black, strokewidth =1.2, color =Pattern('\\', linecolor =:blue, width =1.3, background_color = (:blue, 0.1)))
216
-
translate!(region, (0, 0, -2))
217
-
text!(ax, "Stable Input", position =Point2f(0.1, 0.15), font =:bold, color =:blue, fontsize =15)
218
-
```
219
-

220
-
221
-
It is possible to obtain the input or output stability regions with `StabilityCircle(S11, S12, S21, S22, :source, npoints)` or `StabilityCircle(S11, S12, S21, S22, :load, npoints)`.
Change type and control color of the grid or subgrid. The keywords `zgridcolor` and `ygridcolor` allow controlling both axes with a single keyword. Each of them takes precedence over their respective individual grid color settings (`rgridcolor` and `xgridcolor` for the Z-axis, and `bgridcolor` and `ggridcolor` for the Y-axis).
0 commit comments