* SPICE netlist
V1 Vsine 0 SINE(0 1 1e9 0 0 0 1000)
V2 Vcos 0 SINE(0 1 1e9 0 0 90 1000)
B1 Iout 0 V=V(Vmod)*V(Vsine)
V3 Vmod 0 PULSE(-.50 .5 0 .1n .1n 4.9n 10n)
B2 Qout 0 V=V(Vmod)*V(Vcos)
B3 Idemod 0 V=V(Iout)*V(Vsine)
B4 Qdemod 0 V=V(Qout)*V(Vcos)
G1 0 N005 Vmod1 0 .001
S1 N003 N005 Vmd2 0 MYSW
R1 N005 0 10k
R2 0 N003 10k
S2 N001 N005 Vmd1 0 MYSW
R5 0 N001 10k
E1 Q 0 N001 N003 1
V4 Vmd1 Vcos 1
V5 Vmd2 N007 1
E2 N007 0 Vcos 0 -1
V6 Vmod1 0 SINE(0 .5 1e8 0 0 0 1000)
G2 0 N006 Q 0 .001
S3 N004 N006 Vmd2 0 MYSW
R3 N006 0 10k
R4 0 N004 10k
S4 N002 N006 Vmd1 0 MYSW
R6 0 N002 10k
E3 Qdem1 0 N002 N004 1
.tran 1u

