Match mixer LO input and RF output to 50 ohms

This commit is contained in:
Kelvin Ly 2019-04-14 02:59:21 -04:00
parent 5786d3573c
commit 4fb7daebca
7 changed files with 788 additions and 2 deletions

2
sim/.gitignore vendored
View File

@ -1,3 +1,5 @@
.ipynb_checkpoints
*.dat
*.dpl
__pycache__/
*.pyc

2
sim/README.md Normal file
View File

@ -0,0 +1,2 @@
Basically a lot of simulations used for designing different stages of the discrete transceiver.
It's an agglomeration of Qucs simulations with Jupyter notebooks, so you'll want those two programs to examine this stuff

163
sim/bfu520_mixer.sch Normal file
View File

@ -0,0 +1,163 @@
<Qucs Schematic 0.0.19>
<Properties>
<View=0,-203,1784,940,1,40,316>
<Grid=10,10,1>
<DataSet=bfu520_mixer.dat>
<DataDisplay=bfu520_mixer.dpl>
<OpenDisplay=1>
<Script=bfu520_mixer.m>
<RunScript=0>
<showFrame=0>
<FrameText0=Title>
<FrameText1=Drawn By:>
<FrameText2=Date:>
<FrameText3=Revision:>
</Properties>
<Symbol>
</Symbol>
<Components>
<Pac P1 1 50 450 18 -26 0 1 "1" 1 "50 Ohm" 1 "0 dBm" 0 "915 MHz" 0 "26.85" 0>
<.DC DC1 1 400 720 0 38 0 0 "26.85" 0 "0.001" 0 "1 pA" 0 "1 uV" 0 "no" 0 "150" 0 "no" 0 "none" 0 "CroutLU" 0>
<.SP SP1 1 130 710 0 61 0 0 "lin" 1 "100 MHz" 1 "2 GHz" 1 "50" 1 "no" 0 "1" 0 "2" 0 "no" 0 "no" 0>
<Eqn Eqn1 1 940 720 -31 15 0 0 "ileft=5e-3+I1" 1 "yes" 0>
<Eqn Eqn2 1 940 810 -31 15 0 0 "iright=5e-3-I1" 1 "yes" 0>
<.SW SW1 1 650 730 0 61 0 0 "SP1" 1 "lin" 1 "I1" 1 "-5 mA" 1 "5 mA" 1 "11" 1>
<SPICE X2 1 390 200 -26 -89 1 2 "/home/kelvin/repos/ism-915mhz-transceiver/sim/models/BFU520XR_SPICE_GP.PRM" 1 "_net1,_net2,_net3" 0 "yes" 0 "none" 0>
<SPICE X1 1 550 200 -26 -89 0 0 "/home/kelvin/repos/ism-915mhz-transceiver/sim/models/BFU520XR_SPICE_GP.PRM" 1 "_net1,_net2,_net3" 0 "yes" 0 "none" 0>
<SPICE X3 1 930 200 -26 -89 0 0 "/home/kelvin/repos/ism-915mhz-transceiver/sim/models/BFU520XR_SPICE_GP.PRM" 1 "_net1,_net2,_net3" 0 "yes" 0 "none" 0>
<SPICE X4 1 800 200 -26 -89 1 2 "/home/kelvin/repos/ism-915mhz-transceiver/sim/models/BFU520XR_SPICE_GP.PRM" 1 "_net1,_net2,_net3" 0 "yes" 0 "none" 0>
<GND * 1 390 290 0 0 0 0>
<GND * 1 550 290 0 0 0 0>
<GND * 1 620 300 0 0 0 0>
<GND * 1 730 300 0 0 0 0>
<GND * 1 800 290 0 0 0 0>
<GND * 1 930 290 0 0 0 0>
<GND * 1 990 290 0 0 0 0>
<GND * 1 320 300 0 0 0 0>
<L L1 1 530 -20 -26 10 0 0 "100 nH" 1 "" 0>
<L L2 1 790 -20 -26 10 0 0 "100 nH" 1 "" 0>
<Idc I1 1 470 340 -69 -26 0 3 "ileft" 1>
<Idc I2 1 860 330 -69 -26 0 3 "iright" 1>
<GND * 1 470 400 0 0 0 0>
<GND * 1 860 390 0 0 0 0>
<Vdc V1 1 240 -120 18 -26 0 1 "5 V" 1>
<GND * 1 240 -60 0 0 0 0>
<R R2 1 320 220 -93 -26 1 1 "3 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R1 1 320 120 -93 -26 1 1 "2 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R4 1 620 120 -93 -26 1 1 "2 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R5 1 730 120 -93 -26 1 1 "2 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R3 1 620 250 -93 -26 1 1 "3k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R6 1 730 250 16 -26 0 1 "3k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R8 1 990 220 15 -26 0 1 "3k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R7 1 990 110 15 -26 0 1 "2k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<Pac P2 1 910 -140 18 -26 0 1 "2" 1 "50 Ohm" 1 "0 dBm" 0 "915 MHz" 0 "26.85" 0>
<C C6 1 810 -110 -26 17 0 0 "100 pF" 1 "" 0 "neutral" 0>
<C C5 1 710 -170 -26 17 0 0 "100 pF" 1 "" 0 "neutral" 0>
<R R9 1 630 -110 -26 16 1 2 "330 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<C C3 1 360 530 -26 17 0 0 "100 pF" 1 "" 0 "neutral" 0>
<C C4 1 370 610 -26 17 0 0 "100 pF" 1 "" 0 "neutral" 0>
<C C2 1 190 270 -26 17 0 0 "100 pF" 1 "" 0 "neutral" 0>
<C C1 1 230 350 -26 17 0 0 "100 pF" 1 "" 0 "neutral" 0>
<R R10 1 110 270 -26 15 0 0 "33 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R11 1 120 350 -26 15 0 0 "33 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R12 1 140 530 -26 15 0 0 "33 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R13 1 150 610 -26 15 0 0 "33 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
</Components>
<Wires>
<420 40 420 170 "" 0 0 0 "">
<900 40 900 170 "" 0 0 0 "">
<830 70 830 170 "" 0 0 0 "">
<520 70 520 170 "" 0 0 0 "">
<560 -20 590 -20 "" 0 0 0 "">
<520 70 590 70 "" 0 0 0 "">
<590 70 830 70 "" 0 0 0 "">
<590 -20 590 70 "" 0 0 0 "">
<420 40 680 40 "" 0 0 0 "">
<440 -20 500 -20 "" 0 0 0 "">
<440 -60 440 -20 "" 0 0 0 "">
<860 -60 860 -20 "" 0 0 0 "">
<820 -20 860 -20 "" 0 0 0 "">
<680 40 900 40 "" 0 0 0 "">
<680 -20 680 40 "" 0 0 0 "">
<680 -20 760 -20 "" 0 0 0 "">
<730 -60 860 -60 "" 0 0 0 "">
<730 -60 730 90 "" 0 0 0 "">
<440 -60 620 -60 "" 0 0 0 "">
<620 -60 730 -60 "" 0 0 0 "">
<620 -60 620 90 "" 0 0 0 "">
<320 -60 440 -60 "" 0 0 0 "">
<320 -60 320 90 "" 0 0 0 "">
<860 -60 990 -60 "" 0 0 0 "">
<990 -60 990 80 "" 0 0 0 "">
<990 250 990 290 "" 0 0 0 "">
<930 260 930 290 "" 0 0 0 "">
<800 260 800 290 "" 0 0 0 "">
<730 280 730 300 "" 0 0 0 "">
<620 280 620 300 "" 0 0 0 "">
<550 260 550 290 "" 0 0 0 "">
<390 260 390 290 "" 0 0 0 "">
<320 250 320 300 "" 0 0 0 "">
<320 150 320 170 "" 0 0 0 "">
<320 170 320 190 "" 0 0 0 "">
<320 170 360 170 "" 0 0 0 "">
<620 150 620 170 "" 0 0 0 "">
<620 170 620 220 "" 0 0 0 "">
<580 170 620 170 "" 0 0 0 "">
<730 150 730 170 "" 0 0 0 "">
<730 170 730 220 "" 0 0 0 "">
<730 170 770 170 "" 0 0 0 "">
<990 140 990 170 "" 0 0 0 "">
<990 170 990 190 "" 0 0 0 "">
<960 170 990 170 "" 0 0 0 "">
<830 230 860 230 "" 0 0 0 "">
<860 230 900 230 "" 0 0 0 "">
<860 230 860 300 "" 0 0 0 "">
<860 360 860 390 "" 0 0 0 "">
<470 370 470 400 "" 0 0 0 "">
<420 230 470 230 "" 0 0 0 "">
<470 230 520 230 "" 0 0 0 "">
<470 230 470 310 "" 0 0 0 "">
<240 -170 240 -150 "" 0 0 0 "">
<240 -170 320 -170 "" 0 0 0 "">
<320 -170 320 -60 "" 0 0 0 "">
<240 -90 240 -60 "" 0 0 0 "">
<230 170 320 170 "" 0 0 0 "">
<700 170 730 170 "" 0 0 0 "">
<700 170 700 450 "" 0 0 0 "">
<320 450 700 450 "" 0 0 0 "">
<620 170 670 170 "" 0 0 0 "">
<990 170 1140 170 "" 0 0 0 "">
<680 -110 680 -20 "" 0 0 0 "">
<680 -110 780 -110 "" 0 0 0 "">
<840 -110 910 -110 "" 0 0 0 "">
<740 -170 910 -170 "" 0 0 0 "">
<590 -170 680 -170 "" 0 0 0 "">
<660 -110 680 -110 "" 0 0 0 "">
<590 -170 590 -110 "" 0 0 0 "">
<590 -110 590 -20 "" 0 0 0 "">
<590 -110 600 -110 "" 0 0 0 "">
<670 170 670 530 "" 0 0 0 "">
<390 530 670 530 "" 0 0 0 "">
<1140 170 1140 610 "" 0 0 0 "">
<400 610 1140 610 "" 0 0 0 "">
<230 170 230 270 "" 0 0 0 "">
<220 270 230 270 "" 0 0 0 "">
<320 350 320 450 "" 0 0 0 "">
<260 350 320 350 "" 0 0 0 "">
<50 270 50 350 "" 0 0 0 "">
<170 530 330 530 "" 0 0 0 "">
<180 610 340 610 "" 0 0 0 "">
<50 610 120 610 "" 0 0 0 "">
<50 480 50 530 "" 0 0 0 "">
<50 530 50 610 "" 0 0 0 "">
<50 530 110 530 "" 0 0 0 "">
<50 350 50 420 "" 0 0 0 "">
<50 350 90 350 "" 0 0 0 "">
<150 350 200 350 "" 0 0 0 "">
<140 270 160 270 "" 0 0 0 "">
<50 270 80 270 "" 0 0 0 "">
</Wires>
<Diagrams>
</Diagrams>
<Paintings>
</Paintings>

