How to Use .STEP and .MEAS to Compare RMS Values at Different DC Offsets in LTspice?

Question: How can you sweep the DC offset of the same sine wave from 0 V to 5 V without editing the voltage source and recording the results manually each time?

Answer: Define the offset as a parameter, then combine .STEP and .MEAS to run six simulations automatically. The parameter name offset is used consistently below:

SINE({offset} 4 1k)
.step param offset 0 5 1
.meas TRAN DC PARAM offset
.meas TRAN Vrms RMS V(out)
.meas TRAN Pavg AVG V(out)*I(Rload)

SINE(...) is the voltage source’s parameter setting; add the other three lines as SPICE directives. The .STEP directive runs six simulations with offset = 0, 1, 2, 3, 4, and 5 V.

Figure 1 : Parameterized example circuit and the six resulting waveforms. The load remains 50 Ω. (Image source: ADI.)

Figure 2 : SPICE Output Log showing the offset parameter, RMS value, and average power for each simulation step. (Image source: ADI.)

For each complete cycle, the theoretical relationship is Vrms = √(offset² + 8). The approximate RMS values for different offsets are:

DC Offset Theoretical RMS (Approx.)
0 V 2.828 V
1 V 3.000 V
2 V 3.464 V
3 V 4.123 V
4 V 4.899 V
5 V 5.745 V

Related Articles :

Related ADI References: