--- title: "T and Pi Attenuators" type: "article" slug: "t-and-pi-attenuators" url: "http://localhost/article/t-and-pi-attenuators/" markdown_url: "http://localhost/article/t-and-pi-attenuators.md" published_at: "2026-12-01T10:02:13+00:00" modified_at: "2026-12-01T10:02:13+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Here is a short program which will help you determine the values of resistance to use in attenuators. The program asks you for input impedance, the output impedance, and the attenuation desired. It then calculates the three resistors needed to construct either a pi or a T attenuator with the characteristics you desired. As in…" post_tag: - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" indiv: - name: "Leslie Varnicle (WA3QLW)" slug: "leslie-varnicle-wa3qlw" taxonomy: "indiv" url: "http://localhost/indiv/leslie-varnicle-wa3qlw/" publication: "QZX" publication_r: id: 21219 title: "QZX" type: "periodical" url: "http://localhost/periodical/qzx/" authors: "Leslie Varnicle (WA3QLW)" volume: "8" issue: "12" issues_articles: - id: 70170 title: "QZX v8 n12" type: "issue" url: "http://localhost/issue/qzx-v8-n12/" pages: "5-7" pubdate: "November 1990" archive_link: false volumeissue: "v8n12" --- # T and Pi Attenuators Here is a short program which will help you determine the values of resistance to use in attenuators. The program asks you for input impedance, the output impedance, and the attenuation desired. It then calculates the three resistors needed to construct either a pi or a T attenuator with the characteristics you desired. As in previous programs, most of the lines deal with input and output requirements. But there are three areas of computation here. The first calculates a minimum loss for the impedances selected. This is done in lines 60 and 70. Two groups of lines, following line 120 and line 170, do the actual resistance calculations. Pairs of lines at lines 30, 50, and 100 illustrate a good programing technique. The first line of the pair asks for some input. The second of the pair prints that input right back out so that you can check that the intended value got into the computer. ``` 10 PRINT "T AND PI ATTENUATORS" 20 PRINT "ENTER INPUT IMPEDANCE IN OHMS" 30 INPUT Z1 35 PRINT Z1 40 PRINT "ENTER OUTPUT IMPEDANCE IN OHMS" 50 INPUT Z0 55 PRINT Z0 60 LET T=9SQR9Z1/Z0)+SQR(Z1/Z0-1))*2 70 LET M=10LN(T)/2.3025 80 PRINT "MINIMUM PAD LOSS IS ";M;"DB" 90 PRINT "WHAT PAD LOSS IN DB IS DESIRED?" 100 INPUT L 105 OUTPUT L 110 LET L=10*(L/10) 120 PRINT "t PAD ATTENUATOR" 130 LET R3=2*SQR(L*Z1*Z0)/(L-1) 140 LET R1=Z1*(L+1)/(L-1)-R3 150 LET R2=Z0*(L+1)/(L-1)-R3 160 GOSUB 250 170 PRINT "PI PAD ATTENUATOR" 180 LET R3=(L-1)/2*SQR(Z1*Z0/L) 190 LET T=(L+1)/(L-1)/Z1-1/R3 200 LET R1=1/T 210 LET T=(L+2)/(L-1)/Z0-1/R3 220 LET R2=1/T 230 GOSUB 250 240 PRINT "PRESS 1 TO CONTINUE" 242 IF INKEY$="" THEN GOTO 242 244 LET A$=INKEY$ 246 IF A$="1" THEN CLS 248 GOTO 10 249 IF A$="" THEN GOTO 290 250 PRINT "R1=";R1;"OHMS" 260 PRINT "R2=";R2'"OHMS" 270 PRINT "R3=";R3;"OHMS" 280 RETURN 290 STOP 9998 SAVE "ATTn" 9999 GOTO 10 ``` [![T attenuator](http://localhost/wp-content/uploads/2026/12/qzx-new-v8n12-t-and-pi-attenuators-1.png)](http://localhost/wp-content/uploads/2026/12/qzx-new-v8n12-t-and-pi-attenuators-1.png)T attenuator [![PI attenuator](http://localhost/wp-content/uploads/2026/12/qzx-new-v8n12-t-and-pi-attenuators-2.png)](http://localhost/wp-content/uploads/2026/12/qzx-new-v8n12-t-and-pi-attenuators-2.png)PI attenuator This is a good program that can save one a lot of calculation in both audio and RF work. However there are a couple of rough spots in it. See if you can figure them out and propose changes in the program before it is discussed in QZX again.