215
sim/mixer_large_signal.sch Normal file
View File

@ -0,0 +1,215 @@
<Qucs Schematic 0.0.19>
<Properties>
<View=-141,-450,1854,941,0.751316,180,0>
<Grid=10,10,1>
<DataSet=mixer_large_signal.dat>
<DataDisplay=mixer_large_signal.dpl>
<OpenDisplay=1>
<Script=mixer_large_signal.m>
<RunScript=0>
<showFrame=0>
<FrameText0=Title>
<FrameText1=Drawn By:>
<FrameText2=Date:>
<FrameText3=Revision:>
</Properties>
<Symbol>
</Symbol>
<Components>
<.DC DC1 1 400 720 0 38 0 0 "26.85" 0 "0.001" 0 "1 pA" 0 "1 uV" 0 "no" 0 "150" 0 "no" 0 "none" 0 "CroutLU" 0>
<.SP SP1 0 130 710 0 61 0 0 "lin" 1 "100 MHz" 1 "2 GHz" 1 "50" 1 "no" 0 "1" 0 "2" 0 "no" 0 "no" 0>
<Eqn Eqn1 1 940 720 -31 15 0 0 "ileft=10e-3+I1" 1 "yes" 0>
<Eqn Eqn2 1 940 810 -31 15 0 0 "iright=10e-3-I1" 1 "yes" 0>
<.SW SW1 0 650 730 0 61 0 0 "SP1" 1 "lin" 1 "I1" 1 "-5 mA" 1 "5 mA" 1 "11" 1>
<SPICE X2 1 680 210 -26 -89 1 2 "/home/kelvin/repos/ism-915mhz-transceiver/sim/models/BFU520XR_SPICE_GP.PRM" 1 "_net1,_net2,_net3" 0 "yes" 0 "none" 0>
<SPICE X1 1 840 210 -26 -89 0 0 "/home/kelvin/repos/ism-915mhz-transceiver/sim/models/BFU520XR_SPICE_GP.PRM" 1 "_net1,_net2,_net3" 0 "yes" 0 "none" 0>
<SPICE X3 1 1220 210 -26 -89 0 0 "/home/kelvin/repos/ism-915mhz-transceiver/sim/models/BFU520XR_SPICE_GP.PRM" 1 "_net1,_net2,_net3" 0 "yes" 0 "none" 0>
<SPICE X4 1 1090 210 -26 -89 1 2 "/home/kelvin/repos/ism-915mhz-transceiver/sim/models/BFU520XR_SPICE_GP.PRM" 1 "_net1,_net2,_net3" 0 "yes" 0 "none" 0>
<GND * 1 680 300 0 0 0 0>
<GND * 1 840 300 0 0 0 0>
<GND * 1 910 310 0 0 0 0>
<GND * 1 1020 310 0 0 0 0>
<GND * 1 1090 300 0 0 0 0>
<GND * 1 1220 300 0 0 0 0>
<GND * 1 1280 300 0 0 0 0>
<GND * 1 610 310 0 0 0 0>
<L L1 1 820 -10 -26 10 0 0 "100 nH" 1 "" 0>
<L L2 1 1080 -10 -26 10 0 0 "100 nH" 1 "" 0>
<Idc I1 1 760 350 -69 -26 0 3 "ileft" 1>
<Idc I2 1 1150 340 -69 -26 0 3 "iright" 1>
<GND * 1 760 410 0 0 0 0>
<GND * 1 1150 400 0 0 0 0>
<Vdc V1 1 530 -110 18 -26 0 1 "5 V" 1>
<GND * 1 530 -50 0 0 0 0>
<R R2 1 610 230 -93 -26 1 1 "3 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R1 1 610 130 -93 -26 1 1 "2 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R4 1 910 130 -93 -26 1 1 "2 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R5 1 1020 130 -93 -26 1 1 "2 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R3 1 910 260 -93 -26 1 1 "3k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R6 1 1020 260 16 -26 0 1 "3k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R8 1 1280 230 15 -26 0 1 "3k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R7 1 1280 120 15 -26 0 1 "2k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R9 1 920 -100 -26 16 1 2 "330 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<C C3 1 750 540 -26 17 0 0 "100 pF" 1 "" 0 "neutral" 0>
<C C4 1 740 620 -26 17 0 0 "100 pF" 1 "" 0 "neutral" 0>
<L L3 1 190 420 -26 10 0 0 "12 nH" 1 "" 0>
<L L4 1 190 560 -26 10 0 0 "12 nH" 1 "" 0>
<L L5 1 350 420 -26 10 0 0 "27 nH" 1 "" 0>
<L L6 1 350 560 -26 10 0 0 "27 nH" 1 "" 0>
<C C7 1 270 500 17 -26 0 1 "1.2 pF" 1 "" 0 "neutral" 0>
<L L7 1 920 -170 -26 10 0 0 "12 nH" 1 "" 0>
<R R11 1 1140 -240 16 -26 1 3 "1k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<Eqn Eqn3 1 1070 680 -31 15 0 0 "I1=8e-3" 1 "yes" 0>
<R R12 1 1250 -240 15 -26 0 1 "50 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<GND * 1 1200 -180 0 0 0 0>
<.TR TR1 1 -40 720 0 61 0 0 "lin" 1 "0" 1 "50 ns" 1 "1000" 0 "Gear" 0 "2" 0 "1 ns" 0 "1e-16" 0 "150" 0 "0.001" 0 "1 pA" 0 "1 uV" 0 "26.85" 0 "1e-3" 0 "1e-6" 0 "1" 0 "CroutLU" 0 "no" 0 "yes" 0 "0" 0>
<C C1 1 560 360 -26 17 0 0 "100 pF" 1 "" 0 "neutral" 0>
<C C2 1 550 180 -26 17 0 0 "100 pF" 1 "" 0 "neutral" 0>
<R R16 1 490 180 -26 15 0 0 "33 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R17 1 500 360 -26 15 0 0 "33 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R18 1 660 540 -26 15 0 0 "33 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R19 1 660 620 -26 15 0 0 "33 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<Pac P1 1 80 490 18 -26 0 1 "1" 1 "50 Ohm" 1 "-2 dBm" 0 "915 MHz" 0 "26.85" 0>
<GND * 1 60 600 0 0 0 0>
<R R20 1 -110 490 15 -26 0 1 "1k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<C C8 1 -20 420 -26 17 0 0 "1.2 pF" 1 "" 0 "neutral" 0>
<C C9 1 -20 560 -26 17 0 0 "1.2 pF" 1 "" 0 "neutral" 0>
<R R21 1 790 -90 -26 15 0 0 "10k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "US" 0>
<R R22 1 1050 -100 -26 15 0 0 "10k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "US" 0>
<C C5 1 1050 -280 -26 17 0 0 "3.8 pF" 1 "" 0 "neutral" 0>
<C C6 1 1050 -210 -26 17 0 0 "3.8 pF" 1 "" 0 "neutral" 0>
</Components>
<Wires>
<710 50 710 180 "" 0 0 0 "">
<1190 50 1190 180 "" 0 0 0 "">
<1120 80 1120 180 "" 0 0 0 "">
<810 80 810 180 "" 0 0 0 "">
<850 -10 880 -10 "" 0 0 0 "">
<810 80 880 80 "" 0 0 0 "">
<880 80 1120 80 "" 0 0 0 "">
<880 -10 880 80 "" 0 0 0 "">
<710 50 970 50 "" 0 0 0 "">
<730 -10 790 -10 "" 0 0 0 "">
<730 -50 730 -10 "" 0 0 0 "">
<1150 -50 1150 -10 "" 0 0 0 "">
<1110 -10 1150 -10 "" 0 0 0 "">
<970 50 1190 50 "" 0 0 0 "">
<970 -10 970 50 "" 0 0 0 "">
<970 -10 1050 -10 "" 0 0 0 "">
<1020 -50 1130 -50 "" 0 0 0 "">
<1020 -50 1020 100 "" 0 0 0 "">
<730 -50 910 -50 "" 0 0 0 "">
<910 -50 1020 -50 "" 0 0 0 "">
<910 -50 910 100 "" 0 0 0 "">
<610 -50 690 -50 "" 0 0 0 "">
<610 -50 610 100 "" 0 0 0 "">
<1150 -50 1280 -50 "" 0 0 0 "">
<1280 -50 1280 90 "" 0 0 0 "">
<1280 260 1280 300 "" 0 0 0 "">
<1220 270 1220 300 "" 0 0 0 "">
<1090 270 1090 300 "" 0 0 0 "">
<1020 290 1020 310 "" 0 0 0 "">
<910 290 910 310 "" 0 0 0 "">
<840 270 840 300 "" 0 0 0 "">
<680 270 680 300 "" 0 0 0 "">
<610 260 610 310 "" 0 0 0 "">
<610 160 610 180 "" 0 0 0 "">
<610 180 610 200 "" 0 0 0 "">
<610 180 650 180 "" 0 0 0 "">
<910 160 910 180 "" 0 0 0 "">
<910 180 910 230 "" 0 0 0 "">
<870 180 910 180 "" 0 0 0 "">
<1020 160 1020 180 "" 0 0 0 "">
<1020 180 1020 230 "" 0 0 0 "">
<1020 180 1060 180 "" 0 0 0 "">
<1280 150 1280 180 "" 0 0 0 "">
<1280 180 1280 200 "" 0 0 0 "">
<1250 180 1280 180 "" 0 0 0 "">
<1120 240 1150 240 "" 0 0 0 "">
<1150 240 1190 240 "" 0 0 0 "">
<1150 240 1150 310 "" 0 0 0 "">
<1150 370 1150 400 "" 0 0 0 "">
<760 380 760 410 "" 0 0 0 "">
<710 240 760 240 "" 0 0 0 "">
<760 240 810 240 "" 0 0 0 "">
<760 240 760 320 "" 0 0 0 "">
<530 -160 530 -140 "" 0 0 0 "">
<530 -160 610 -160 "" 0 0 0 "">
<610 -160 610 -50 "" 0 0 0 "">
<530 -80 530 -50 "" 0 0 0 "">
<990 180 1020 180 "" 0 0 0 "">
<990 180 990 460 "" 0 0 0 "">
<610 460 990 460 "" 0 0 0 "">
<910 180 960 180 "" 0 0 0 "">
<1280 180 1430 180 "" 0 0 0 "">
<970 -100 970 -10 "" 0 0 0 "">
<950 -100 970 -100 "" 0 0 0 "">
<880 -100 880 -90 "" 0 0 0 "">
<880 -100 890 -100 "" 0 0 0 "">
<960 180 960 540 "" 0 0 0 "">
<780 540 960 540 "" 0 0 0 "">
<1430 180 1430 620 "" 0 0 0 "">
<770 620 1430 620 "" 0 0 0 "">
<220 420 270 420 "" 0 0 0 "">
<220 560 270 560 "" 0 0 0 "">
<270 560 320 560 "" 0 0 0 "">
<270 530 270 560 "" 0 0 0 "">
<270 420 320 420 "" 0 0 0 "">
<270 420 270 470 "" 0 0 0 "">
<380 420 440 420 "" 0 0 0 "">
<380 560 440 560 "" 0 0 0 "">
<80 420 80 460 "" 0 0 0 "">
<80 420 160 420 "vin" 120 390 1 "">
<80 520 80 560 "" 0 0 0 "">
<880 -170 880 -100 "" 0 0 0 "">
<880 -170 890 -170 "" 0 0 0 "">
<970 -170 970 -100 "" 0 0 0 "">
<950 -170 970 -170 "" 0 0 0 "">
<1080 -210 1140 -210 "" 0 0 0 "">
<970 -210 970 -170 "" 0 0 0 "">
<970 -210 1020 -210 "" 0 0 0 "">
<880 -280 880 -170 "" 0 0 0 "">
<880 -280 1020 -280 "" 0 0 0 "">
<1080 -280 1140 -280 "" 0 0 0 "">
<1140 -280 1140 -270 "" 0 0 0 "">
<1140 -210 1200 -210 "" 0 0 0 "">
<1140 -280 1250 -280 "vout" 1220 -310 56 "">
<1250 -280 1250 -270 "" 0 0 0 "">
<1200 -210 1250 -210 "" 0 0 0 "">
<1200 -210 1200 -180 "" 0 0 0 "">
<80 560 160 560 "" 0 0 0 "">
<610 360 610 460 "" 0 0 0 "">
<590 360 610 360 "" 0 0 0 "">
<580 180 610 180 "" 0 0 0 "">
<440 180 460 180 "" 0 0 0 "">
<440 180 440 360 "" 0 0 0 "">
<440 360 440 420 "" 0 0 0 "">
<440 360 470 360 "" 0 0 0 "">
<440 540 440 560 "" 0 0 0 "">
<440 540 630 540 "" 0 0 0 "">
<440 560 440 620 "" 0 0 0 "">
<440 620 630 620 "" 0 0 0 "">
<690 620 710 620 "" 0 0 0 "">
<690 540 720 540 "" 0 0 0 "">
<60 560 80 560 "" 0 0 0 "">
<60 560 60 600 "" 0 0 0 "">
<-110 560 -50 560 "" 0 0 0 "">
<-110 520 -110 560 "" 0 0 0 "">
<-110 420 -110 460 "" 0 0 0 "">
<-110 420 -50 420 "" 0 0 0 "">
<10 420 80 420 "" 0 0 0 "">
<10 560 60 560 "" 0 0 0 "">
<880 -90 880 -10 "" 0 0 0 "">
<820 -90 880 -90 "" 0 0 0 "">
<690 -90 760 -90 "" 0 0 0 "">
<690 -50 730 -50 "" 0 0 0 "">
<690 -90 690 -50 "" 0 0 0 "">
<970 -100 1020 -100 "" 0 0 0 "">
<1130 -50 1150 -50 "" 0 0 0 "">
<1130 -100 1130 -50 "" 0 0 0 "">
<1080 -100 1130 -100 "" 0 0 0 "">
</Wires>
<Diagrams>
</Diagrams>
<Paintings>
</Paintings>

