Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/Mixer.m4

raw
1 .PS
2 #`Mixer.m4
3 # Showing VMOS mosfet and custom transformer'
4 cct_init
5 ifdpic(`
6 define(`sftxt',`{\sf `$1'}')
7
8 define(`dimen_',0.6)
9 define(`elen_',0.75)
10
11 define(`Xform21',
12 `[ L1: inductor(to rvec_(dimen_*0.5,0),L,,M)
13 Core1E: M4Core1.end; Core2E: M4Core2.end
14 D: (0.5 between M4Core1 and M4Core2) - L1
15 T: line to rvec_(dimen_/3,0); { dot(at T.c) }
16 L2: inductor(to rvec_(L1.len,0),L,,M)
17 line from M4Core1.start to Core1E
18 line from M4Core2.start to Core2E
19 L3: inductor(to rvec_(-L1.len,0) with .c at T+(D.x*2,D.y*2),L) ]')
20
21 del = dimen_/3
22 setdir_(U)
23 T1: Xform21; "sftxt(T1)" at T1.n above rjust
24 dot(at T1.L3.start+(0,4bp__))
25 dot(at T1.L1.end+(4bp__,0))
26 dot(at T1.L2.end+(4bp__,0))
27 line from T1.L3.start left_ dimen_*2/3
28 RF: dot(,,1); "sftxt(RF)" at RF.w rjust
29 line from T1.L3.end left_ del; corner; ground(,,F)
30
31 line down_ del/2 from T1.L1.start then right_ del
32 reversed(`capacitor',right_ dimen_,C); llabel(,\SI{0.1}{\micro{}}\hbox{\sf F})
33 BT: dot(at Here)
34 line up_ del/2 from T1.L2.end then right del
35 reversed(`capacitor',right_ dimen_,C); llabel(,\SI{0.1}{\micro{}}\hbox{\sf F})
36 t = dimen_*7/8
37 line to (BT.x+4*t,Here.y)
38 TT: dot
39 line right_ dimen_+del/2; setdir_(U)
40 Q1: mosfet(,,dMESDQuB,E) with .G at Here
41 { "sftxt(Q1)" at Q1.Env.ne above ljust }
42 ground(at Q1.S,,F)
43 line right_ del*3/2 from Q1.D then down_ Q1.D.y-T1.L2.end.y
44 T2: Xform21 with .L1.start at (Here,T1.L2.end); "sftxt(T2)" at T2.n above ljust
45 dot(at T2.L1.start+(-4bp__,0))
46 dot(at T2.L3.end+(0,4bp__))
47 line from T2.L3.end right_ dimen_*2/3
48 IF: dot(,,1); "sftxt(IF)" at IF.e ljust
49 setdir_(U)
50 Q2: mosfet(,,dMESDQuB,E) at (Q1,T2.s-(0,elen_-del))
51 { "sftxt(Q2)" at Q2.Env.ne above ljust }
52 line from Q2.D to (T2.L2.end,Q2.D) then to T2.L2.end
53 line from Q2.G left_ del/2 then up_ BT.y-Q2.G.y then to BT
54
55 line right_ del from T1.T then down_ T1.T.y-BT.y+del
56 corner; left_
57 capacitor(to (T1.L3.end-(del,0),Here),C)
58 rlabel(,\SI{0.1}{\micro{}}\hbox{\sf F}\hskip20pt)
59 LOD: dot
60 { line to (RF,Here); dot(,,1); move left_ 4bp__; textht = 10bp__
61 { "sftxt(local)" wid 30bp__ rjust at Here+(0,5bp__) }
62 "sftxt(oscillator)" wid 50 bp__ rjust at Here+(0,-5bp__) }
63 line from T2.T left_ to (Q1.S,T2.T)
64 T2T: dot
65 { capacitor(down_ to (Here,BT),C); rlabel(,\SI{0.1}{\micro{}}\hbox{\sf F})
66 ground(,T,F) }
67 { line from T2.L3.start right_ del; corner; ground(,,F) }
68 Vt: dot(at (0.5 between BT and TT,Q1.Env.nw),,1)
69 { "sftxt($+$V$_{\hbox{\scriptsize CC}}$)" at last [].e ljust }
70 line to (Here,T2T) chop dotrad_ chop 0; dot
71 { line to (Here,BT); Cv: capacitor(down_ 3/2*dimen_,C)
72 llabel(\SI{10}{\micro{}}\hbox{\sf F}); G: dot; ground(,,F) }
73
74 for s=-1 to 1 by 2 do {{
75 line right s*t; corner
76 resistor(down_ to (Here,BT))
77 if s<0 then { llabel(,\SI{5}{\kilo\ohm}) } \
78 else { rlabel(,\SI{5}{\kilo\ohm})
79 { dot(at last line.start); line to (TT,Here)
80 resistor(right_ to (T2T,Here))
81 llabel(,\SI{10}{\ohm}) } }
82 P: potentiometer(down_ Cv.len,,0.5,s*t ) with .Start at Here
83 if s<0 then { "sftxt(1\`,'\si{\kilo\ohm})" at P. 1st [].ne ljust } \
84 else { "sftxt(1\`,'\si{\kilo\ohm})" at P. 1st [].sw rjust }
85 dot(at P.End)
86 dot(at P.T1)
87 { L: inductor(up_ to (Here,BT),L);
88 if s<0 then { "sftxt(100\`,'\si{\micro{}}H)" at last [].sw rjust } \
89 else { line to TT
90 "sftxt(100\`,'\si{\micro{}}H)" \
91 at last [].ne ljust below } }
92 capacitor(down_ to (Here,G),C)
93 if s<0 then { rlabel(,\SI{0.1}{\micro{}}\hbox{\sf F}) } \
94 else { llabel(,\SI{0.1}{\micro{}}\hbox{\sf F}) }
95 dot }}
96
97 resistor(down_ from LOD to (LOD,G)); llabel(,\SI{51}{\ohm}); corner
98 line to (Q2.S,Here) then to Q2.S
99
100 ',
101 `box wid 2*boxwid "Mixer cct" "requires dpic"')
102 .PE