I am plotting the output voltage of my amplifier in units of decibels. When I plot the expression:
I do not get the answer I would expect. When I plot the following expression:
The simulation is exactly what I am looking for. Why is there a discrepancy between these two when they should be the same calculation?
The discrepancy between the two expressions lies in how they treat complex numbers which is how a voltage in AC analysis is stored internally in Micro-Cap. The dB operator will always calculate the magnitude of the variable it is working on before it performs its calculation. The expression:
is functionally equivalent to:
However, the log operator will perform its calculation directly on the complex form of the variable. Only when the final value is plotted to the screen is the magnitude actually taken. In order to use the 20*log function to plot decibels, the Mag operator must also be included. The equivalent expression to the basic dB expression is:
Almost all of the transcendental operators available in Micro-Cap perform complex mathematical operations so this is an issue to be aware of when using these operators in AC analysis.