# Getting started with and understanding AC Sweeps

Discussion in 'General Electronics Chat' started by newbie217, Feb 15, 2010.

1. ### newbie217 Thread Starter Active Member

Apr 12, 2009
52
0
Hi all,

I'm trying to get started with using SPICE for simulations and had questions on how the AC Sweep works.

To start (and for simplicity sake), I'm using a very basic common emitter circuit. For the transient test, I am applying a 0.1 V amplitude, 1kHz sine wave on top of a 0.8 V DC source. I can then plot VIN and VOUT to see how the circuit is behaving.

When I run the same setup using the AC source to do an AC Sweep, I see that at 1kHz, I get a gain of -41. How is this gain being calculated at each frequency? Why is the gain negative?

If I use the above transient plots, picking an arbitrary point, I can calculate:

gain= 20 * log(VOUT/VIN) = 14.71

Now, I know this probably isn't right, but this is where I am currently stuck. So I defer to the experts

I really would like to understand more of what's going on. Especially on a qualitative level.

Thanks much!

File size:
63.1 KB
Views:
30
File size:
47 KB
Views:
25
2. ### MikeML AAC Fanatic!

Oct 2, 2009
5,445
1,073
Your circuit. First, I had to put the 4.7K between the 0.8V bias source and the base of the transistor. A base voltage of 0.8V saturates the transistor, causing V(out) to be sitting at ~0.6V (has no gain there ).

The .OP simulation calculates the DC conditions that exist in the circuit with just the 0.8V bias applied. Note that putting the 4.7K in series with the input sets the collector voltage at ~7V, where the amplifier can have some gain. This is an inverting amplifier, hence the minus sign.

The .TRAN simulation does the .OP first, and then varies the input sinosoidally from 0.7V to 0.9V at 1000Hz. Note the gain and inversion.

The .AC sim does the .OP first, then linearizes the circuit, and then sweeps the frequency from 100Hz to 10MHz. Note how the gain (now in db) varies vs frequency. Note the phase is -180 degrees at low frequencies because this is an inverting amplifier.

File size:
21.2 KB
Views:
22
File size:
12 KB
Views:
19
File size:
13.2 KB
Views:
24
File size:
18.4 KB
Views:
22
3. ### newbie217 Thread Starter Active Member

Apr 12, 2009
52
0
Hi Mike,

Thank you for your reply and help. I understand the .OP DC simulation better now. I'm still having trouble understanding how the .TRAN and .AC sims relate. For example, if you connect the input source as a sinusoid that varies from 0.7 V to 0.9 V at 1 kHz, you can see the gain and inversion, like you said, on the waveforms shown in the third image.

But how do we use this information to calculate the gain and phase as shown in the fourth picture? In other words, I'm trying to relate the two plots to figure out how the AC sweep works. How would you do so for just that single 1k frequency?

Also, if you wanted to calculate the gain and phase by hand, how would you do using just the information on the third waveform?

What does it mean to linearize the circuit, exactly?

4. ### MikeML AAC Fanatic!

Oct 2, 2009
5,445
1,073
The .TRAN and .AC sims relate at only a single frequency, namely at 1000Hz. Note that at 1000Hz (DC bias being the same), the .AC sim says that the gain is ~31db at a phase of 180deg.

Note that 0.1Vzero-peak is shown as -10dbV, meaning -10db relative to 1V. The output is shown at +21dbV, meaning the net gain is 31db. Now 31db/180deg means that ratio of output to input at 1000Hz is -10^(31/20) = -35, which agrees with the .TRAN sim.

During a .AC sim, the solution is done in the frequency domain, not time domain. The transistor is replaced with a gain block that has the same linearized gain around the DC bias point.