Tchebyscheff Rational Function
Main Software Page


10 DEFDBL A-Z
20 DIM A(100),THETA(100)
30 INPUT "TYPE PASSBAND ATTENUATION IN DB ";RP
40 INPUT "TYPE STOPBAND ATTENUATION IN DB ";RS
50 INPUT "TYPE STOPBAND EDGE FREQUENCY IN RADIANS ( MUST BE >1)";WX
60 PRINT "PASSBAND RESPONSE VARIES BETWEEN 1.00000 AND";10^(-RP/20);" VOLTS"
70 E2 = 10^(RP/10)-1:PRINT "E*E =";E2
80 PRINT "RN(W) VARIES FROM 1.0000 TO -1.0000 IN THE PASSBAND."
90 PRINT "RN(W) VARIES FROM ";SQR( (10^(RS/10)-1)/E2);" TO INFINITY IN THE STOPBAND"
100 L=SQR( (10^(.1*RS)-1)/(10^(.1*RP)-1))
110 KL = 1/L:KPL = SQR(1-(1/L)^2):KWX = 1/WX:KPWX = SQR(1-(1/WX)^2)
120 K = 1/L:GOSUB 3000:SUM = KK:K = KPL:GOSUB 3000:SUM1 = KK
130 K = KWX:GOSUB 3000:SUM2 = KK:K =  KPWX:GOSUB 3000:SUM3=KK
140 PRINT "N =";SUM1*SUM2/(SUM*SUM3);
200 N = INT((SUM1*SUM2)/(SUM*SUM3))+1:PRINT "         USE N = ";N
210 NI = 0:RN=1:RN1=1
220 IF N = 2*INT(N/2) THEN NI=1
230 FOR I = 1 TO N/2: GOSUB 7000: NEXT I
260 PRINT "B = ";1/RN
270  INPUT "PRESS  TO QUIT ";C$
900 END
3000 REM CALCULATION OF K = COMPLETE ELLIPTIC INTEGRAL
3010 A(0) = ATN(K/SQR(1-K^2))
3020 THETA(0) = 3.14159/2
3030 P = 1:I=0
3040 X = 2/(1+SIN(A(I)))-1
3050 Y = SIN(A(I))*SIN(THETA(I))
3060 A(I+1)=ATN((SQR(1-X^2))/X)
3070 THETA(I+1)=.5*(THETA(I)+ATN(Y/SQR(1-Y^2)))
3080 E = 1-A(I+1)*2/3.14159:I =I+1
3090 IF E > .0000001 THEN GOTO 3040
3100 FOR J = 1 TO I: P = P*(1+COS(A(J))):NEXT J
3110 X = 3.14159/4+THETA(I)/2
3120 KK=LOG(SIN(X)/COS(X))*P/LOG(2.7182818#)
3130 RETURN
4000 REM CALCULATION OF SN(U,K)
4010 SN=0:J=0:Q = EXP(-3.14159*SUM3/SUM2)
4020 V = 3.14159/2*U/SUM2
4030 W = Q^(J+.5):SN=SN+W*SIN((2*J+1)*V)/(1-W*W):J = J + 1
4040 IF W > .0000001 THEN GOTO 4030
4050 SN = SN*2*3.14159/KWX/SUM2
4060 RETURN
7000 REM DETERMINATION OF POLES AND ZEROS
7010 U = (2*I-NI)*SUM2/N
7020 GOSUB 4000
7030 XO(I)=(SN):XZ(I)=(WX/SN)
7040 PRINT "WO(";I;")=";XO(I);"        WZ(";I;")=";XZ(I)
7050 RN=(XO(I)^2-1)/(XZ(I)^2 -1)*RN
7060 RETURN




Example B2.1
With regard to Figure 5.1, the following pole-zero locations were produced given the initial specifications below.
Type passband attenuation in Db ? 3.0103
Type stopband attenuation in Db ? 60
Type stopband edge frequency in radians ? 1.133
Passband response varies between 1.00000 and 0.7071067840850258
E*E = 0.9999999836037312
Rn(w) varies from 1.00000 to -1.00000 in the passband
Rn(w) varies from 999.9995081980054 to infinity in the stopband
N = 6.989079739548641	Use N = 7
Wo(1)= 0.5663460991116648		Wz(1)= 2.000543515686992
Wo(2)= 0.8789775435076472		Wz(2)=1.288997682114965
Wo(3)= 0.9887024751136662		Wz(3)=1.145946373889889
B=-179.2322414868699


Example B2.2
With regard to equation (7.27), the following pole-zero locations were produced given the initial specifications below.
Type passband attenuation in Db ? 3.0103
Type stopband attenuation in Db ? 40
Type stopband edge frequency in radians ? 1.0589145
Passband response varies between 1.00000 and 0.7071067840850258
E*E = 0.9999999836037312
Rn(w) varies from 1.00000 to -1.00000 in the passband
Rn(w) varies from 99.9950006947662 to infinity in the stopband
N = 5.997256856797012	Use N = 6
Wo(1)= 0.4010918254705045		Wz(1)= 2.64007998357441
Wo(2)= 0.8674691561889573		Wz(2)=1.220694122027482
Wo(3)= 0.9897913078420552		Wz(3)=1.069836127687004
B=-100.2528435022799
Main Software Page