A long walkway featuring intricate arches and pillars, creating a beautiful architectural pathway.

Automating LTspice .NOISE Measurements with .STEP and .MEAS Directives: Part 2 of 3

When analyzing LTspice noise (.NOISE) simulations, examining the waveforms and making measurements with the waveform viewer can be the quickest way to get familiar with your circuit—see part 1  of this blog series for tips. But, if you want to level up your LTspice skills to more quickly evaluate design trade-offs, add .STEP and .MEAS directives to your analysis.

Start with a Working .NOISE Simulation

I always recommend you start with a working schematic before you start trying to learn a new LTspice skill. Download measuring noise.asc to follow along. 

Open the schematic and click the green play icon (or ALT+R) to run the simulation. Click on the wire labeled out in the schematic to plot V(onoise), and click on the resistors to plot V(R1) and V(R2). These three waveforms represent the total noise density, R1 noise density, and R2 noise density, respectively.

 Example .NOISE Simulation with Plotted Waveforms

Figure 1: Example .NOISE Simulation with Plotted Waveforms

Revisit part 1 to understand the first two directives in this schematic: .AC and .NOISE.

Understanding .PARAM Directives

The next set of directives in the example schematic are .PARAM and .STEP directives. The .STEP directive is a comment (in blue), so let’s focus on the .PARAM directive first.

The .PARAM R 800 directive creates a parameter, R, and sets the value of R to 800. Parameter R is then used to set the value of resistor R1. This is an overly simple example, but using .PARAM directives is an important concept to learn as we work towards adding the .STEP directive later.

Adding .MEAS Directives to Make Easy Measurements

The remaining directives in this schematic are .MEAS directives; these measurements are made every time the simulation is run, and the results are reported in the SPICE Output Log (select View -> SPICE Output Log, or press CTRL+L). 

The first measurement directive .meas NOISE r_value PARAM R simply reports the value of parameter R. This can be useful information when you incorporate .STEP directives—stay tuned!

 SPICE Output Log of .NOISE Simulation Including .MEAS Directives

Figure 2: SPICE Output Log of .NOISE Simulation Including .MEAS Directives

The second set of measurement directives measure noise density of a curve at a specific frequency. In this example, noise density is measured at 1 mHz for each of the individual noise contributions V(R1) and V(R2), as well as the total output noise V(onoise)

Noise Analysis Measurement

Result Name

Curve to Measure

At Frequency

.meas NOISE

r1_density

FIND V(R1)

AT 1mHz

.meas NOISE

r2_density

FIND V(R2)

AT 1mHz

.meas NOISE

onoise_density

FIND V(onoise)

AT 1mHz

The third set of measurement directives measure the integrated RMS noise for each density curve across the frequency range being simulated. 

Noise Analysis Measurement

Result Name

Value to Measure

.meas NOISE

r1_rms

INTEG V(R1)

.meas NOISE

r2_rms

INTEG V(R2)

.meas NOISE

onoise_rms

INTEG V(onoise)

   

Comparing .MEAS Results to Waveform Results

Using the waveform measurement skills we explored in part 1, we can use the waveform viewer to measure both V(onoise) density at 1 mHz and the total integrated noise. We can also compare those values to the .MEAS results in the SPICE Output Log. Note that the .MEAS results for onoise_density and onoise_rms in the log match the measurements made in the waveform viewer.

 Comparing V(onoise) .MEAS Results to Waveform Measurements

Figure 3: Comparing V(onoise) .MEAS Results to Waveform Measurements

Using .STEP to Sweep a Parameter

Uncomment the .STEP directive by SHIFT+click-ing on the directive in the schematic (or, right-click on the directive, and toggle it from Comment to SPICE Directive in the text edit pop-up). Run the simulation (click the green play button, or ALT+R).

Delete all waveforms, and only plot V(onoise). Add a step legend to the waveform viewer: right-click on the waveform viewer, and select Notes & Annotations -> Annotate Steps. Open the SPICE Output Log (select View -> SPICE Output Log, or press CTRL+L). 

Figure 4: Viewing .MEAS Results and Waveforms with .STEP Directive for R1 Value

Proving KT/C Noise of RC Circuit

Combining .STEP and .MEAS directives, we can easily observe the impact of the value of R1 on both the noise density and the overall RMS noise. For increasing values of R1, observe that the r1_density and onoise_density increase.

The relationship between the value of R1 and the total integrated RMS noise is more complex: the noise density increases and R1 increases, but the bandwidth of the circuit decreases as R1 increases. 

To further explore this, let’s think about R1 and R2 as a combined value, and the combined value is being stepped between 1k, 2k, and 3k. 

 Considering the Combined Value of R1 and R2 and Impact on RMS Noise

Figure 5: Considering the Combined Value of R1 and R2 and Impact on RMS Noise

The combined noise density of those resistors (onoise_density) increases, but the RMS noise (onoise_rms) stays constant. Remember when I mentioned kT/C noise in the previous blog post? That’s what we’re observing here—for an RC circuit like this, the integrated RMS noise will vary as you vary the value of the capacitor, but will not change with changing resistor values. The value of R in the noise density equation 4KBTR cancels out the value of R in the equivalent noise bandwidth equation 1/(4RC). So, the RMS noise of an RC circuit is dependent on the value of C, not R!

What's Next?

By mastering .STEP and .MEAS directives in LTspice, you can quickly evaluate critical circuit behaviors without having to probe and inspect waveforms manually. This skill will come in handy when I explore and demonstrate correlated vs. uncorrelated noise in the next blog post—coming soon!

Read all the blogs in A Pinch of LTspice series.