1 Exc. 1: Hartley mixer RF LO 90 + IF Hartley mixer cancells the image sideband: only signal will appear in IF port, while image is cancelled. This can be seen using Matlab file hartley.m that convolves the line spectrums given 90 Do: • select lower sideband • select upper sideband • check the effect of 10% error in LO phase shift LO signal image RF (C) 1999- Timo Rahkonen, University of Oulu, Oulu, Finland 2 Exc. 2: AM/AM test In amam.i AM/AM and AM/PM curves are simulated using 1-tone harmonic balance Do: • Check the effect of biasing the device in class B or C by reducing the base voltage by 50 mV. (C) 1999- Timo Rahkonen, University of Oulu, Oulu, Finland 3 itest RB XOUT Exc. 3: Measuring Zin In pierce.i, a CMOS Pierce oscillator is characterized by driving it by a 1-tone test current source and measuring the voltage that developes across port XOUT-XIN. Oscillation criteria is that Zamp(Amp) = -Zresonator(f), so Find • excact oscillation amplitude if Re(Zreson) = 18 ohm. • find Im(Zamp) at that point and note that it will pull the resonance frequency. XIN Note that due to large RB the circuit settles slowly, and similar amplitude sweep using transient analysis would be very slow. (C) 1999- Timo Rahkonen, University of Oulu, Oulu, Finland 4 Exc. 4: Measuring IIP3 In mtanhiip3.i, both conventional and multi-tanh differential pair are measured using a 2-tone input signal. The figures are in Chapter 6, when driven from 50 differential source. 1 1 1 1 • Run the same simulations when driven from 500 ohms 4 1 1 4 (C) 1999- Timo Rahkonen, University of Oulu, Oulu, Finland 5 VOLTERRA TOOLS Maple Maple .net .mws function calls • describe circuit topology with MNA matrix • show the location of inputs • list the control and output nodes of nonlinear components rules Matlab Matlab netlist +sweeps Volterra kernels can be analyzed symbolically using Maple and numerically using Matlab. In both cases, the following needs to be done: nli_main calculation of kernels Calculation proceeds so that using linear response, controlling voltages are calculated (in general they are differential, e.g. v1[3]-v1[4] is voltage between nodes 3 and 4 at frequency w1), and usign them, 2nd order currents in nonlinear components are calculated (gH2() and cH2() in Maple). These currents are now the 2nd order input vector for the circuit, and their voltage response is calculated using linear model t frequency w1+w2. Then, using 1st and 2nd order controlling voltages, 3rd order distortion currents are calculated, injected to the circuit and voltage responses are calculated. (C) 1999- Timo Rahkonen, University of Oulu, Oulu, Finland 6 voltrules.txt for Maple: restart; with(linalg); # initialisation # nonlin 2nd order current of 1-dim. conductance # v1,v2 are 1st order voltages at w1, w2 # KV is a vector containing K1,K2,K3 gH2 := proc(v1,v2,KV) ; KV[2]*v1*v2; end; # nonlin 3rd order current of 1-dim. conductance # v1,v2,v3 are 1st order voltages at w1, w2, w3 # v12, v13,... are 2nd order voltages at w1+w2, # w1+w3, ... gH3 := proc(v1,v2,v3,v12,v13,v23,KV) local t1,t2; t1 := KV[3]*v1*v2*v3; t2 := 2/3*KV[2]*(v1*v23 + v2*v13 + v3*v12); evalm(t1+t2); # matrix addition end; (C) 1999- Timo Rahkonen, University of Oulu, Oulu, Finland # nonlin 2nd order current of a 1-dim cap. # cH2 := proc(v1,v2,KV,w1,w2) ; I*(w1+w2)*KV[2]*v1*v2; end; # nonlin 3rd order current of a 1-dim cap. # cH3 := proc(v1,v2,v3,v12,v13,v23,KV,w1,w2,w3) local t1,t2; t1 := K3*v1*v2*v3; t2 := 2/3*K2*(v1*v23 + v2*v13 + v3*v12); I*(w1+w2+w3)*(t1+t2); end; 7 Iin 1 Exc. 5: Finding Volterra transfer function for amp In gmramp.net, the amplifier on left is described. Current equations in nodes 1 and 2 are 2 + - 1 - 1 ⋅ v 1 = I in jωC ⋅ v 2 = – g mA ⋅ v 1 + g mB ⋅ ( – v 2 ) gmA C + which in matrix form is gmB v 1 0 I ⋅ 1 = in g mA ( g mB + jωC ) v2 0 Next, in voltrules.txt basic rules for Volterra kernels in Maple are shown, and next, in gmramp.net, the circuit and positions of distortion current sources are shown. Do: • derive 2nd order Volterra response • modify gmramp.net such that the control and output polarity of gmB are changed. It does not affect linear transfer function but does affect distortion. (C) 1999- Timo Rahkonen, University of Oulu, Oulu, Finland 8 gmramp.net ## INV AMP: gm loaded by another gm and cap # # IV: input position, gmXv: K1, K2, K3 of cond. X # Iv := vector([ 1, 0]); #linear input signal gmAv := vector([ gmA, gmA*K2, gmA*K3]); gmBv := vector([ gmB, gmB*K2, gmB*K3]); # H1 calcs v vector for given current vector input Iin H1 := proc(w,Iin) local Y; # MNA admittance matrix Y := matrix( [ [1, 0 ], # node 1 [gmA , (gmB + I*w*C)] ]); # node 2 evalm( inverse(Y) &* Iin); end; H2 := proc(w1,w2) local v1,v2,inA,inB,H2A,H2B; v1 := H1(w1,Iv); # 1st order voltage at w1 v2 := H1(w2,Iv); # 1st order voltage at w2 (C) 1999- Timo Rahkonen, University of Oulu, Oulu, Finland # distortion currents and voltages caused by them inA := gH2(v1[1],v2[1],gmAv); # calc current H2A := H1(w1+w2,vector([0,-inA]));# inject it inB := gH2(-v1[2],-v2[2],gmBv); H2B := H1(w1+w2,vector([0,+inB])); evalm(H2A + H2B); end; H3 := proc(w1,w2,w3) local v1,v2,v3, v23,v13,v12,inA,inB,H2A,H2B; v1 := H1(w1,Iv); v2 := H1(w2,Iv); # 1st order v3 := H1(w3,Iv); v12 := H2(w1,w2); v13 := H2(w1,w3); v23 := H2(w2,w3); # 2nd ord # distortion currents and voltages caused by GA,GB inA := gH3(v1[1],v2[1],v3[1],v12[1],v13[1],v23[1],gmAv); H2A := H1(w1+w2+w3,vector([0,-inA])); inB := gH3(-v1[2],-v2[2],-v3[2],-v12[2],-v13[2],v23[2],gmBv); H2B := H1(w1+w2+w3,vector([0,+inB])); evalm(H2A + H2B); end; 9 1 Iin Exc. 6: Finding Volterra for current mirror In virtap.net, a current mirror on left is described. Current equations in nodes 1 and 2 are 2 jωC ⋅ v 1 = I in – g mA ⋅ v 1 g o ⋅ v 2 = – g mB ⋅ v 1 + + - - gmA C gmB go which in matrix form is ( g mA + jωC ) 0 g mB go ⋅ v1 v2 = I in 0 Its description for Maple is shown on the next page. (C) 1999- Timo Rahkonen, University of Oulu, Oulu, Finland 10 virtap.net: restart; with(linalg); # current mirror # IV: input position, gmXv: K1, K2, K3 of cond. X Iv := vector([ 1, 0]); gmAv := vector([ gmA, gmA*K2, gmA*K3]); gmBv := vector([ gmB, gmB*K2, gmB*K3]); # H1: lin. voltage at w with input Iin H1 := proc(w,Iin) local Y; # Y := matrix( [ [(gmA+I*w*C), 0], # node 1 [ gmB , g0] ]); # node 2 evalm( inverse(Y) &* Iin); # solve voltage vect. end; H2 := proc(w1,w2) local v1,v2,inA,inB,H2A,H2B; v1 := H1(w1,Iv); v2 := H1(w2,Iv); (C) 1999- Timo Rahkonen, University of Oulu, Oulu, Finland # distortion currents and voltages caused by them inA := gH2(v1[1],v2[1],gmAv); H2A := H1(w1+w2,vector([-inA,0])); inB := gH2(v1[1],v2[1],gmBv); H2B := H1(w1+w2,vector([0,-inB])); evalm(H2A + H2B); end; H3 := proc(w1,w2,w3) local v1,v2,v3, v23,v13,v12,inA,inB,H2A,H2B; v1 := H1(w1,Iv); v2 := H1(w2,Iv); v3 := H1(w3,Iv); v12 := H2(w1,w2); v13 := H2(w1,w3); v23 := H2(w2,w3); # distortion currs and voltages caused by M1,M2 inA := gH3(v1[1],v2[1],v3[1],v12[1],v13[1],v23[1],gmAv); H2A := H1(w1+w2+w3,vector([-inA,0])); inB := gH3(v1[1],v2[1],v3[1],v12[1],v13[1],v23[1],gmBv); H2B := H1(w1+w2+w3,vector([0,-inB])); evalm(H2A + H2B); end;