* LTspice schematic (.asc)
Version 4
SHEET 1 1520 1104
WIRE -760 -408 -760 -456
WIRE -760 376 -760 344
WIRE -744 344 -760 344
WIRE -728 -456 -760 -456
WIRE -696 424 -696 392
WIRE -680 344 -744 344
WIRE -680 392 -696 392
WIRE -632 168 -632 120
WIRE -632 184 -632 168
WIRE -632 296 -632 264
WIRE -632 328 -632 296
WIRE -568 200 -584 200
WIRE -552 248 -584 248
WIRE -536 40 -632 40
WIRE -536 56 -536 40
WIRE -536 296 -632 296
WIRE -536 344 -536 296
WIRE -520 -504 -520 -552
WIRE -488 -552 -520 -552
WIRE -488 -296 -488 -328
WIRE -456 -328 -488 -328
WIRE -440 40 -536 40
WIRE -440 184 -440 120
WIRE -440 296 -536 296
WIRE -440 296 -440 264
WIRE -360 200 -392 200
WIRE -360 248 -392 248
WIRE -328 -504 -328 -536
WIRE -328 -296 -328 -328
WIRE -280 120 -440 120
WIRE -280 168 -632 168
WIRE -264 344 -264 328
WIRE -264 456 -312 456
WIRE -264 456 -264 424
WIRE -232 88 -232 72
WIRE -232 104 -232 88
WIRE -232 216 -232 184
WIRE -152 456 -264 456
WIRE -152 520 -152 504
WIRE -104 344 -104 328
WIRE -104 440 -104 424
WIRE -104 552 -104 520
WIRE -56 -536 -328 -536
WIRE -56 -328 -328 -328
WIRE 88 88 -232 88
WIRE 88 360 88 88
WIRE 152 -536 -56 -536
WIRE 152 -328 -56 -328
WIRE 216 440 216 408
WIRE 232 360 88 360
WIRE 232 408 216 408
WIRE 280 -488 280 -520
WIRE 280 -280 280 -312
WIRE 280 184 280 136
WIRE 280 200 280 184
WIRE 280 312 280 280
WIRE 280 344 280 312
WIRE 344 216 328 216
WIRE 360 264 328 264
WIRE 376 56 280 56
WIRE 376 72 376 56
WIRE 376 312 280 312
WIRE 376 360 376 312
WIRE 472 56 376 56
WIRE 472 200 472 136
WIRE 472 312 376 312
WIRE 472 312 472 280
WIRE 520 -520 280 -520
WIRE 520 -312 280 -312
WIRE 552 216 520 216
WIRE 552 264 520 264
WIRE 584 136 472 136
WIRE 584 184 280 184
WIRE 632 120 632 88
WIRE 632 232 632 200
WIRE 760 88 632 88
FLAG -520 -424 0
FLAG -488 -216 0
FLAG -328 -424 0
FLAG -760 -328 0
FLAG -56 -536 Iout
FLAG -56 -328 Qout
FLAG -488 -552 Vsine
FLAG -456 -328 Vcos
FLAG -728 -456 Vmod
FLAG -328 -216 0
FLAG 280 -408 0
FLAG 520 -520 Idemod
FLAG 280 -200 0
FLAG 520 -312 Qdemod
FLAG -632 408 0
FLAG -696 424 0
FLAG -536 424 0
FLAG -536 56 0
FLAG -568 200 0
FLAG -232 72 Q
FLAG -360 200 0
FLAG -232 216 0
FLAG -360 248 Vmd1
FLAG -552 248 Vmd2
FLAG -264 328 Vmd1
FLAG -312 456 Vcos
FLAG -104 328 Vmd2
FLAG -104 552 0
FLAG -152 520 0
FLAG -760 456 0
FLAG -744 344 Vmod1
FLAG 280 424 0
FLAG 216 440 0
FLAG 376 440 0
FLAG 376 72 0
FLAG 344 216 0
FLAG 760 88 Qdem1
FLAG 552 216 0
FLAG 632 232 0
FLAG 552 264 Vmd1
FLAG 360 264 Vmd2
SYMBOL voltage -520 -520 R0
SYMATTR Value SINE(0 1 1e9 0 0 0 1000)
SYMATTR InstName V1
SYMBOL voltage -488 -312 R0
SYMATTR Value SINE(0 1 1e9 0 0 90 1000)
SYMATTR InstName V2
SYMBOL bv -328 -520 R0
SYMATTR InstName B1
SYMATTR Value V=V(Vmod)*V(Vsine)
SYMBOL voltage -760 -424 R0
SYMATTR Value PULSE(-.50 .5 0 .1n .1n 4.9n 10n)
SYMATTR InstName V3
SYMBOL bv -328 -312 R0
SYMATTR InstName B2
SYMATTR Value V=V(Vmod)*V(Vcos)
SYMBOL bv 280 -504 R0
SYMATTR InstName B3
SYMATTR Value V=V(Iout)*V(Vsine)
SYMBOL bv 280 -296 R0
SYMATTR InstName B4
SYMATTR Value V=V(Qout)*V(Vcos)
SYMBOL g -632 312 R0
SYMATTR InstName G1
SYMATTR Value .001
SYMBOL sw -632 168 M0
SYMATTR InstName S1
SYMATTR Value MYSW
SYMBOL res -552 328 R0
SYMATTR InstName R1
SYMATTR Value 10k
SYMBOL res -648 24 R0
SYMATTR InstName R2
SYMATTR Value 10k
SYMBOL sw -440 168 M0
SYMATTR InstName S2
SYMATTR Value MYSW
SYMBOL res -456 24 R0
SYMATTR InstName R5
SYMATTR Value 10k
SYMBOL e -232 88 R0
SYMATTR InstName E1
SYMATTR Value 1
SYMBOL voltage -264 328 R0
SYMATTR InstName V4
SYMATTR Value 1
SYMBOL voltage -104 328 R0
SYMATTR InstName V5
SYMATTR Value 1
SYMBOL e -104 424 R0
SYMATTR InstName E2
SYMATTR Value -1
SYMBOL voltage -760 360 R0
SYMATTR Value SINE(0 .5 1e8 0 0 0 1000)
SYMATTR InstName V6
SYMBOL g 280 328 R0
SYMATTR InstName G2
SYMATTR Value .001
SYMBOL sw 280 184 M0
SYMATTR InstName S3
SYMATTR Value MYSW
SYMBOL res 360 344 R0
SYMATTR InstName R3
SYMATTR Value 10k
SYMBOL res 264 40 R0
SYMATTR InstName R4
SYMATTR Value 10k
SYMBOL sw 472 184 M0
SYMATTR InstName S4
SYMATTR Value MYSW
SYMBOL res 456 40 R0
SYMATTR InstName R6
SYMATTR Value 10k
SYMBOL e 632 104 R0
SYMATTR InstName E3
SYMATTR Value 1