196
sim/mixer_match.sch Normal file
View File

@ -0,0 +1,196 @@
<Qucs Schematic 0.0.19>
<Properties>
<View=-91,-433,1854,946,0.826447,300,0>
<Grid=10,10,1>
<DataSet=mixer_match.dat>
<DataDisplay=mixer_match.dpl>
<OpenDisplay=1>
<Script=mixer_match.m>
<RunScript=0>
<showFrame=0>
<FrameText0=Title>
<FrameText1=Drawn By:>
<FrameText2=Date:>
<FrameText3=Revision:>
</Properties>
<Symbol>
</Symbol>
<Components>
<.DC DC1 1 400 720 0 38 0 0 "26.85" 0 "0.001" 0 "1 pA" 0 "1 uV" 0 "no" 0 "150" 0 "no" 0 "none" 0 "CroutLU" 0>
<.SP SP1 1 130 710 0 61 0 0 "lin" 1 "100 MHz" 1 "2 GHz" 1 "50" 1 "no" 0 "1" 0 "2" 0 "no" 0 "no" 0>
<Eqn Eqn1 1 940 720 -31 15 0 0 "ileft=5e-3+I1" 1 "yes" 0>
<Eqn Eqn2 1 940 810 -31 15 0 0 "iright=5e-3-I1" 1 "yes" 0>
<.SW SW1 1 650 730 0 61 0 0 "SP1" 1 "lin" 1 "I1" 1 "-5 mA" 1 "5 mA" 1 "11" 1>
<SPICE X2 1 680 210 -26 -89 1 2 "/home/kelvin/repos/ism-915mhz-transceiver/sim/models/BFU520XR_SPICE_GP.PRM" 1 "_net1,_net2,_net3" 0 "yes" 0 "none" 0>
<SPICE X1 1 840 210 -26 -89 0 0 "/home/kelvin/repos/ism-915mhz-transceiver/sim/models/BFU520XR_SPICE_GP.PRM" 1 "_net1,_net2,_net3" 0 "yes" 0 "none" 0>
<SPICE X3 1 1220 210 -26 -89 0 0 "/home/kelvin/repos/ism-915mhz-transceiver/sim/models/BFU520XR_SPICE_GP.PRM" 1 "_net1,_net2,_net3" 0 "yes" 0 "none" 0>
<SPICE X4 1 1090 210 -26 -89 1 2 "/home/kelvin/repos/ism-915mhz-transceiver/sim/models/BFU520XR_SPICE_GP.PRM" 1 "_net1,_net2,_net3" 0 "yes" 0 "none" 0>
<GND * 1 680 300 0 0 0 0>
<GND * 1 840 300 0 0 0 0>
<GND * 1 910 310 0 0 0 0>
<GND * 1 1020 310 0 0 0 0>
<GND * 1 1090 300 0 0 0 0>
<GND * 1 1220 300 0 0 0 0>
<GND * 1 1280 300 0 0 0 0>
<GND * 1 610 310 0 0 0 0>
<L L1 1 820 -10 -26 10 0 0 "100 nH" 1 "" 0>
<L L2 1 1080 -10 -26 10 0 0 "100 nH" 1 "" 0>
<Idc I1 1 760 350 -69 -26 0 3 "ileft" 1>
<Idc I2 1 1150 340 -69 -26 0 3 "iright" 1>
<GND * 1 760 410 0 0 0 0>
<GND * 1 1150 400 0 0 0 0>
<Vdc V1 1 530 -110 18 -26 0 1 "5 V" 1>
<GND * 1 530 -50 0 0 0 0>
<C C2 1 490 280 -26 17 0 0 "100 pF" 1 "" 0 "neutral" 0>
<C C1 1 490 360 -26 17 0 0 "100 pF" 1 "" 0 "neutral" 0>
<R R2 1 610 230 -93 -26 1 1 "3 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R1 1 610 130 -93 -26 1 1 "2 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R4 1 910 130 -93 -26 1 1 "2 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R5 1 1020 130 -93 -26 1 1 "2 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R3 1 910 260 -93 -26 1 1 "3k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R6 1 1020 260 16 -26 0 1 "3k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R8 1 1280 230 15 -26 0 1 "3k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R7 1 1280 120 15 -26 0 1 "2k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<R R9 1 920 -100 -26 16 1 2 "330 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<L L3 1 190 420 -26 10 0 0 "12 nH" 1 "" 0>
<L L4 1 190 560 -26 10 0 0 "12 nH" 1 "" 0>
<L L5 1 350 420 -26 10 0 0 "27 nH" 1 "" 0>
<L L6 1 350 560 -26 10 0 0 "27 nH" 1 "" 0>
<C C7 1 270 500 17 -26 0 1 "1.2 pF" 1 "" 0 "neutral" 0>
<Pac P1 1 80 490 18 -26 0 1 "1" 1 "50 Ohm" 1 "0 dBm" 0 "915 MHz" 0 "26.85" 0>
<R R10 1 -60 490 15 -26 0 1 "1k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<C C8 1 30 420 -26 17 0 0 "1.2 pF" 1 "" 0 "neutral" 0>
<C C9 1 30 560 -26 17 0 0 "1.2 pF" 1 "" 0 "neutral" 0>
<R R11 1 1140 -240 16 -26 1 3 "1k Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
<Pac P2 1 1250 -240 18 -26 0 1 "2" 1 "50 Ohm" 1 "0 dBm" 0 "915 MHz" 0 "26.85" 0>
<C C3 1 890 540 -26 17 0 0 "100 pF" 1 "" 0 "neutral" 0>
<C C4 1 890 620 -26 17 0 0 "100 pF" 1 "" 0 "neutral" 0>
<R R14 1 780 540 -26 15 0 0 "33 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "US" 0>
<R R15 1 790 620 -26 15 0 0 "33 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "US" 0>
<R R12 1 400 280 -26 15 0 0 "33 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "US" 0>
<R R13 1 410 360 -26 15 0 0 "33 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "US" 0>
<C C11 1 1050 -210 -26 17 0 0 "3.8 pF" 1 "" 0 "neutral" 0>
<C C10 1 1050 -280 -26 17 0 0 "3.8 pF" 1 "" 0 "neutral" 0>
<L L7 1 920 -210 -26 10 0 0 "12 nH" 1 "" 0>
</Components>
<Wires>
<710 50 710 180 "" 0 0 0 "">
<1190 50 1190 180 "" 0 0 0 "">
<1120 80 1120 180 "" 0 0 0 "">
<810 80 810 180 "" 0 0 0 "">
<850 -10 880 -10 "" 0 0 0 "">
<810 80 880 80 "" 0 0 0 "">
<880 80 1120 80 "" 0 0 0 "">
<880 -10 880 80 "" 0 0 0 "">
<710 50 970 50 "" 0 0 0 "">
<730 -10 790 -10 "" 0 0 0 "">
<730 -50 730 -10 "" 0 0 0 "">
<1150 -50 1150 -10 "" 0 0 0 "">
<1110 -10 1150 -10 "" 0 0 0 "">
<970 50 1190 50 "" 0 0 0 "">
<970 -10 970 50 "" 0 0 0 "">
<970 -10 1050 -10 "" 0 0 0 "">
<1020 -50 1150 -50 "" 0 0 0 "">
<1020 -50 1020 100 "" 0 0 0 "">
<730 -50 910 -50 "" 0 0 0 "">
<910 -50 1020 -50 "" 0 0 0 "">
<910 -50 910 100 "" 0 0 0 "">
<610 -50 730 -50 "" 0 0 0 "">
<610 -50 610 100 "" 0 0 0 "">
<1150 -50 1280 -50 "" 0 0 0 "">
<1280 -50 1280 90 "" 0 0 0 "">
<1280 260 1280 300 "" 0 0 0 "">
<1220 270 1220 300 "" 0 0 0 "">
<1090 270 1090 300 "" 0 0 0 "">
<1020 290 1020 310 "" 0 0 0 "">
<910 290 910 310 "" 0 0 0 "">
<840 270 840 300 "" 0 0 0 "">
<680 270 680 300 "" 0 0 0 "">
<610 260 610 310 "" 0 0 0 "">
<610 160 610 180 "" 0 0 0 "">
<610 180 610 200 "" 0 0 0 "">
<610 180 650 180 "" 0 0 0 "">
<910 160 910 180 "" 0 0 0 "">
<910 180 910 230 "" 0 0 0 "">
<870 180 910 180 "" 0 0 0 "">
<1020 160 1020 180 "" 0 0 0 "">
<1020 180 1020 230 "" 0 0 0 "">
<1020 180 1060 180 "" 0 0 0 "">
<1280 150 1280 180 "" 0 0 0 "">
<1280 180 1280 200 "" 0 0 0 "">
<1250 180 1280 180 "" 0 0 0 "">
<1120 240 1150 240 "" 0 0 0 "">
<1150 240 1190 240 "" 0 0 0 "">
<1150 240 1150 310 "" 0 0 0 "">
<1150 370 1150 400 "" 0 0 0 "">
<760 380 760 410 "" 0 0 0 "">
<710 240 760 240 "" 0 0 0 "">
<760 240 810 240 "" 0 0 0 "">
<760 240 760 320 "" 0 0 0 "">
<530 -160 530 -140 "" 0 0 0 "">
<530 -160 610 -160 "" 0 0 0 "">
<610 -160 610 -50 "" 0 0 0 "">
<530 -80 530 -50 "" 0 0 0 "">
<520 180 520 280 "" 0 0 0 "">
<520 180 610 180 "" 0 0 0 "">
<990 180 1020 180 "" 0 0 0 "">
<990 180 990 460 "" 0 0 0 "">
<610 460 990 460 "" 0 0 0 "">
<610 360 610 460 "" 0 0 0 "">
<520 360 610 360 "" 0 0 0 "">
<910 180 960 180 "" 0 0 0 "">
<1280 180 1430 180 "" 0 0 0 "">
<970 -100 970 -10 "" 0 0 0 "">
<950 -100 970 -100 "" 0 0 0 "">
<880 -100 880 -10 "" 0 0 0 "">
<880 -100 890 -100 "" 0 0 0 "">
<220 420 270 420 "" 0 0 0 "">
<220 560 270 560 "" 0 0 0 "">
<270 560 320 560 "" 0 0 0 "">
<270 530 270 560 "" 0 0 0 "">
<270 420 320 420 "" 0 0 0 "">
<270 420 270 470 "" 0 0 0 "">
<80 420 80 460 "" 0 0 0 "">
<80 420 160 420 "" 0 0 0 "">
<160 560 170 560 "" 0 0 0 "">
<80 560 160 560 "" 0 0 0 "">
<80 520 80 560 "" 0 0 0 "">
<60 420 80 420 "" 0 0 0 "">
<60 560 80 560 "" 0 0 0 "">
<-60 560 0 560 "" 0 0 0 "">
<-60 520 -60 560 "" 0 0 0 "">
<-60 420 -60 460 "" 0 0 0 "">
<-60 420 0 420 "" 0 0 0 "">
<1080 -210 1140 -210 "" 0 0 0 "">
<880 -280 1020 -280 "" 0 0 0 "">
<1080 -280 1140 -280 "" 0 0 0 "">
<1140 -280 1140 -270 "" 0 0 0 "">
<1140 -210 1250 -210 "" 0 0 0 "">
<1140 -280 1250 -280 "" 0 0 0 "">
<1250 -280 1250 -270 "" 0 0 0 "">
<960 180 960 540 "" 0 0 0 "">
<920 540 960 540 "" 0 0 0 "">
<1430 180 1430 620 "" 0 0 0 "">
<920 620 1430 620 "" 0 0 0 "">
<380 540 380 560 "" 0 0 0 "">
<380 540 750 540 "" 0 0 0 "">
<380 620 760 620 "" 0 0 0 "">
<380 560 380 620 "" 0 0 0 "">
<380 360 380 420 "" 0 0 0 "">
<370 280 370 360 "" 0 0 0 "">
<370 360 380 360 "" 0 0 0 "">
<440 360 460 360 "" 0 0 0 "">
<430 280 460 280 "" 0 0 0 "">
<810 540 860 540 "" 0 0 0 "">
<820 620 860 620 "" 0 0 0 "">
<950 -210 970 -210 "" 0 0 0 "">
<880 -280 880 -210 "" 0 0 0 "">
<880 -210 890 -210 "" 0 0 0 "">
<880 -210 880 -100 "" 0 0 0 "">
<970 -210 1020 -210 "" 0 0 0 "">
<970 -210 970 -100 "" 0 0 0 "">
</Wires>
<Diagrams>
</Diagrams>
<Paintings>
</Paintings>

