== Understanding RF Circuit Analysis as an Analog Simulation ==
[[File:RFSpice_Screen.png|thumb|450px|]]
You can use [[RF.Spice A/D]] to simulate or design distributed analog and mixed-mode circuits at high frequencies. RF circuit analysis, by nature, is an AC analysis that you typically run at high frequencies ranging from tens of Megahertz to tens of Gigahertz. At such high frequencies, the dimensions of your circuit may become comparable in order of magnitude to the wavelength, when wave retardation effects start to appear. In other words, your circuit starts to act like a distributed structure rather than a lumped circuit where signals propagate instantaneously. In the analysis of a low frequency circuit, two nodes that are connected to each other through a wire are assumed to have equal potentials or identical voltages. In RF circuits, however, parts and devices are connected to one another using transmission line segments, which introduce additional phase shifts depending on their electrical lengths and may also alter the voltages and currents at different points of the circuit due to impedance mismatch.
<table>
<tr>
<td>
[[File:RFSpice_Screen.png|thumb|left|720px|RF simulation in RF.Spice A/D.]]
</td>
</tr>
</table>
[[RF.Spice A/D]] uses the same Berkeley SPICE and XSPICE simulation engines of its forerunner B2.Spice A/D. In other words, the high frequency AC analysis is carried out by the same analog and mixed-mode SPICE simulation engines based on nodal admittance analysis, which have been enhanced with additional RF simulation capabilities. As a result, you can mix the RF devices in your circuits with all the other analog and mixed-mode devices. You can also mix transmission-line-type RF devices with digital parts and perform mixed-mode time domain simulations.
<tr>
<td>
[[File:twoport1.png|thumb|400pxleft|480px| Cascading two two-port network devices.]]
</td>
</tr>
<tr>
<td>
[[File:twoport2.png|thumb|400pxleft|550px| The property dialog of a multiport network device.]]
</td>
</tr>
<tr>
<td>
[[File:twoport3.png|thumb|400pxleft|550px| The property dialog of the Complex Impedance device.]]
</td>
</tr>
</table>
== List of Standard Imported RF Devices ==
{| class="wikitable"
|-
! Device Type !! Symbol Name !! Model Type !! Schematic Symbol
|-
| RF Capacitor || capacitor || one-port || [[File:G6a.png]]
|-
| RF Inductor || inductor || one-port || [[File:G7a.png]]
|-
| RF Diode || diode || one-port || [[File:G9.png]]
|-
| RF BJT || bjt_npn_2port <br /> bjt_pnp_2port || two-port || [[File:G11A.png]]
|-
| RF JFET || jfet_n <br /> jfet_p || two-port || [[File:G12.png]]
|-
| RF MOSFET || mosfet_n <br /> mosfet_p || two-port || [[File:G13a.png]]
|-
| RF MESFET || mesfet_n <br /> mesfet_p || two-port || [[File:G14.png]]
|-
| One-Port|| one-port || one-port || [[File:G60.png]]
|-
| Two-Port|| two-port || two-port || [[File:G61.png]]
|-
| Three-Port|| three-port || three-port || [[File:G62.png]]
|-
| Four-Port|| four-port || four-port || [[File:G63.png]]
|-
| Open End || open_end || one-port || [[File:G64.png]]
|-
| Bend || bend_junction || two-port || [[File:G65.png]]
|-
| Step Junction || step_junction || two-port || [[File:G66.png]]
|-
| Tee Junction || tee_junction || three-port || [[File:G67.png]]
|-
| Cross Junction || cross_junction || four-port || [[File:G68.png]]
|-
|}
== Generic Transmission Lines ==
=== The Generic T-Line ===
[[File:tline.png|thumb|300px| The schematic symbol of the Generic T-Line device.]]
[[RF.Spice A/D]] offers a passive device called Generic T-line with the keyboard shortcut “T”, which is a general purpose frequency-domain transmission line segment model. It is based on the native SPICE LTRA model, but with the following parameters:
The default parameters of the Generic T-Line are Z0 = 50 Ohms, eeff = 1, alpha = 0, and len = 10mm. A unit effective permittivity implies a TEM transmission line because √ε<sub>eff</sub> = β / k<sub>0</sub>, where β is the propagation constant of the transmission line and k<sub>0</sub> = 2πf/c is the free space propagation constant, with f being the frequency in Hertz and c = 3e8 m/s being the speed of light. A zero attenuation constant represents a lossless transmission line. The Generic T-Line device is indeed a two-port network with a 2×2 scattering matrix or four S-parameters: s11, s21, s12 and s22. Obviously, this is a reciprocal and symmetric network, i.e., s11 = s22, and s21 = s12.
<table>
<tr>
<td>
[[File:tline.png|thumb|left|360px| The schematic symbol of the Generic T-Line device.]]
</td>
</tr>
</table>
Note that N-port networks in [[RF.Spice A/D]] have schematic symbols with 2N pins. Each pair of pins represents a port. In a similar way, the generic T-line has two ports and four pins. The pins are marked with plus and minus signs. For example, in the figure above, the pins P1+ and P1- together form Port 1. Normally, the negative pins are grounded, and the positive pins are connected to the other parts of the circuit.
<tr>
<td>
[[File:tline2.png|thumb|400pxleft|480px| The schematic symbols of the Generic Open Stub (left) and Generic Short Stub (right) devices.]]
</td>
</tr>
<tr>
<td>
[[File:tline4.png|thumb|480pxleft|720px| The schematic symbols of the Generic T-Line Discontinuity devices: (a) Open End, (b) Bend, (c) Step Junction, (d) Tee Junction and (e) Cross Junction.]]
</td>
</tr>
The physical transmission line types are characterized by their physical dimensions and material properties.
[[Image:Info_icon.png|40px]] Click here to see a '''[[List of Physical Transmission Line Types]]'''.
[[File:tline6.png|thumb|350px| Microstrip Line Calculator.]]
=== Physical Line Calculators and Designers ===
When you place a generic T-line part in your circuit, you have to specify its characteristic impedance (Z0), effective permittivity (eeff) and attenuation constant (alpha). In the case of physical transmission line parts like mircostrip, coaxial line or CPW, you specify the physical parameters of the line such as various dimensions and material properties. [[RF.Spice A/D]] then automatically calculates the necessary transmission line parameters at the time of simulation based on your physical data.
<table>
<tr>
<td>
[[File:tline6.png|thumb|left|480px| Microstrip Line Calculator.]]
</td>
</tr>
</table>
For every physical transmission line type listed above, the '''Device Manager''' of [[RF.Spice A/D]] provides a corresponding '''Line Calculator'''. The line calculators are accessible form the '''Tools Menu''' of the Device Manager. The line calculators take the substrate properties and the physical dimensions of a line types and calculate its characteristic impedance (Z0) and effective permittivity (eeff). The Line Calculator dialog also has an "Operational Frequency" input with a default frequency of 1GHz, which is used to calculate the guide wavelength of the transmission line at that frequency. In many practical applications, you need quarter-wavelength line segments. In that case, you must first calculate the guide wavelength of the transmission line as defined by λ<sub>g</sub> = λ<sub>0</sub> / √ε<sub>eff</sub>, where λ<sub>0</sub> = c/f is the free space wavelength at the operational frequency.
<tr>
<td>
[[File:tline10.png|thumb|350pxleft|480px| CPW Line Calculator.]]
</td>
</tr>
<tr>
<td>
[[File:tline12.png|thumb|350pxlrft|480px| Coaxial Line Calculator.]]
</td>
</tr>
</table>
[[File:tline7.png|thumb|350px| Microstrip Line Designer.]]
You often need to design a 50Ω transmission line of a certain type. [[RF.Spice A/D]] provides ten physical transmission line design tools for:
* Twin-Lead Line
* Twisted-Pair Line
<table>
<tr>
<td>
[[File:tline7.png|thumb|left|480px| Microstrip Line Designer.]]
</td>
</tr>
</table>
The above line designers ignore the conductor and dielectric losses and calculate the physical dimensions of the line for a given value of the characteristic impedance Z0. For example, given a substrate with thickness h and relative permittivity ε<sub>r</sub>, the "Microstrip Designer" calculates the microstrip width in mm for a given value of Z0 (50 Ohms by default). Some line type like CPW and coaxial line have more than one dimensional parameter that can be varied. For example, CPW has slot width (w) and center strip width (s), while coaxial line has inner and outer conductor radii. In such cases, the line designer dialog provides radio button options to fix one parameter and vary the other.
<tr>
<td>
[[File:tline11.png|thumb|350pxleft|480px| CPW Line Designer.]]
</td>
</tr>
<tr>
<td>
[[File:tline13.png|thumb|350pxleft|480px| Coaxial Line Designer.]]
</td>
</tr>
<tr>
<td>
[[File:tline5.png|thumb|480pxleft|720px| The schematic symbols of the some Physical Transmission Line Discontinuity devices. (Top Row) microstrip components: right-angled bend, mitered bend, tee and cross junctions, (Bottom Row) CPW components: open end, short end, gap and step junction.]]
</td>
</tr>
== Working with Coupled Transmission Line Devices ==
[[File:tline3.png|thumb|300px| The schematic symbol of the Generic Coupled T-Lines device.]]
Many passive RF devices such as directional couplers, hybrids and some filter designs involve segments of parallel coupled transmission lines. According to the coupled mode theory, one can define even and odd mode impedances (Z0e and Z0o) for such transmission lines. The resulting RF structure can be modeled as a four-port network device as shown in the opposite figure. Note that the four-port device has eight pins. Ports 1 and 2 correspond to the input and output of the first transmission line segment, while Ports 3 and 4 correspond to the input and output of the second (coupled) line segment. It is very important to connect and ground the negative pins at the input and output of the two transmission line segments.
<table>
<tr>
<td>
[[File:tline3.png|thumb|left|300px| The schematic symbol of the Generic Coupled T-Lines device.]]
</td>
</tr>
</table>
[[RF.Spice A/D]] provides three coupled line devices, all of which assumes lossless transmission lines:
<tr>
<td>
[[File:tline8.png|thumb|320pxleft|480px| Coupled Microstrips Calculator.]]
</td>
</tr>
<tr>
<td>
[[File:tline14tline9.png|thumb|320pxleft|480px| Coupled Striplines CalculatorMicrostrips Designer.]]
</td>
</tr>
<tr>
<td>
[[File:tline9tline14.png|thumb|320pxleft|480px| Coupled Microstrips DesignerStriplines Calculator.]]
</td>
</tr>
<tr>
<td>
[[File:tline15.png|thumb|320pxleft|480px| Coupled Striplines Designer.]]
</td>
</tr>
</table>
== List of Standard Imported RF Devices ==
{| class="wikitable"
|-
! Device Type !! Symbol Name !! Model Type !! Schematic Symbol
|-
| RF Capacitor || capacitor || one-port || [[File:G6a.png]]
|-
| RF Inductor || inductor || one-port || [[File:G7a.png]]
|-
| RF Diode || diode || one-port || [[File:G9.png]]
|-
| RF BJT || bjt_npn_2port <br /> bjt_pnp_2port || two-port || [[File:G11A.png]]
|-
| RF JFET || jfet_n <br /> jfet_p || two-port || [[File:G12.png]]
|-
| RF MOSFET || mosfet_n <br /> mosfet_p || two-port || [[File:G13a.png]]
|-
| RF MESFET || mesfet_n <br /> mesfet_p || two-port || [[File:G14.png]]
|-
| One-Port|| one-port || one-port || [[File:G60.png]]
|-
| Two-Port|| two-port || two-port || [[File:G61.png]]
|-
| Three-Port|| three-port || three-port || [[File:G62.png]]
|-
| Four-Port|| four-port || four-port || [[File:G63.png]]
|-
| Open End || open_end || one-port || [[File:G64.png]]
|-
| Bend || bend_junction || two-port || [[File:G65.png]]
|-
| Step Junction || step_junction || two-port || [[File:G66.png]]
|-
| Tee Junction || tee_junction || three-port || [[File:G67.png]]
|-
| Cross Junction || cross_junction || four-port || [[File:G68.png]]
|-
|}
<p> </p>