I'm simulating a rather simple circuit, but am not getting the appropriate results on AC analysis. I must be forgetting something about how to do an AC analysis.
I run a transient simulation and get what I expect. When the switch is open (5V on the control pin), the signal is attenuated four fold. When the switch is closed (0V on the control pin), the signal is attenuated 16 fold.
But run an AC analysis and the signal "Filter" is shown as -24 dB instead of th expected -12 dB (with the switch open). Close the switch and the signal "Filter" is still -24 dB, but in this case, that's expected.
If I change the connection from the net -13dBCntl to a ground, instead of the switch, it works as I expect.
I don't get why the transient simulation shows the expected results, yet the AC analysis does not. Obviously the switch model is munging up the AC analysis, but why???
Here's the circuit file.
Version 4 SHEET 1 880 684 WIRE -176 112 -208 112 WIRE -32 112 -176 112 WIRE 160 112 48 112 WIRE 256 112 160 112 WIRE 368 112 256 112 WIRE 416 112 368 112 WIRE 480 112 416 112 WIRE 544 112 480 112 WIRE 656 112 624 112 WIRE 672 112 656 112 WIRE 160 176 160 112 WIRE 256 176 256 112 WIRE 368 176 368 112 WIRE 480 176 480 112 WIRE -208 192 -208 112 WIRE 16 224 -16 224 WIRE 112 224 96 224 WIRE 112 256 112 224 WIRE 368 288 368 256 WIRE 480 288 480 240 WIRE 672 288 672 112 WIRE -16 304 -16 224 WIRE -208 368 -208 272 WIRE -112 368 -208 368 WIRE 160 368 160 240 WIRE 160 368 80 368 WIRE 208 368 160 368 WIRE 256 368 256 256 WIRE 256 368 208 368 WIRE -208 384 -208 368 WIRE -112 432 -208 432 WIRE -208 480 -208 432 WIRE -208 592 -208 560 WIRE -64 608 -64 544 WIRE 32 608 32 544 WIRE 32 608 16 608 WIRE 64 608 32 608 WIRE 64 640 64 608 FLAG -208 384 0 FLAG 480 288 0 FLAG 672 288 0 FLAG -208 592 0 FLAG 64 640 0 FLAG 112 256 0 FLAG 368 288 0 FLAG 656 112 Out FLAG 416 112 Filter FLAG -176 112 In FLAG 208 368 -13dBCntl SYMBOL res 64 96 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R1 SYMATTR Value 5k SYMBOL res 240 160 R0 SYMATTR InstName R2 SYMATTR Value 417 SYMBOL res 640 96 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R4 SYMATTR Value 51k SYMBOL cap 464 176 R0 SYMATTR InstName C1 SYMATTR Value 1.5nF SYMBOL cap 144 176 R0 SYMATTR InstName C2 SYMATTR Value 4.7nF SYMBOL Switches\\ADG1411 -16 416 R0 SYMATTR InstName U1 SYMBOL voltage -208 176 R0 WINDOW 123 24 124 Left 2 WINDOW 39 0 0 Left 0 SYMATTR InstName V1 SYMATTR Value SINE(1 1 1000) SYMATTR Value2 AC 1 SYMBOL voltage -208 464 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V2 SYMATTR Value 5 SYMBOL voltage 0 224 R270 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V3 SYMATTR Value 12 SYMBOL voltage 32 608 R90 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V4 SYMATTR Value 12 SYMBOL res 352 160 R0 SYMATTR InstName R3 SYMATTR Value 1650 TEXT 302 540 Left 2 ;.tran 10m TEXT 304 464 Left 2 !.ac dec 20 1 100k