The transient analysis generates the circuit's behavior as a function of time from t<sub>start</sub> to t<sub>stop</sub> at increments equal to t<sub>step</sub>. The maximum interval between time steps, t<sub>max</sub> or "Step Ceiling", is critical to prevent the simulation from generating incorrect results. If t<sub>max</sub> is too large, then sharp changes in the circuit's voltages may be overlooked by the simulator. [[B2.Spice A/D]] gives you the option to linearize your time-domain simulation results, which will generate a second transient graph, with results linearly interpolated at an interval of t<sub>step</sub>. The Transient Test is similar to the default "Live Simulation", but the time span is rather finite and it is defined and confined by you. Moreover, the simulation results are displayed in a graph instead of [[Virtual Instruments|virtual instruments]].
Â
The default results of a transient test consist of plots of the voltage across each voltmeter in the circuit and the current through each ammeter as a function of time. You can customize the results by choosing any node voltage or device current using "Preset Graph Plots" and "Preset Table Plots". To learn how you can define output voltages or currents anywhere in your circuit, refer to the section on [[B2_output#Setting_Up_Circuit_Observables | Setting Up Circuit Observables]]. You may also place a voltage probe or a current probe in your circuit to plot its signal as a function of time. To learn more about probes, see the section on [[B2_output#Using_Probes_or_Meters_as_Observables | Using Probes or Meters as Observables]].
Â
Sometimes the SPICE engine has trouble converging on solutions in a transient analysis. If this happens, increasing capacitances and internal transistor capacitances specified in the transistor models can sometimes relax the circuit enough to help convergence. Also, increasing the value of the "ITL4" parameter in the [[Simulation Options]] dialog from its default of 10 to around 40 can sometimes help the solution's convergence. The ITL4 parameter specifies the maximum number of iterations in a transient simulation.
Â
As an example, the figure below shows an Op-Amp circuit (inverting amplifier) with a capacitive load. The graph next to it shows the time-domain input and output voltages of the Op-Amp circuit.
</tr>
</table>
Â
===Fourier Analysis of Time-Domain Simulation Data===
At the end of a DC Bias Test, B2.Spice displays the voltages across voltmeters and the currents through ammeters. The results also appear in tabulated format in a table window at the bottom of your screen. If you enable B2.Spice's Circuit [[Animation]] feature, the node voltages and wire currents will be displayed as text or graphically as wire colors on the schematic.
Â
<table>
<tr>
Â
<td> [[File:b2MAN_Fig46.png|thumb|200px|DC Bias Test Settings.]]
</td>
<td> [[File:b2MAN_Fig50.png|thumb|200px|DC Sensitivity Test Settings.]]
</td>
Â
</tr>
</table>
Â
===DC Sweep Test ===
The default results of a DC sweep test consist of plots of the voltage across each voltmeter and the current through each ammeter in the circuit. You can customize the results by choosing any node voltage or device current using "Preset Graph Plots" and "Preset Table Plots". To learn how you can define output voltages or currents anywhere in your circuit, refer to the section on [[B2_output#Setting_Up_Circuit_Observables | Setting Up Circuit Observables]]. You may also place a voltage probe or a current probe in your circuit to plot its signal as a function of the sweep variable. To learn more about probes, see the section on [[B2_output#Using_Probes_or_Meters_as_Observables | Using Probes or Meters as Observables]].
Â
===Generating Characteristic v-i Curves for Active Devices===
The most obvious sweep variable for a DC sweep test is the strength of your source, which can be either the input voltage or input current. This type of analysis is often used to generate the characteristic v-i curves of an active device like a BJT or MOSFET. To make life a little bit easier, [[B2.Spice A/D]] provides eleven template projects for the most commonly used active devices including diodes and transistors. These template project files are located in the "[[Tests]]" folder in your B2.Spice [[installation]] directory:
Â
{| class="wikitable"
|-
|}
Â
You can readily open any of these projects by going to the [[Schematic Editor]]'s File Menu and choosing Open > Open Curve Tracer Test Circuit... The standard [[Windows]] Open dialog opens up in the "[[Tests]] Folder", and you can select and open any of the above eleven test circuits. By default, each test circuit uses a generic active device type. You can easily replace the default generic type with any other model from any manufacturer. Simply select the active device part, go to [[Schematic Editor]]'s Edit Menu and choose "Edit Part, Device or Model > Select Alternate Model..." This opens up the "Select Model Dialog", where you can search for your new device to the replace the default one.
</tr>
</table>
Â
[[File:b2MAN_Fig231.png|thumb|200px|The output of a DC Sensitivity Test.]]
This test shows the operating point details for each of the primitive devices in your circuit. [[B2.Spice A/D]] displays the results for all the devices in the circuit in a table window.
Â
===Model Output Parameters Test===
All the sources with non-zero AC values are treated as sinusoidal sources with the specified peak voltage/current amplitudes and phases and default zero offsets. You can view or edit the AC values of voltage and current sources by double clicking on the parts and selecting the "Small-Signal AC and Distortion" tab of their property dialog. Make sure to check the "Use" checkbox in the section titled "AC Properties for Small-Signal AC Properties only". Given the specified voltage and current source values, the DC operating point of your circuit is calculated, and all nonlinear elements are replaced with their small-signal circuit models. If the DC operating point of your circuit with the sources shorted out is not where you want it, you may have to place some constant (DC) voltage sources in the circuit to compensate. Alternatively, you can set a nonzero value for the "Small-Signal Offset" parameter of an AC source as shown in the figure below.
Â
Like the DC analysis, you must specify the [[parameters]] of the AC Sweep Test before you can execute it. The Start frequency and Stop frequency specify the range of frequencies for the analysis. The analysis starts at start frequency, stops at stop frequency, and takes place at a number of frequency samples in between. There are three Interval Types: Linear, Decade and Octave. The default scale is "Decade". In a linear scale, you have to specify the "Step Size", which determines the frequency increment. Starting from the Start Frequency, the frequency of the AC source is consecutively incremented by the Step Size until it exceeds the Stop Frequency and the sweep process is terminated. In the case of Decade or Octave interval types, you need to specify the Number of Steps per Interval. A decade is a range from one power of 10 to the next, for example, from 100 to 1000. The points in this case are equally spaced on a log scale. An octave I a range form one power of 2 to the next, for example, from 1 to 2 or from 2 to 4. To actually run the AC analysis, you must click the Run button in the Test Setup for the type of test (Single, Sweep, or Monte Carlo) after specifying the AC Sweep options as described above.
Â
The default results of an AC frequency sweep test consist of plots of the magnitude and phase of the voltage across each voltmeter in the circuit and the magnitude and phase of the current through each ammeter as a function of frequency. The magnitude can be displayed in either decibels or simply magnitude (on a linear scale). A decibel is 20*log10(abs(x)), where x is a real or complex value. For instance, 1000 corresponds to 60 decibels (db), 100 corresponds to 40 db, and 0.1 corresponds to -20db. You can customize the results by choosing any node voltage or device current using "Preset Graph Plots" and "Preset Table Plots". To learn how you can define output voltages or currents anywhere in your circuit, refer to the section on [[B2_output#Setting_Up_Circuit_Observables | Setting Up Circuit Observables]]. You may also place three types of AC voltage probe: voltage probe (dB), voltage probe (Mag) and voltage probe (Ph-Deg), or three types of AC current probe: current probe (dB), current probe (Mag) and current probe (Ph-Deg) in your circuit to plot their signal as a function of frequency. To learn more about probes, see the section on [[B2_output#Using_Probes_or_Meters_as_Observables | Using Probes or Meters as Observables]]. The default scale used for the plotted graphs at the end of an AC frequency sweep test is base-10-log along the x-axis. If you prefer a linearly scaled frequency axis, change the "Bottom Axis" settings of the graph using the "Edit Axes" tab of the Toolbox in the graph view.
Â
<table>
</tr>
</table>
Â
[[File:b2MAN_Fig52.png|thumb|200px|AC Sensitivity Settings.]]
The AC Sensitivity Test calculates the small-signal sensitivity of an output port to all device values and model [[parameters]] over a range of frequencies. The output port for sensitivity calculation is specified by a pair of positive and negative (reference) nodes. You can also prespecify whether the plots use decibels or magnitude, or degrees or radians.
Â
===Distortion Test===
{{Note | In a two-frequency distortion analysis, make sure to set f1 > f2.}}
Â
Preparation for a distortion test involves three steps. The first step is similar to the AC Frequency Sweep Test, where you designate one or more AC sources for your circuit and set their AC amplitudes (and phases). Open up the property dialog of all the sources that provide the AC excitation of your circuit. Go to the "Small-Signal AC and Distortion" tab of the property dialog. There are two sections in this tab that pertain distortion analysis. They are titled "Distortion 1 for Distortion Analysis" and "Distortion 2 for Distortion Analysis". The former section is used for a single-frequency distortion test, while either section can be used in a two-frequency distortion analysis. Set the amplitude(s) and phase(s) of the AC signal source and make sure to check the "Use" checkbox in the first or both distortion sections. Phase should be specified in degrees. If phase is missing, it will default to zero.
The third and last step of preparation for a distortion test takes place in the Setup Dialog of the Test Panel. In a single-frequency distortion test, the frequency of the designated AC source is swept from the Start Frequency to the Stop Frequency on a linear, decade or octave scale. Similar to the AC Frequency Sweep test, depending on the scale (Interval Type) chosen, you have to set either the Frequency Step or Number of Steps per Interval. For a two-frequency distortion test, you must check the checkbox labeled "Use F2/F1" and then enter a value for the ratio. Note that this ratio must be between 0 and 1. In this case, the analysis considers the circuit with sinusoidal inputs at two different frequencies, F1 and F2. F1 is swept according to the SPICE's DISTO control line options in the input Netlist file. The frequency of the second source F2 is kept fixed at (F2/F1) times the Start Frequency. Each independent source in the circuit may have up to two sinusoidal inputs for distortion at F1 and F2 frequencies. The analysis provides results composed of all node voltages and branch currents at frequencies of F1, F2, F1+F2, F1-F2, and (2*F1)- F2.
{{Note | The main difference between B2.Spice's Distortion Test and its Distortion Meter virtual instrument is that the former is used to plot or tabulate the the second and third harmonic contents of a signal over a frequency range, while the latter plots the harmonic contents up to the fifth harmonic as well as the "Total Harmonic Distortion" at a single specified frequency in the form of a bar chart.}}
</tr>
</table>
Â
[[File:b2MAN_Fig232.png|thumb|470px|The output of a Small-Signal Transfer Function Test.]]
For the simple voltage divider circuit of Tutorial Lesson 1 consisting of two resistors R1 = 1k and R2 = 2k, the transfer function is requested with the output port set between node 2 to ground (across R2), and the voltage source set as the input port. The test results for this example are shown in the opposite figure. The input impedance seen through the voltage source is R1 + R2 = 3k. The output impedance seen from the output port is the parallel combination R1 || R2 = 666.67. The transfer function is V2/V1 = 0.667.
===Pole-Zero Test===
The Pole-Zero Test generates a list of small-signal poles and zeros of the transfer function of your circuit given the input and output nodes.
Specify the input and output ports by the Positive and Negative (Reference) node numbers. To define the transfer function, you have two options: voltage gain by choosing "(output voltage)/(input voltage)" or trans-impedance by choosing "(output voltage)/(input current)". You can instruct the program to compute "Poles Only", or "Zeros Only", or "Pole & Zero".
Â
The results of a Pole-Zero test is displayed as a table. As an example, consider the RLC circuit of Tutorial Lesson 2. Using the voltage gain definition for the transfer function, the Pole-Zero test reports two poles listed below:
As for the specific noise sources, they include the "shot" noise associated with the DC currents in semiconductor devices and the "thermal" noise associated with resistance. Semiconductors also display "flicker" (1/f) noise. However, due to the lack of a unified model, [[B2.Spice A/D]] handles this type of noise on a "case by case" basis. There are flicker noise [[parameters]] available for transistors in the list of model [[parameters]]. The program can also provide the noise gain associated with the 1/f source.
Â
The [[parameters]] of the noise test are specified using the setup dialog of the Test Panel. The input noise source can be either a voltage or current source, which you can select from the drop-down list labeled "Noise Source". The output port must be specified as a pair of node numbers, the "Output Node" and the Reference Node". The rest of the [[parameters]] specify the frequency interval over which the noise analysis will be performed. They are similar to an AC analysis. If you check the checkbox labeled "Include Noise Generator Contributions", then noise contributions of all the individual devices will be shown as well. If not checked, the input noise and output noise will be shown only.
Â
As an example, consider the RTL inverter circuit of Tutorial Lesson 3, which is shown here in the opposite figure. The voltage source Vs is designated as the input noise source. The output port is set at node 3, i.e. the collector of the bipolar junction transistor. The noise is calculated over the frequency range from 1kHz to 10MHz on a decade scale with 10 steps per interval. The figures below show the graph of the noise spectral density over the specified frequency ranges as well as the tabulated results of the noise analysis. The latter are the integrated noise results, representing the total input and output noises as a result of contributions from the discrete devices in the circuit (namely, the resistors and the BJT). The results shown below are the square root of what Berkeley SPICE generates. This is because Berkeley SPICE gives values that are proportional to the noise power rather than the noise voltage.
</tr>
</table>
Â
== Nodal Analysis of RF Circuits ==
The simplest RF circuit analysis type in [[RF.Spice]] is the "AC Frequency Sweep" Test. As mentioned earlier, this is identical to the AC frequency sweep test of [[B2.Spice A/D]]. The only difference here is that the frequency-domain models of [[Multiport Networks|multiport networks]] and transmission line segments or components are added to the analog or mixed-mode simulation of your circuit. Just as in [[B2.Spice A/D]], the AC Test is run from the Test Panel of the Toolbox.
Â
===Defining Sources and Loads===
{{Note | For AC-type RF circuit analysis, you can only use AC voltage or current sources with a single common frequency.}}
Â
In most RF circuits, the sources are modeled to have an internal source impedance typically denoted by Z<sub>s</sub>. This source impedance is usually real-valued and typically has a value of 50 Ohms. To model the source impedance, you can simply use a resistor in series with the AC voltage source or a resistor in parallel with the AC current source as shown in the opposite figure. If you need a complex-valued source impedance, you can use a "Complex Impedance" and connected it either in series or in parallel with the AC voltage or current source, respectively.
Â
[[File:RFAC2.png|thumb|400px| A simple RF circuit driven by a voltage source and with a resistive load.]]
Your load impedance can also be a combination of resistors, capacitors or inductors to model capacitive or inductive loading. Note that in that case you will have a complex-valued load impedance that varies with the operational frequency. In some other cases, you may prefer a user-defined "Complex Impedance" as your load, which cannot be simply modeled as a combination of RLC elements. A resonant antenna load is a good example of this case. The port characteristic data for the antenna structure can be generated by an electromagnetic simulator like [[EM.Cube]] and then imported to [[RF.Spice]]. If you have the input impedance values as a function of frequency, then you should define a complex impedance load. If you have the return loss (s11) data as a function of frequency (as is usually the case), then you can define a one-port as your load.
Â
[[File:RFAC3.png|thumb|600px| A more realistic version of the previous RF circuit including connecting transmission line segments.]]
You can use Generic T-Line segments or physical transmission line types to connect the various RF parts and devices in your circuit. The opposite figure shows the same simple RF circuit of the previous figure, but containing two T-line segments, one connecting the source to Port 1 of two-port N1 and the other connecting Port 2 of N1 to the resistive load. Note how the negative input and output pins of both T-line segments have been grounded. Lossless transmission line segments cause a phase shift of the propagating signal, while lossy [[Transmission Lines|transmission lines]] also cause additional signal attenuation.
Â
[[File:RFAC4.png|thumb|200px| Setting the parameters in the AC Frequency Sweep Test Panel.]]
Before you run an AC frequency sweep test of your RF circuit, you need to set the sweep [[parameters]] and define the output data for plotting or tabulation. The frequency sweep [[parameters]] are set from the test panel of the Toolbox. You set the start and stop frequencies, the frequency interval type (typically linear) and the frequency step. In the lower part of the test panel, you define your simulation output data. Click on the buttons labeled "Preset Graph Plots..." or "Present Table Plots..." to open the Edit Plot List dialog. The dialog gives a list of all the node voltages and currents. You can choose different complex data formats such as Mag/Phase, dB/Phase or Real/Imag.
Â
{{Note | Typically the input and output voltage, currents and powers are of primary interest. These are measured at the input port (between the source impedance and input transmission line segment) and output port (between the output transmission line segment and the termination load).}}
Â
In the previous RF circuit, the input port has node index 2 and the output port has node index 5. Therefore, the voltage v(2) and v(5) are designated as the simulation output data. The figure below shows a plot of the computed input and output voltages over the frequency range 1-10 GHz. A frequency step size of 10MHz has been set for the frequency sweep.
Â
<table>
The setup page of Network Analysis has three tabs: Connections, Sweep and Output. All of the [[parameters]] in these three tabs must be set carefully to run a successful network analysis test. The "Connections" tab is used to define the input and output ports of your circuit. If only one port of a circuit is being analyzed, then define "Port 1" only. If you have a two-port circuit, then check the checkbox labeled "Port 2" to enable its port definition. The ports can be defined either by their node numbers (positive and negative/reference node indices) or as part names. For example, your input port might be a voltage source. The reference or port characteristic impedance "Z0" is set to 50 Ohms by default. You can change its value if necessary. The "Sweep" tab of setup panel is identical to that of AC Sweep Test. This is where you set up the [[parameters]] of your frequency sweep including start and stop frequencies, frequency scale and step. The "Output" tab is used to specify the output data type as well as the graph type. Currently five graph options are available:
Â
* Cartesian (Amplitude)
Â
* Cartesian (Amp/Phase)
Â
* Cartesian (Real/Imag)
Â
* Smith
Â
* Polar
Â
For amplitude graphs, you have the option to plot them in Decibels (dB) scale. For phase graphs, you have the option to express them in degrees. You also need to specify which parameter set to calculate as the output of network analysis. The four options are Z, Y, S or H.
{{Note | Smith charts and polar graphs are available for S [[parameters]] only.}}
Â
<table>
RF circuits are typically characterized as [[Multiport Networks|multiport networks]] (usually one-port or two-port). In many practical cases, rather than computing the input or output voltages or currents, you might be more interested in the port characteristics of your RF circuit. For one-port circuits, you would designate an input port (Port 1) and would like to calculate its return loss or input impedance. For two-port circuits, you would specify an input port (Port 1) and an output port (Port 2) and would be interested in finding its insertion loss or gain. The most commonly used set of [[parameters]] for RF circuit characterization are the scattering (S) [[parameters]]. The "Network Analysis Test" is one of the AC-type [[tests]] of [[B2.Spice A/D]], which is of particular importance to [[RF.Spice]]. Network analysis computes four sets of [[parameters]]: S, Z, Y and H. Of these, S-[[parameters]] and the "Smith Chart" are of primary interest, although Z-[[parameters]] are also frequently sought.
Â
To run a network analysis of your RF circuit, open the Test Panel of the Toolbox. Check the checkbox labelled "Network Analysis" and then open the corresponding Settings Dialog. The top part of this dialog has three separate tabs: Connections, Sweep and Output, as shown below. In the Connections tab, you set the input port of the circuit as well as the output port, if it is a two-port network. The ports are defined by specifying their positive and negative pins. You also have to specify the port reference impedance (Z0). The default value of Z0 is 50 Ohms. The Sweep tab of the dialog is identical to the sweep section of AC Sweep Test Settings dialog. Here you set the start and stop frequencies and the step size. In the Output tab, you specify which port characteristics to compute at the end of the network analysis. You can choose only one of the four parameter sets: S, Z, Y or H. All [[parameters]] can be plotted on cartesian graphs with three data formats: Amp Only, Amp/Phase or Real/Imag. The magnitude data can be plotted on either linear or dB scales. S-[[parameters]] are the only option that can generate either a Smith chart or a polar graph.
Â
<table>
<tr>
Â
<td> [[File:Net1.png|thumb|200px|Network Analysis Settings: Connections Tab.]]
</td>
<td> [[File:Net3.png|thumb|200px|Network Analysis Settings: Output Tab.]]
</td>
Â
</tr>
</table>
Â
[[File:RFAC3.png|thumb|600px| An RF circuit consisting of a two-port network and connecting transmission line segments.]]
As an example, consider the RF circuit shown in the opposite figure, which was earlier examined in the discussion of AC frequency sweep test. This circuit can be treated as a one-port network with its input port defined between nodes 2 and 0, i.e. between the source's internal resistor and the input T-line segment. As a one-port, the circuit has a single s11 and a single z11 parameter. The first figure below shows the Smith chart for the return loss (s11) over the frequency range 1-10 GHz at larger steps of 100MHz. The second figure below shows Cartesian plots of the real and imaginary parts of z11 over the same frequency range both with finer steps of 10MHz.
Â
<table>
</tr>
</table>
Â
<p> </p>
[[Image:Back_icon.png|40px]] '''[[RF.Spice_A/D | Back to RF.Spice A/D Wiki Gateway]]'''