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
Fix some bugs, merge splitminor and splitgrid, use tooltip boundingbox for deleting markers, save markers data on a dictionary. Add Constant gain and constant noise circles. Add Stability regions.
Copy file name to clipboardExpand all lines: README.md
+120-3Lines changed: 120 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,6 +124,125 @@ Interactive data markers can be added to your Smith chart using the `datamarkers
124
124
125
125

126
126
127
+
128
+
## Stability, Gain and Noise Circles
129
+
130
+
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.
131
+
132
+
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!`.
133
+
134
+
```julia
135
+
using CairoMakie
136
+
f =Figure(size = (1200, 660))
137
+
sc =SmithAxis(f[1,1], cutgrid =true, title ="Constant NF Circles")
sc =SmithAxis(f[1,2], cutgrid =true, title ="Constant Gs Circles")
165
+
166
+
S11 =0.533*cis(176.6/180* π)
167
+
S22 =0.604*cis(-58.0/180* π)
168
+
Go =abs2(S11)
169
+
Gs_max =1/ (1-abs2(S11))
170
+
gain(dB) =10.0^(dB/10.0)
171
+
172
+
g1 =gain(0.0) / Gs_max
173
+
g2 =gain(0.5) / Gs_max
174
+
g3 =gain(1.0) / Gs_max
175
+
g4 =gain(1.4) / Gs_max
176
+
177
+
c1 =CGCircle(g1, S11, 361)
178
+
c2 =CGCircle(g2, S11, 361)
179
+
c3 =CGCircle(g3, S11, 361)
180
+
c4 =CGCircle(g4, S11, 361)
181
+
182
+
smithscatter!(sc, [conj(S11)], reflection =true, color =:blue, linewidth =1.9)
183
+
text!(sc, "S11*", position =Point2f(real(S11), -imag(S11)),
184
+
offset = (-5, 7), color =:blue, font =:bold, fontsize =9)
185
+
186
+
poly!(sc, c1, color = (:green, 0.1), strokecolor =:green, strokewidth =1.9)
187
+
text!(sc, "0.0 dB", position = c1[125], offset = (17, 0), color =:green, font =:bold)
188
+
189
+
lines!(sc, c2, color =:red, linewidth =1.9)
190
+
text!(sc, "0.5 dB", position = c2[110], offset = (-27, 3), color =:red, font =:bold)
191
+
192
+
lines!(sc, c3, color =:magenta, linewidth =1.9)
193
+
text!(sc, "1.0 dB", position = c3[260], offset = (2, 0), color =:magenta, font =:bold)
194
+
195
+
lines!(sc, c4, color =:purple, linewidth =1.9)
196
+
text!(sc, "1.4 dB", position = c3[45], offset = (2, 2), color =:purple, font =:bold)
197
+
```
198
+
199
+

200
+
201
+
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.
202
+
203
+
```julia
204
+
using CairoMakie
205
+
f =Figure(size = (800, 500))
206
+
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)))
218
+
translate!(region, (0, 0, -2))
219
+
text!(ax, "Stable Input region", position =Point2f(-0.5, -0.5), font =:bold, color =:blue, fontsize =13)
220
+
```
221
+

222
+
223
+
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)`.
How some keywords modify visual aspects of the Smith Chart.
@@ -159,6 +276,6 @@ There are multiple keywords to modify the position of the ticks. Some of them ar
159
276
160
277
### Subgrid split
161
278
162
-
The `splitminor` keyword controls the number of cuts of a space between ticks when there is no zoom. See also `splitgrid` to control the number of cuts while zooming.
279
+
The `splitgrid` keyword controls the number of cuts for each zoomlevel. The value should be a
0 commit comments