| 1 |
{ |
| 2 |
"cells": [ |
| 3 |
{ |
| 4 |
"cell_type": "markdown", |
| 5 |
"metadata": {}, |
| 6 |
"source": [ |
| 7 |
"# Renormalizing S-parameters " |
| 8 |
] |
| 9 |
}, |
| 10 |
{ |
| 11 |
"cell_type": "markdown", |
| 12 |
"metadata": {}, |
| 13 |
"source": [ |
| 14 |
"This example demonstrates how to use skrf to renormalize a Network's s-parameters to new port impedances. Although trivial, this example creates a matched load in 50ohms and then re-normalizes to a 25ohm environment, producing a reflection coefficient of 1/3." |
| 15 |
] |
| 16 |
}, |
| 17 |
{ |
| 18 |
"cell_type": "markdown", |
| 19 |
"metadata": {}, |
| 20 |
"source": [ |
| 21 |
"## Ok lets do it" |
| 22 |
] |
| 23 |
}, |
| 24 |
{ |
| 25 |
"cell_type": "code", |
| 26 |
"execution_count": null, |
| 27 |
"metadata": {}, |
| 28 |
"outputs": [], |
| 29 |
"source": [ |
| 30 |
"import skrf as rf\n", |
| 31 |
"\n", |
| 32 |
"%matplotlib inline\n", |
| 33 |
"\n", |
| 34 |
"rf.stylely()\n", |
| 35 |
"\n", |
| 36 |
"# this is just for plotting junk\n", |
| 37 |
"kw = dict(draw_labels=True, marker = 'o', markersize = 10)" |
| 38 |
] |
| 39 |
}, |
| 40 |
{ |
| 41 |
"cell_type": "markdown", |
| 42 |
"metadata": {}, |
| 43 |
"source": [ |
| 44 |
"Create a one-port ideal match Network, (using the premade media class wr10 as a dummy)" |
| 45 |
] |
| 46 |
}, |
| 47 |
{ |
| 48 |
"cell_type": "code", |
| 49 |
"execution_count": null, |
| 50 |
"metadata": {}, |
| 51 |
"outputs": [], |
| 52 |
"source": [ |
| 53 |
"match_at_50 = rf.wr10.match()" |
| 54 |
] |
| 55 |
}, |
| 56 |
{ |
| 57 |
"cell_type": "markdown", |
| 58 |
"metadata": {}, |
| 59 |
"source": [ |
| 60 |
"Note that the z0 for this Network defaults to a constant 50ohm" |
| 61 |
] |
| 62 |
}, |
| 63 |
{ |
| 64 |
"cell_type": "code", |
| 65 |
"execution_count": null, |
| 66 |
"metadata": {}, |
| 67 |
"outputs": [], |
| 68 |
"source": [ |
| 69 |
"match_at_50" |
| 70 |
] |
| 71 |
}, |
| 72 |
{ |
| 73 |
"cell_type": "markdown", |
| 74 |
"metadata": {}, |
| 75 |
"source": [ |
| 76 |
"Plotting its reflection coefficient on the smith chart, shows its a match" |
| 77 |
] |
| 78 |
}, |
| 79 |
{ |
| 80 |
"cell_type": "code", |
| 81 |
"execution_count": null, |
| 82 |
"metadata": {}, |
| 83 |
"outputs": [], |
| 84 |
"source": [ |
| 85 |
"match_at_50.plot_s_smith(**kw)" |
| 86 |
] |
| 87 |
}, |
| 88 |
{ |
| 89 |
"cell_type": "markdown", |
| 90 |
"metadata": {}, |
| 91 |
"source": [ |
| 92 |
"Now, renormalize the port impedance from 50 -> 25, thus the previous 50ohm load now produces a reflection coefficient of \n", |
| 93 |
"\n", |
| 94 |
"\n", |
| 95 |
"$$ \\Gamma^{'} = \\frac{50-25}{50+25} = \\frac{25}{75} = .333 $$\n", |
| 96 |
"\n", |
| 97 |
"\n", |
| 98 |
"Plotting the renormalized response on the Smith Chart" |
| 99 |
] |
| 100 |
}, |
| 101 |
{ |
| 102 |
"cell_type": "code", |
| 103 |
"execution_count": null, |
| 104 |
"metadata": {}, |
| 105 |
"outputs": [], |
| 106 |
"source": [ |
| 107 |
"match_at_50.renormalize(25)\n", |
| 108 |
"match_at_50.plot_s_smith(**kw)" |
| 109 |
] |
| 110 |
}, |
| 111 |
{ |
| 112 |
"cell_type": "markdown", |
| 113 |
"metadata": {}, |
| 114 |
"source": [ |
| 115 |
"## Complex Impedances " |
| 116 |
] |
| 117 |
}, |
| 118 |
{ |
| 119 |
"cell_type": "markdown", |
| 120 |
"metadata": {}, |
| 121 |
"source": [ |
| 122 |
"You could also renormalize to a complex port impedance if you're crazy. For example, renormalizing to 50j, one would expect:\n", |
| 123 |
"$$\n", |
| 124 |
"\\Gamma^{'} = \\frac{50-50j}{50+50j} = 50\\frac{1-j}{1+j} = -50j\n", |
| 125 |
"$$\n", |
| 126 |
"\n", |
| 127 |
"However, one finds an unexpected result when plotting the Smith chart:" |
| 128 |
] |
| 129 |
}, |
| 130 |
{ |
| 131 |
"cell_type": "code", |
| 132 |
"execution_count": null, |
| 133 |
"metadata": {}, |
| 134 |
"outputs": [], |
| 135 |
"source": [ |
| 136 |
"match_at_50 = rf.wr10.match()\n", |
| 137 |
"match_at_50.renormalize(50j) # same as renormalize(50j, s_def='power')\n", |
| 138 |
"match_at_50.plot_s_smith(**kw) # expect -1j" |
| 139 |
] |
| 140 |
}, |
| 141 |
{ |
| 142 |
"cell_type": "markdown", |
| 143 |
"metadata": {}, |
| 144 |
"source": [ |
| 145 |
"This is because the default behaviour of scikit-rf is to use _power-waves_ scattering parameter definition (since it is the most popular one is CAD software). But the _power-waves_ definition is [known to fail in such a case](https://www.nist.gov/system/files/documents/2017/05/09/MicrowaveCircuitTheory-proof.pdf). This is why scikit-rf also implement the _pseudo-waves_ scattering parameters definition, but you have to specify it using the `s_def` parameter: " |
| 146 |
] |
| 147 |
}, |
| 148 |
{ |
| 149 |
"cell_type": "code", |
| 150 |
"execution_count": null, |
| 151 |
"metadata": {}, |
| 152 |
"outputs": [], |
| 153 |
"source": [ |
| 154 |
"match_at_50 = rf.wr10.match()\n", |
| 155 |
"match_at_50.renormalize(50j, s_def='pseudo')\n", |
| 156 |
"match_at_50.plot_s_smith(**kw) # expect -1j" |
| 157 |
] |
| 158 |
}, |
| 159 |
{ |
| 160 |
"cell_type": "markdown", |
| 161 |
"metadata": {}, |
| 162 |
"source": [ |
| 163 |
"Which gives the expected result. " |
| 164 |
] |
| 165 |
} |
| 166 |
], |
| 167 |
"metadata": { |
| 168 |
"anaconda-cloud": {}, |
| 169 |
"kernelspec": { |
| 170 |
"display_name": "Python 3", |
| 171 |
"language": "python", |
| 172 |
"name": "python3" |
| 173 |
}, |
| 174 |
"language_info": { |
| 175 |
"codemirror_mode": { |
| 176 |
"name": "ipython", |
| 177 |
"version": 3 |
| 178 |
}, |
| 179 |
"file_extension": ".py", |
| 180 |
"mimetype": "text/x-python", |
| 181 |
"name": "python", |
| 182 |
"nbconvert_exporter": "python", |
| 183 |
"pygments_lexer": "ipython3", |
| 184 |
"version": "3.8.10" |
| 185 |
} |
| 186 |
}, |
| 187 |
"nbformat": 4, |
| 188 |
"nbformat_minor": 1 |
| 189 |
} |