AC Analysis

Looking at the schematic Simple2, you've probably recognized that this is also a low pass filter (a resistor followed by capacitance). If we wanted to see a frequency response instead, we could change a couple things and plot that too, in LTspice.

Create Signal Source

Open (if necessary) schematic Simple2 and then do a “File” and choose “Save As”, saving it as Simple3. After saving the circuit as Simple3, delete the battery component (press the Del key and click on the battery). The press Esc (escape) to return to the normal cursor.

Now let's place a “voltage source” on the schematic in its place:

  1. Press F2 to bring up the component dialog
  2. Get back to the main (upper) component level (you might need to click an “up” folder or choose item “[..]” to pop up a directory level).
  3. Locate a component named “voltage” and click OK.

AC Analysis Signal

Place the voltage source where the battery was. Right-click on the icon and you should see a dialog box. But click on the “Advanced” button to see this in the upper right corner:

Ignore all areas (for now) except for the area labeled “Small signal AC analysis (.AC)”. Fill in an amplitude of 1V, and a phase angle of 0. Optionally uncheck the “Make this information visible on schematic”. Now click OK.

Edit .AC Command

We now declare to LTspice what type analysis we want to perform. Click on “Simulate” and then choose “Edit Simulation Cmd”. When the window opens, click on the tab at the top to choose “AC Analysis”:

Set the input fields as follows:

  • Type of Sweep: Octave
  • Number of points per octave: 12
  • Start frequency: 1Hz
  • Stop frequency: 20kHz

Modify the Circuit

Change the value of the capacitor (C1) to 0.02uF to make for a more interesting filter response. By now your schematic should look something like this:


  1. The line starting with “;” indicates that the .tran command has been commented out. Don't worry if you don't have it in your schematic (in fact this item can be deleted).
  2. The “.ac” command is showing your simulation parameters as it exists in your netlist. You can check that if you like (Menu “View” and then select “SPICE Netlist”)
  3. The text “AC 1 0” might not show if you unchecked “Make this information visible on schematic”.

The commented out ”.tran” command was from a prior simulation done with this circuit. If you don't see this on your current schematic, then don't worry. You don't need it here.

Start AC Analysis (Simulate)

Just like the other simulations, start the simulation now. You'll likely get an empty graph. Like the other times, use your mouse cursor (the “probe”) to choose points in the circuit you wish to see the result of the AC analysis. For now, probe the top of capacitor C1 on the wire. You should see a plot like this:

From this you see the trademark low pass filter response. Low frequencies are passed at 0dB and start to fall off near 100Hz.

Frequency Response

The solid yellow line plots V(n002) for all frequencies from 1 to 20kHz (as we selected in the simulation command). The dB level is shown on the left axis for this. The bottom axis shows a logarithmic plot of the frequency.

Phase Angle

The dotted line in the graph shows the phase of the response (degrees). This is labeled on the right axis.

Experiment With LP Filters

You might pause and experiment with different resistor and capacitor values at this point. Try the online filter calculator here (for ultimate laziness). Put the calculated R and C values into your schematic and then re-run the simulation and see if it agrees with the calculated cut-off frequency. Just be sure to correctly use the units of the online calculator: ohms, uF and Hz. That calculator won't understand SPICE unit multipliers like “k”.

The cut-off frequency is calculated as shown at left.

Changing Log to Linear

It is possible to change the bottom axis (frequency) from a logarithmic scale to a linear one (and vice versa). Hover the mouse over the bottom axis near the numbers (say the “100Hz”). The mouse cursor will change to a small ruler. Click there and a new dialog will open:

The non-logarithmic plot

The above shows an example with the “Logarithmic” check box unchecked. Click OK and look at the graph now:

This axis modification can be made to any graph. Not just the AC analysis graph.

Recap - How Did That Work?

How did we arrive at the graph (it all happened so fast!) There were two key things that we did:

  1. Changed voltage source V1 to an Small Signal AC Analysis Source
  2. Set up the simulation command to do an AC Analysis

V1 was configured to sweep a small AC signal from 1Hz to 20kHz (range specified in the simulation command). We also configured it to use a 1V (amplitude) sine wave and to use a starting phase angle of zero.

The frequency range (1Hz to 20kHz) was specified in the .ac simulation command. Both of these worked together to produce the AC Analysis result. LTspice injected the swept AC signal into the circuit through V1 and plotted the result in the graph, wherever we dropped our probe (in this case above the capacitor C1).

High Pass Filter

We're now going to change the circuit into a high pass filter and save it as Simple4.

After doing a “Save As” file Simple4, delete the wiring around the resistor and the capacitor. Your circuit should look like the one at right:

Using the F8 key (or menu “Edit” then select “Drag”) click on the resistor to “grab” it. Then press Control-R to rotate it into a vertical position. Move it near where C1 is. Perform the same thing on C1 but rotate and place it where R1 was. Finish by putting R1 where C1 was.

Press F3 and connect all the wiring.

Revised Component Layout

At this point your schematic should look like this (at right):

AC Analysis

Run the analysis again and then touch the probe above R1 to produce the graphs. What you should see should be this:

You can see from the frequency response that this indeed has changed to a high pass filter.


Review From this chapter, you have seen:

  1. how a voltage source has been configured to provide an input AC signal
  2. the voltage source defines the voltage amplitude and phase
  3. the circuit is then analyzed and plotted on the basis of the circuit “probe”
  4. the simulation command defines the other aspects of the analysis, like frequency range
  5. learned how to switch a graph from logarithmic to linear and vice versa
  6. you have used the “grab” function to move components on a schematic

Next Diode Action and Spectral Analysis

questionmark.jpg Comments or questions? Click here.

Electron Coaxing Techniques and Notes (start)


ltspice_ac_analysis.txt · Last modified: 2011/05/02 03:39 by ve3wwg
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki