AC Analysis
I am plotting the output voltage of my amplifier in units of decibels. When I plot the expression:
20*log(V(Out))
I do not get the answer I would expect. When I plot the following expression:
dB(V(Out))
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:
dB(V(Out))
is functionally equivalent to:
dB(Mag(V(Out)))
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:
20*log(Mag(V(Out)))
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.
|