These two configurations of attenuator pad are undoubtedly familiar, but finding their resistance values for some particular dB of attenuation can be a little inconvenient.
This code in GWBASIC does that task. Note that the impedance level, the ohms values of the Rsource and the Rload is stated in line 100 so you can change that if you care to.
10 CLS:SCREEN 9:COLOR 15,1:A$="pad @ ### ohms: "
20 PRINT "save "+CHR$(34)+"padcalc.bas"+CHR$(34):PRINT
30 PRINT "save "+CHR$(34)+"a:\padcalc.bas"+CHR$(34):PRINT:PRINT:GOTO 70
40 XX=1:CC=(1-SGN(CC))*3:RETURN
50 IF XX=5 THEN GOSUB 40
60 LOCATE 3+XX*3,1:RETURN
70 C$=" ##.## dB Tee "+A$+"Series = #####.## ohms Shunt = #####.## ohms"
80 D$=" ##.## dB Pi "+A$+"Series = #####.## ohms Shunt = #####.## ohms"
90 E$="Attenuation in dB ( 62 dB max. )"
100 RS=50:REM ************ Source & load impedance value. **********
110 LOCATE 18,1:PRINT " "
120 COLOR 15,1:LOCATE 18,1:PRINT E$;:INPUT DB
130 IF DB>62 THEN GOTO 110
140 K=10^(-DB/20):R1=RS:IF DB<=0 THEN GOTO 110
150 R2=RS*(1-K)/(1+K):REM Series R for tee attenuator.
160 R3=(R1-R2)*(R1+R2)/2/R2:REM Shunt R for tee attenuator.
170 R4=R1*(1+K)/(1-K):REM Shunt R for pi attenuator.
180 R5=R1*R4/(R4-R1)-R1*R4/(R4+R1):REM Series R for pi attenuator.
190 XX=XX+1:GOSUB 50:COLOR 14-CC,1
200 PRINT USING D$;DB,R1,R5,R4:PRINT USING C$;DB,R1,R2,R3:PRINT:GOTO 110
Although written in GWBASIC, this code will also work with Q-Basic.
To get a whole set of results into a conveniently readable form, the algorithm of this code was ported into Excel and the results were printed out in two charts below, one for 50 ohms and the other for 75 ohms impedance level.
If you would like to have a copy of the Excel file, just e-mail me at ambertec@ieee.org and I will send it to you.
The next issue is this:
Suppose you have a multiplicity of pads that you will use in cascade with each other and you want each pad to dissipate the same amount of power as each of the others does. How do you allocate the dB attenuations?
The GWBASIC code below does that calculation:
10 CLS:SCREEN 9:COLOR 15,1:DIM A(10),P(10),A$(10),B$(10),PL(10)
20 PRINT "save "+CHR$(34)+"equipads.bas"+CHR$(34):PRINT
30 PRINT "save "+CHR$(34)+"a:equipads.bas"+CHR$(34):PRINT:PRINT
40 A$(1)="##.## dB = ##.## dB + ##.## dB":B$(1)=" #.### + #.### "
50 FOR J=2 TO 5:A$(J)=A$(J-1)+" + ##.## dB":B$(J)=B$(J-1)+" + #.### ":NEXT J
60 C$="Examples of equal power pads and their fractions "
70 C$=C$+"of input power absorbed:":PRINT C$:PRINT:ON ERROR GOTO 240
80 READ ADB,N:GOSUB 90:GOTO 80:DATA 3,2,10,4,30,6
90 ASUM=0:FOR J=1 TO 10:A(J)=0:NEXT J:FOR J=1 TO N
100 NUM=(N+1-J)*10^(ADB/10)+J-1:DEN=(N-J)*10^(ADB/10)+J
110 A(J)=10*LOG(NUM/DEN)/2.30259:ASUM=ASUM+A(J):NEXT J:P(0)=1
120 FOR J=1 TO N:P(J)=P(J-1)/(10^(A(J)/10)):PL(J)=P(J-1)-P(J):NEXT J
130 IF N=2 THEN PRINT USING A$(1);ASUM,A(1),A(2)
140 IF N=2 THEN PRINT USING B$(1);PL(1),PL(2)
150 IF N=3 THEN PRINT USING A$(2);ASUM,A(1),A(2),A(3)
160 IF N=3 THEN PRINT USING B$(2);PL(1),PL(2),PL(3)
170 IF N=4 THEN PRINT USING A$(3);ASUM,A(1),A(2),A(3),A(4)
180 IF N=4 THEN PRINT USING B$(3);PL(1),PL(2),PL(3),PL(4)
190 IF N=5 THEN PRINT USING A$(4);ASUM,A(1),A(2),A(3),A(4),A(5)
200 IF N=5 THEN PRINT USING B$(4);PL(1),PL(2),PL(3),PL(4),PL(5)
210 IF N=6 THEN PRINT USING A$(5);ASUM,A(1),A(2),A(3),A(4),A(5),A(6)
220 IF N=6 THEN PRINT USING B$(5);PL(1),PL(2),PL(3),PL(4),PL(5),PL(6)
230 RETURN
240 PRINT:INPUT "How many dB and with how many pads ";ADB,N:IF N>6 THEN N=6
250 GOSUB 90:GOTO 240
As before, this code will also run in Q-Basic.
The following is an example of the results of running this code:
Three quick examples are presented at the start of things. These are examples of 3 dB using two pads, 10 dB using four pads and 30 dB using six pads.
In the example shown, I chose to ask for 12 dB using four pads. The decibel values of the four pads from Pad 1 thru Pad 4 are as shown in that order from left to right and each of those pads is shown to dissipate 23.4% of the total power input.
Numerically checking this, we say that the attenuation is 10 * Log10 ( 1 - 4 * 0.234 ) = - 11.938 dB where the target had been -12 dB. The difference can be ascribed to numerical accuracy.
i read Your Post because i researched on optical attenuators and i would like to share some things with you also.There are plenty of interesting things going on in the world of optical attenuators.A fiber optic attenuator in which male and female members connect a fiber detector means with an attenuator member fixed between the end of the fiber and the detector, reducing the signal from the fiber before reaching the detector, to prevent the detector from becoming saturated and making it impossible to recover the video signal through the fiber.Fiber optic attenuator is used in the fiber optic links to reduce the optical power at a certain level.fiber optic attenuators are manufactured according to industrial standards, and they are 100% strictly tested during the production. These fiber optic attenuators are prompt delivery and good prices.
Posted by: optical attenuators | June 22, 2012 at 06:09 AM