{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 7: Microwave amplifiers" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7.10: Example_10.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter 7, Problem 10\n", "clc\n", "funcprot(0)\n", "// A = p2z(R,Theta) - Convert from polar to rectangular form.\n", "// R is a matrix containing the magnitudes\n", "// Theta is a matrix containing the phase angles (in degrees).\n", "function [A] = p2z(R,Theta)\n", " A = R*exp(%i*%pi*Theta/180);\n", "endfunction\n", "\n", "// [R1, Theta1] = z2p(A1) - Display polar form of complex matrix.\n", "function [R1, Theta1] = z2p(A1)\n", " Theta1 = atan(imag(A1),real(A1))*180/%pi;\n", " R1=sqrt(real(A1)^2+imag(A1)^2)\n", "endfunction\n", "\n", "//transistor S-parameter\n", "s11=p2z(0.35,165)\n", "s12=p2z(0.035,58)\n", "s21=p2z(5.9,66)\n", "s22=p2z(0.46,-31)\n", "refs=p2z(0.68,142) //source reflection coefficient\n", "f=300e6 //frequency in hertz\n", "vce=12 //base to emitter voltage\n", "ic=4e-3 //collector current in ampere\n", "[s11m,s11a]=z2p(s11)\n", "[s22m,s22a]=z2p(s22)\n", "[s21m,s21a]=z2p(s21)\n", "[s12m,s12a]=z2p(s12)\n", "\n", "Ds=(s11*s22)-(s12*s21)\n", "[Dmag,Dang]=z2p(Ds)\n", "K=(1+Dmag^2-s11m^2-s22m^2)/(2*s21m*s12m)\n", "\n", "y=1.65\n", "r=0.85\n", "y1=0.62\n", "r1=1.2\n", "R=50\n", "\n", "//The design values of the input matching network are shown in Figures 7.10. By plotting, we get Arc AB = shunt C = j1.65 S and Arc BC = series L = j0.85 ohm\n", "C1=y/(2*%pi*f*R)\n", "L1=(r*R)/(2*%pi*f)\n", "\n", "refl=conj(s11+((s12*s21*refs)/(1-(s22*refs))))\n", "\n", "//The design values of the input matching network are shown in Figures 7.12. By plotting, we get Arc AB = shunt L = –j0.72 S and Arc BC = series C = –j1.07 ohm\n", "\n", "C2=1/(2*%pi*f*r1*R)\n", "L2=R/(2*%pi*f*y1)\n", "\n", "printf('For input matching network,\n\n')\n", "printf('C1 = %.2f pF\n',C1*10^12)\n", "printf('L1 = %.2f nH\n\n',L1*10^9)\n", "printf('For output matching network,\n\n')\n", "printf('C2 = %.2f pF\n',C2*10^12)\n", "printf('L2 = %.2f nH\n\n',L2*10^9)\n", "printf('The completed design is shown in Figure 7.12')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7.12: Example_12.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter 7, Problem 12\n", "clc\n", "\n", "Vg=200e-3 //generator voltage\n", "Zg=2000 //resistance in ohm\n", "//transistor Y-parameter\n", "Y11=1/1200\n", "Y12=0\n", "Y21=70/1200\n", "Y22=1/40000\n", "Yl=1/1000\n", "Y1=[Y11 Y12;Y21 Y22]\n", "Yf=[1/10000 -1/10000;-1/10000 1/10000]\n", "\n", "//calculation\n", "Yc=Y1+Yf\n", "dely=Yc(1,1)*Yc(2,2)-Yc(1,2)*Yc(2,1)\n", "Zin=(Yc(2,2)+Yl)/(dely+(Yc(1,1)*Yl))\n", "vin=(Zin*Vg)/(Zin+Zg)\n", "Av=-Yc(2,1)/(Yc(2,2)+Yl)\n", "vout=vin*Av\n", "\n", "printf('(a) Input impedance (Zin) = %.1f ohm\n\n',Zin)\n", "printf('(b) Gain (Av) of the circuit = %.2f\n\n',Av)\n", "printf('(c) Output voltage = %d mV\n\n',vout*10^3)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7.1: Example_1.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter 7, Problem 1\n", "clc\n", "funcprot(0)\n", "// A = p2z(R,Theta) - Convert from polar to rectangular form.\n", "// R is a matrix containing the magnitudes\n", "// Theta is a matrix containing the phase angles (in degrees).\n", "function [A] = p2z(R,Theta)\n", " A = R*exp(%i*%pi*Theta/180);\n", "endfunction\n", "\n", "// [R, Theta] = z2p(A) - Display polar form of complex matrix.\n", "function [R, Theta] = z2p(A)\n", " Theta = atan(imag(A),real(A))*180/%pi;\n", " R=sqrt(real(A)^2+imag(A)^2)\n", "endfunction\n", "\n", "//transistor s-parameter\n", "s11=p2z(0.3,160)\n", "s12=p2z(0.03,62)\n", "s21=p2z(6.1,65)\n", "s22=p2z(0.40,-38)\n", "R=50 //resistance in ohms\n", "f=150e6 //frequency in hertz\n", "vce=12 //base to emitter voltage\n", "ic=8e-3 //collector current\n", "\n", "Ds=(s11*s22)-(s12*s21)\n", "[Dmag,Dang]=z2p(Ds)\n", "[s11m,s11a]=z2p(s11)\n", "[s22m,s22a]=z2p(s22)\n", "[s21m,s21a]=z2p(s21)\n", "[s12m,s12a]=z2p(s12)\n", "K=(1+Dmag^2-s11m^2-s22m^2)/(2*s21m*s12m)\n", "B1=1+s11m^2-s22m^2-Dmag^2\n", "MAG=10*log10(s21m/s12m)+10*log10(K-sqrt(K^2-1))\n", "C2=s22-(Ds*conj(s11))\n", "[C2m,C2a]=z2p(C2)\n", "B2=1+s22m^2-s11m^2-Dmag^2\n", "reflm=(B2-sqrt(B2^2-4*C2m^2))/(2*C2m)\n", "refla=-C2a\n", "refl=p2z(reflm,refla)\n", "refs=conj(s11+((s12*s21*refl)/(1-(s22*refl))))\n", "[refsm,refsa]=z2p(refs)\n", "\n", "//since we get source and load reflection coefficient. we plot this source reflection coefficient on smith chart for getting input matching network in figure 7.1. By plotting, we get Arc AB = shunt C = j1.33 S and Arc BC = series L = j0.34 ohm.\n", "y=1.33\n", "r=0.34\n", "C1=y/(2*%pi*f*R)\n", "L1=r*R/(2*%pi*f)\n", "\n", "//we plot this load reflection coefficient on smith chart for getting input matching network in figure 7.2. By plotting, Arc AB = series C = –j1.1 ohm and Arc BC = shunt L = –j0.8 S.\n", "y1=0.8\n", "r1=1.1\n", "C2=1/(2*%pi*f*R*r1)\n", "L2=R/(2*%pi*f*y1)\n", "\n", "printf('For input matching network,\n\n')\n", "printf('C1 = %.2f pF\n',C1*10^12)\n", "printf('L1 = %.2f nH\n\n',L1*10^9)\n", "printf('For output matching network,\n\n')\n", "printf('C2 = %.2f pF\n',C2*10^12)\n", "printf('L2 = %.2f nH\n\n',L2*10^9)\n", "printf('The completed design (minus biasing network) is shown in Figure 7.3')\n", "\n", "\n", "\n", "\n", "\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7.2: Example_2.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter 7, Problem 2\n", "clc\n", "funcprot(0)\n", "// A = p2z(R,Theta) - Convert from polar to rectangular form.\n", "// R is a matrix containing the magnitudes\n", "// Theta is a matrix containing the phase angles (in degrees).\n", "function [A] = p2z(R,Theta)\n", " A = R*exp(%i*%pi*Theta/180);\n", "endfunction\n", "\n", "// [R, Theta] = z2p(A) - Display polar form of complex matrix.\n", "function [R, Theta] = z2p(A)\n", " Theta = atan(imag(A),real(A))*180/%pi;\n", " R=sqrt(real(A)^2+imag(A)^2)\n", "endfunction\n", "\n", "//transistor s-parameter\n", "s11=p2z(0.3,160)\n", "s12=p2z(0.03,62)\n", "s21=p2z(6.1,65)\n", "s22=p2z(0.40,-38)\n", "R=50 //resistance in ohms\n", "f=150e6 //frequency in hertz\n", "vce=12 //base to emitter voltage\n", "ic=8e-3 //collector current\n", "\n", "Ds=(s11*s22)-(s12*s21)\n", "[Dmag,Dang]=z2p(Ds)\n", "[s11m,s11a]=z2p(s11)\n", "[s22m,s22a]=z2p(s22)\n", "[s21m,s21a]=z2p(s21)\n", "[s12m,s12a]=z2p(s12)\n", "K=(1+Dmag^2-s11m^2-s22m^2)/(2*s21m*s12m)\n", "B1=1+s11m^2-s22m^2-Dmag^2\n", "MAG=10*log10(s21m/s12m)+10*log10(K-sqrt(K^2-1))\n", "C2=s22-(Ds*conj(s11))\n", "[C2m,C2a]=z2p(C2)\n", "B2=1+s22m^2-s11m^2-Dmag^2\n", "reflm=(B2-sqrt(B2^2-4*C2m^2))/(2*C2m)\n", "refla=-C2a\n", "refl=p2z(reflm,refla)\n", "refs=conj(s11+((s12*s21*refl)/(1-(s22*refl))))\n", "[refsm,refsa]=z2p(refs)\n", "\n", "a=s21m^2*(1-refsm^2)*(1-reflm^2)\n", "b=((1-s11*refs)*(1-s22*refl))-(s12*s21*refl*refs)\n", "[bm,ba]=z2p(b)\n", "Gt=a/bm^2\n", "Gt_db=10*log10(Gt)\n", "printf('Transducer gain = %.2f dB',Gt_db)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7.3: Example_3.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter 7, Problem 3\n", "clc\n", "funcprot(0)\n", "// A = p2z(R,Theta) - Convert from polar to rectangular form.\n", "// R is a matrix containing the magnitudes\n", "// Theta is a matrix containing the phase angles (in degrees).\n", "function [A] = p2z(R,Theta)\n", " A = R*exp(%i*%pi*Theta/180);\n", "endfunction\n", "\n", "// [R1, Theta1] = z2p(A1) - Display polar form of complex matrix.\n", "function [R1, Theta1] = z2p(A1)\n", " Theta1 = atan(imag(A1),real(A1))*180/%pi;\n", " R1=sqrt(real(A1)^2+imag(A1)^2)\n", "endfunction\n", "\n", "//transistor s-parameter\n", "s11=p2z(0.3,140)\n", "s12=p2z(0.03,65)\n", "s21=p2z(2.1,62)\n", "s22=p2z(0.40,-38)\n", "\n", "f=5e9 //frequency in hertz\n", "vce=15 //base to emitter voltage\n", "ic=10e-3 //collector current in ampere\n", "\n", "Ds=(s11*s22)-(s12*s21)\n", "[Dmag,Dang]=z2p(Ds)\n", "[s11m,s11a]=z2p(s11)\n", "[s22m,s22a]=z2p(s22)\n", "[s21m,s21a]=z2p(s21)\n", "[s12m,s12a]=z2p(s12)\n", "K=(1+Dmag^2-s11m^2-s22m^2)/(2*s21m*s12m)\n", "B1=1+s11m^2-s22m^2-Dmag^2\n", "MAG=10*log10(s21m/s12m)+10*log10(K-sqrt(K^2-1))\n", "\n", "printf('Maximum available gain (MAG) = %.1f dB ',MAG)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7.4: Example_4.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter 7, Problem 4\n", "clc\n", "funcprot(0)\n", "// A = p2z(R,Theta) - Convert from polar to rectangular form.\n", "// R is a matrix containing the magnitudes\n", "// Theta is a matrix containing the phase angles (in degrees).\n", "function [A] = p2z(R,Theta)\n", " A = R*exp(%i*%pi*Theta/180);\n", "endfunction\n", "\n", "// [R1, Theta1] = z2p(A1) - Display polar form of complex matrix.\n", "function [R1, Theta1] = z2p(A1)\n", " Theta1 = atan(imag(A1),real(A1))*180/%pi;\n", " R1=sqrt(real(A1)^2+imag(A1)^2)\n", "endfunction\n", "\n", "//transistor s-parameter\n", "s11=p2z(0.3,140)\n", "s12=p2z(0.03,65)\n", "s21=p2z(2.1,62)\n", "s22=p2z(0.40,-38)\n", "refs=p2z(0.463,-140)\n", "refl=p2z(0.486,38)\n", "[s11m,s11a]=z2p(s11)\n", "[s22m,s22a]=z2p(s22)\n", "[s21m,s21a]=z2p(s21)\n", "[s12m,s12a]=z2p(s12)\n", "[refsm,refsa]=z2p(refs)\n", "[reflm,refla]=z2p(refl)\n", "\n", "//calculation\n", "a=(s21m^2)*(1-refsm^2)*(1-reflm^2)\n", "b=((1-(s11*refs))*(1-(s22*refl))-(s12*s21*refl*refs))^2\n", "Gt=a/real(b)\n", "Gtl=10*log10(Gt)\n", "printf('Amplifier transducer gain = %.2f dB ',Gtl)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7.5: Example_5.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter 7, Problem 5\n", "clc\n", "funcprot(0)\n", "// A = p2z(R,Theta) - Convert from polar to rectangular form.\n", "// R is a matrix containing the magnitudes\n", "// Theta is a matrix containing the phase angles (in degrees).\n", "function [A] = p2z(R,Theta)\n", " A = R*exp(%i*%pi*Theta/180);\n", "endfunction\n", "\n", "// [R1, Theta1] = z2p(A1) - Display polar form of complex matrix.\n", "function [R1, Theta1] = z2p(A1)\n", " Theta1 = atan(imag(A1),real(A1))*180/%pi;\n", " R1=sqrt(real(A1)^2+imag(A1)^2)\n", "endfunction\n", "\n", "//transistor s-parameter\n", "s11=p2z(0.28,-58)\n", "s12=p2z(0.08,92)\n", "s21=p2z(2.1,65)\n", "s22=p2z(0.8,-30)\n", "f=1e9 //frequency in hertz\n", "vce=15 //collector to emitter voltage\n", "ic=5e-3 //collector current in ampere\n", "Zs=35-%i*60 //source impedance in ohm\n", "Zl=50-%i*50 //load impedance in ohm\n", "K=1.168 //Rollett stability factor\n", "g=7.94 //desired gain\n", "R=50 //resistance in ohm\n", "\n", "[s11m,s11a]=z2p(s11)\n", "[s22m,s22a]=z2p(s22)\n", "[s21m,s21a]=z2p(s21)\n", "[s12m,s12a]=z2p(s12)\n", "\n", "Ds=s11*s22-s12*s21\n", "[Dsm,Dsa]=z2p(Ds)\n", "D2=s22m^2-Dsm^2\n", "C2=s22-(Ds*conj(s11))\n", "G=g/s21m^2\n", "ro=(G*conj(C2))/(1+(D2*G))\n", "po=sqrt(1-(2*K*s12m*s21m*G)+(s12m*s21m)^2*G^2)/(1+(D2*G))\n", "\n", "//The Smith chart construction is shown in Figure 7.5. The transistor’s output network must transform the actual load impedance into a value that falls on the constant gain 9 dB circle. By plotting, we get Arc AB = series C = –j2.0 ohm and Arc BC = shunt L = –j0.41 S\n", "r=2\n", "y=0.4\n", "C1=1/(2*%pi*f*r*R)\n", "L1=R/(2*%pi*f*y)\n", "\n", "//For a conjugate match at the input to the transistor, the desired source reflection coefficient must be calculated as follows\n", "refl=p2z(0.82,13) //point C in figure 7.5\n", "refs=conj(s11+((s12*s21*refl)/(1-(s22*refl))))\n", "[refsm,refsa]=z2p(refs)\n", "\n", "//The point is plotted as point D in Figure 7.6. The actual normalised source impedance is plotted at point A (0.7 – j1.2) ohm. The input network must transform the actual impedance at point A to the desired impedance at point D. we get Arc AB = shunt C2 = j0.63 S, Arc BC = series L2 = j1.08 ohm, Arc CD = shunt C3 = j2.15 S\n", "\n", "y1=0.63\n", "r1=1.08\n", "y2=2.15\n", "\n", "C2=y1/(2*%pi*f*R)\n", "L2=r1*R/(2*%pi*f)\n", "C3=y2/(2*%pi*f*R)\n", "\n", "printf('For output matching network,\n\n')\n", "printf('C1 = %.2f pF\n',C1*10^12)\n", "printf('L1 = %.1f nH\n\n',L1*10^9)\n", "printf('For input matching network,\n\n')\n", "printf('C2 = %.1f pF\n',C2*10^12)\n", "printf('L2 = %.1f nH\n\n',L2*10^9)\n", "printf('C3 = %.1f pF\n',C3*10^12)\n", "printf('The completed design (minus biasing network) is shown in Figure 7.7')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7.6: Example_6.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter 7, Problem 6\n", "clc\n", "funcprot(0)\n", "// A = p2z(R,Theta) - Convert from polar to rectangular form.\n", "// R is a matrix containing the magnitudes\n", "// Theta is a matrix containing the phase angles (in degrees).\n", "function [A] = p2z(R,Theta)\n", " A = R*exp(%i*%pi*Theta/180);\n", "endfunction\n", "\n", "// [R1, Theta1] = z2p(A1) - Display polar form of complex matrix.\n", "function [R1, Theta1] = z2p(A1)\n", " Theta1 = atan(imag(A1),real(A1))*180/%pi;\n", " R1=sqrt(real(A1)^2+imag(A1)^2)\n", "endfunction\n", "\n", "//transistor s-parameter\n", "s11=p2z(0.28,-58)\n", "s12=p2z(0.08,92)\n", "s21=p2z(2.1,65)\n", "s22=p2z(0.8,-30)\n", "Ds=p2z(0.333,-60.66)\n", "C2=p2z(0.719,-33.42)\n", "D2=0.529 //angle in degree\n", "K=1.168 //Rollett stability factor\n", "A=6.31 //desired gain\n", "[s11m,s11a]=z2p(s11)\n", "[s22m,s22a]=z2p(s22)\n", "[s21m,s21a]=z2p(s21)\n", "[s12m,s12a]=z2p(s12)\n", "\n", "//calculating the radius of constant gain circle of 9 dB \n", "G=A/s21m^2\n", "ro=conj(G*C2)/(1+(D2*G))\n", "[rom,roa]=z2p(ro)\n", "po=sqrt(1-(2*K*G*s12m*s21m)+((s12m*s21m)^2*G^2))/(1+(D2*G))\n", "\n", "printf('Constant gain circle of 8 dB = %.3f ',po)" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7.7: Example_7.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter 7, Problem 7\n", "clc\n", "funcprot(0)\n", "// A = p2z(R,Theta) - Convert from polar to rectangular form.\n", "// R is a matrix containing the magnitudes\n", "// Theta is a matrix containing the phase angles (in degrees).\n", "function [A] = p2z(R,Theta)\n", " A = R*exp(%i*%pi*Theta/180);\n", "endfunction\n", "\n", "// [R1, Theta1] = z2p(A1) - Display polar form of complex matrix.\n", "function [R1, Theta1] = z2p(A1)\n", " Theta1 = atan(imag(A1),real(A1))*180/%pi;\n", " R1=sqrt(real(A1)^2+imag(A1)^2)\n", "endfunction\n", "\n", "//transistor S-parameter\n", "s11=p2z(0.4,280)\n", "s12=p2z(0.048,65)\n", "s21=p2z(5.4,103)\n", "s22=p2z(0.78,345)\n", "f=200e6 //frequency in hertz\n", "vce=6 //collector to emitter voltage\n", "ic=5e-3 //collector current in ampere\n", "\n", "[s11m,s11a]=z2p(s11)\n", "[s22m,s22a]=z2p(s22)\n", "[s21m,s21a]=z2p(s21)\n", "[s12m,s12a]=z2p(s12)\n", "\n", "Ds=(s11*s22)-(s12*s21)\n", "[Dmag,Dang]=z2p(Ds)\n", "K=(1+Dmag^2-s11m^2-s22m^2)/(2*s21m*s12m)\n", "C1=s11-(Ds*conj(s22))\n", "[C1m,C1a]=z2p(C1)\n", "C2=s22-(Ds*conj(s11))\n", "[C2m,C2a]=z2p(C2)\n", "rs1=conj(C1)/(s11m^2-Dmag^2)\n", "[rs1m,rs1a]=z2p(rs1)\n", "ps1=s12*s21/(s11m^2-Dmag^2)\n", "[ps1m,ps1a]=z2p(ps1)\n", "\n", "rs2=conj(C2)/(s22m^2-Dmag^2)\n", "[rs2m,rs2a]=z2p(rs2)\n", "ps2=s12*s21/(s22m^2-Dmag^2)\n", "[ps2m,ps2a]=z2p(ps2)\n", "\n", "printf('Centre of input stability circle (magnitude) = %.3f \n\t\t\t\t(angle) = %.2f degree\n',rs1m,rs1a)\n", "printf('Radius of input stability circle = %.2f \n\n',ps1m)\n", "printf('Centre of output stability circle (magnitude) = %.3f \n\t\t\t\t(angle) = %.2f degree\n',rs2m,rs2a)\n", "printf('Radius of output stability circle = %.2f \n\n',ps2m)\n", "printf('Using these points, plotting a circle on smith chart as shown on Fig 7.9,\n,with the help of these we will get\n')\n", "printf('load reflection coefficient = 0.89 (magnitude) , 70 (degree)\n Source reflection coefficient = 0.678 (magnitude), 79.4 (degree)')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7.8: Example_8.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter 7, Problem 8\n", "clc\n", "funcprot(0)\n", "// A = p2z(R,Theta) - Convert from polar to rectangular form.\n", "// R is a matrix containing the magnitudes\n", "// Theta is a matrix containing the phase angles (in degrees).\n", "function [A] = p2z(R,Theta)\n", " A = R*exp(%i*%pi*Theta/180);\n", "endfunction\n", "\n", "// [R1, Theta1] = z2p(A1) - Display polar form of complex matrix.\n", "function [R1, Theta1] = z2p(A1)\n", " Theta1 = atan(imag(A1),real(A1))*180/%pi;\n", " R1=sqrt(real(A1)^2+imag(A1)^2)\n", "endfunction\n", "\n", "//transistor S-parameter\n", "s11=p2z(0.4,280)\n", "s12=p2z(0.048,65)\n", "s21=p2z(5.4,103)\n", "s22=p2z(0.78,345)\n", "ro=p2z(0.287,24) //centre of gain circle\n", "po=0.724 //radius of 12dB constant gain circle\n", "f=200e6 //frequency in hertz\n", "vce=6 //base to emitter voltage\n", "ic=5e-3 //collector current\n", "A=15.85 //gain desired \n", "K=0.802 //Rollett's stability factor\n", "C2=p2z(0.651,24.1)\n", "\n", "[s11m,s11a]=z2p(s11)\n", "[s22m,s22a]=z2p(s22)\n", "[s21m,s21a]=z2p(s21)\n", "[s12m,s12a]=z2p(s12)\n", "Ds=(s11*s22)-(s12*s21)\n", "[Dmag,Dang]=z2p(Ds)\n", "G=A/s21m^2\n", "D2=s22m^2-Dmag^2\n", "ro=C2*G/(1+(D2*G))\n", "[rom,roa]=z2p(ro)\n", "po1=sqrt(1-(2*K*G*abs(s12m*s21m))+((abs(s12m*s21m))^2*G^2))/(1+(D2*G))\n", "\n", "printf('ro (magnitude) = %.3f\n\t (angle) = %.3f degree\n\n',rom,roa)\n", "printf('po = %.3f \n\n',po1)\n", "disp('There the values are correct')" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7.9: Example_9.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chapter 7, Problem 9\n", "clc\n", "funcprot(0)\n", "// A = p2z(R,Theta) - Convert from polar to rectangular form.\n", "// R is a matrix containing the magnitudes\n", "// Theta is a matrix containing the phase angles (in degrees).\n", "function [A] = p2z(R,Theta)\n", " A = R*exp(%i*%pi*Theta/180);\n", "endfunction\n", "\n", "// [R1, Theta1] = z2p(A1) - Display polar form of complex matrix.\n", "function [R1, Theta1] = z2p(A1)\n", " Theta1 = atan(imag(A1),real(A1))*180/%pi;\n", " R1=sqrt(real(A1)^2+imag(A1)^2)\n", "endfunction\n", "\n", "//transistor S parameter\n", "s11=p2z(0.4,280)\n", "s12=p2z(0.048,65)\n", "s21=p2z(5.4,103)\n", "s22=p2z(0.78,345)\n", "rs=p2z(0.678,79.4) //source reflection coefficient\n", "rl=p2z(0.89,70) //load reflection coefficient\n", "\n", "Rs=conj(s11+((s12*s21*rl)/(1-(s22*rl))))\n", "[Rsm,Rsa]=z2p(Rs)\n", "printf('Source reflection coefficient, magnitude = %.3f \n\t\t\t\t angle = %.1f degree',Rsm,Rsa)" ] } ], "metadata": { "kernelspec": { "display_name": "Scilab", "language": "scilab", "name": "scilab" }, "language_info": { "file_extension": ".sce", "help_links": [ { "text": "MetaKernel Magics", "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" } ], "mimetype": "text/x-octave", "name": "scilab", "version": "0.7.1" } }, "nbformat": 4, "nbformat_minor": 0 }