206
sim/mixer_matching.ipynb Normal file
View File

@ -0,0 +1,206 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 55,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(array([0.8645785 -0.09823784j, 0.85954376-0.10151559j,\n",
" 0.85534282-0.10389085j, 0.85223139-0.10548823j,\n",
" 0.85032448-0.10640486j, 0.84968251-0.10670324j,\n",
" 0.85032448-0.10640486j, 0.85223139-0.10548823j,\n",
" 0.85534282-0.10389085j, 0.85954376-0.10151559j,\n",
" 0.8645785 -0.09823784j]),\n",
" array([0.58060059-0.38299298j, 0.5812387 -0.39895514j,\n",
" 0.58112332-0.41153593j, 0.58070618-0.42059005j,\n",
" 0.58031978-0.42604352j, 0.58016811-0.42786419j,\n",
" 0.58031978-0.42604352j, 0.58070618-0.42059005j,\n",
" 0.58112332-0.41153593j, 0.5812387 -0.39895514j,\n",
" 0.58060059-0.38299298j]))"
]
},
"execution_count": 55,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# matching the mixer LO input and RF output to 50 ohms using the S11/S22 parameters\n",
"# calculated using Qucs\n",
"\n",
"import qucs.qucsdata as qd\n",
"data = qd.QucsData('bfu520_mixer.dat').data\n",
"\n",
"\n",
"import numpy as np\n",
"# find the index closest to 915 MHz\n",
"freqs = data['frequency']\n",
"idx = np.abs(freqs - 915e+6).argmin()\n",
"\n",
"s11s = data['S[1,1]']\n",
"s22s = data['S[2,2]']\n",
"\n",
"s11s[idx,:], s22s[idx,:]"
]
},
{
"cell_type": "code",
"execution_count": 61,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(407.8826087843155-328.42259033407754j)\n",
"834.9901269321724j\n",
"(672.324866234869+0j)\n",
"1.452380394909119e-07\n",
"407.8826087843155 152.45788592627554 133.76894422554054\n",
"5.712576904340215e-08 1.3003005258265486e-12 2.651849853388749e-08\n"
]
}
],
"source": [
"s11 = np.mean(s11s, axis=1)\n",
"s22 = np.mean(s22s, axis=1)\n",
"#print(s11)\n",
"\n",
"import skrf.network as net\n",
"\n",
"# conjugate match the source\n",
"z_s = net.s2z(np.array([[[s11[idx]]]]))[0, 0, 0]\n",
"print(z_s)\n",
"\n",
"# so it looks like it'll need a large series inductor to compensate the imaginary part, followed by a standard \n",
"# L match to 50 ohms\n",
"l_series_s = -np.imag(z_s)/(2*np.pi*915e+6)\n",
"\n",
"# how hard would it be to remove the imaginary part using a shunt element?\n",
"print(1j/np.imag(1/z_s))\n",
"print(1/(1/z_s + 1/(1j/np.imag(1/z_s))))\n",
"print(1/(np.imag(1/z_s)*2*np.pi*915e+6))\n",
"\n",
"# okay, 130 nH is pretty big so I'm going to go with the smaller series option\n",
"\n",
"r_s = np.real(z_s)\n",
"q_s = np.sqrt((r_s - 50.)/50.)\n",
"\n",
"x_1_s = r_s/q_s\n",
"x_2_s = q_s * 50.\n",
"print(r_s, x_1_s, x_2_s)\n",
"\n",
"# let's go with a shunt capacitor followed by an inductor\n",
"l_series_s2 = x_1_s/(2*np.pi*915e+6)\n",
"c_shunt_s = 1/(2*np.pi*915e+6*x_2_s)\n",
"print(l_series_s, c_shunt_s, l_series_s2)\n"
]
},
{
"cell_type": "code",
"execution_count": 62,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(407.8826087843155+0j) (39.61039510850523-120.77834197894384j) (39.61039510850523+31.679543947331695j)\n"
]
}
],
"source": [
"# double check\n",
"\n",
"z_1 = z_s + 2j*np.pi*l_series_s*915e+6\n",
"z_2 = 1/(1/z_1 + 1/(1/(2j*np.pi*915e+6*c_shunt_s)))\n",
"z_3 = z_2 + 2j*np.pi*915e+6*l_series_s2\n",
"\n",
"print(z_1, z_2, z_3)\n",
"\n",
"# TODO maybe simulate it using scikit-rf network stuff"
]
},
{
"cell_type": "code",
"execution_count": 71,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(89.46617486489218-105.51717177278026j)\n",
"1.83536387636225e-08 3.154815993634542e-08\n",
"(213.91402966297977+0j)\n",
"213.91402966297977 118.14523420131724 90.53011368129937\n",
"1.244415883537231e-08 3.842695462154556e-12\n"
]
}
],
"source": [
"# time to conjugate match the output\n",
"#z_l = net.s2z(np.array([[[s22[idx]]]]))[0, 0, 0]\n",
"z_l = net.s2z(np.array([[[0.544 - 0.345j]]]))[0, 0, 0]\n",
"\n",
"print(z_l)\n",
"\n",
"# series inductor or shunt inductor to cancel out the imaginary impedance? let's compare values like before\n",
"z_series_l = -np.imag(z_l)/(2*np.pi*915e+6)\n",
"z_shunt_l = 1/(np.imag(1/z_l))/(2*np.pi*915e+6)\n",
"\n",
"print(z_series_l, z_shunt_l)\n",
"print(1/(1/z_l + 1/(2j*np.pi*915e+6*z_shunt_l)))\n",
"\n",
"# so either a pair of 15 nH series inductors or a 47 nH shunt; let's see how to the L section looks \n",
"# before deciding here\n",
"\n",
"#r_l = np.real(z_l)\n",
"r_l = np.real(1/(1/z_l + 1/(2j*np.pi*915e+6*z_shunt_l)))\n",
"q_l = np.sqrt((r_l - 50.)/50.)\n",
"\n",
"x_1_l = r_l/q_l\n",
"x_2_l = q_l * 50.\n",
"print(r_l, x_1_l, x_2_l)\n",
"\n",
"# let's give the smaller impedance to the capacitor, so it'll be a shunt inductor\n",
"l_shunt_l = x_1_l/(2*np.pi*915e+6)\n",
"c_series_l = 1/(2*np.pi*915e+6*x_2_l)\n",
"l_shunt_total_l = 1/(1/l_shunt_l + 1/z_shunt_l)\n",
"\n",
"print(l_shunt_total_l, 2*c_series_l)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

View File

@ -53,7 +53,8 @@ class QucsData:
if '<indep' in line:
# independent variables
r = re.match(r'(\S+) (\S+) (\d+)', line.translate(None,"<>"))
stripbrackets = str.maketrans(dict.fromkeys("<>"))
r = re.match(r'(\S+) (\S+) (\d+)', line.translate(stripbrackets))
kind, identifier, size = r.groups()
# collect identifiers
self.names.append(identifier)
@ -63,7 +64,8 @@ class QucsData:
if '<dep' in line:
# dependent variables
# one or more independent, y=f(v,w,...)
r = re.findall('(\S+)', line.translate(None,"<>"))
stripbrackets = str.maketrans(dict.fromkeys("<>"))
r = re.findall('(\S+)', line.translate(stripbrackets))
identifier = r[1]
self.dependent[identifier]= r[2:]
self.names.append(identifier)