2
\$\begingroup\$

I've been designing a (very) simple MOSFET op-amp for school, and one of the things I need to do is determine the CMRR from my simulations. For the assignment, I'm just going to use the value at 1kHz, which should fulfill the assignment requirements. However, thinking about it made me wonder if there is a way to make LTSpice (or any other version of Spice) plot the CMRR over multiple frequencies?

I won't show the circuit, as this question is relevant to differential amplifiers in general, but here are the directives I'm using to run my current simulation:

.ac dec 100 1 100Meg
.step param vi list 0 1

vi is an AC voltage parameter for the non-inverting input, and the inverting input has a fixed value of AC 1.

Here is the result, measured at the output: LTSpice plot showing the frequency response with a differential input and a common-mode input

The black line (vi=0) shows the open loop frequency response with a differential input and the blue line shows the response with a common-mode input. In other words, it simulates these two circuits:

schematic

simulate this circuit – Schematic created using CircuitLab

I am wondering if there is a way to divide two instances of the same parameter. In other words, I want to divide the output voltages corresponding to the differential and common-mode gains so that I can do something like this:

$$ CMRR = \frac{v_o|_{v_i=0}}{v_o|_{v_i=1}} $$

\$\endgroup\$
2
\$\begingroup\$

Yes there is: 1) Plot a signal 2) Right click on the signal name in the plot 3) The Expression editor pops up, you can now feel free to enter in a math expression, make sure if you include nodes you specify if you want a voltage with V(node) or current with I(node)

Here is an example of dividing one voltage node (named vout1 and vout2) by another with this expression V(vout1)/V(vout2)

enter image description here

Info on LT Spice algebraic expressions

Note: Alt-click on components which will generate a temperature plot, this also creates an expression.

Another cool trick is to use V(vout1)/I(r1) to plot the impedance of a node

\$\endgroup\$
  • \$\begingroup\$ That is helpful advice, but it doesn't answer my question. I am wondering specifically about creating an expression that involves two instances of the same node. Both of my measurements are of vo, but they correspond to different values of another parameter. \$\endgroup\$ – Caleb Reister Mar 23 '17 at 7:49
  • \$\begingroup\$ I thought you'd be able to figure that out and I didn't see your spice code so I thought you had already duplicated your circuit and that duplication was implied. So, you duplicate your circuit and run two different copies of your circuit in the same simulation and have two output nodes, then you use the algebraic expressions in the plotting to find the CMRR. I run dupilicate circuits in simulations all the time. \$\endgroup\$ – Voltage Spike Mar 23 '17 at 15:27
  • \$\begingroup\$ Guess I could do that. \$\endgroup\$ – Caleb Reister Mar 23 '17 at 15:37
0
\$\begingroup\$

You don't need to do such things inside LTSpice. Just export the results of two independent simulations into CSV files and do the math and plot in any spreadsheet or Matlab-like application.

Instuction how to export the data can be found here: http://www.linear.com/solutions/1815

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.