z *** Bilinear Transformation Program ***   Program to evaluate the BLT given an analog transfer ( function of a recursive (IIR) system. The result of the) 2 BLT will be of the form:/ <j F A0 + A1z^-1 + A2z^-2 + ... + Anz^-n P H(z) = ------------------------------------ Z 1 + B1z^-1 + B2z^-2 + ... + Bmz^-m d0n Note: Order of numerator must be less than or equalxx to the order of the denominator polynomial.~ The program will prompt the user for output path of screen or or printer.+ AS( ),BS( ),AZ( ),BZ( ),CARY( , ),FAHEX( ),FBHEX( ),FRACA$( )` FRACB$( ),AZN( ),BZN( ),FRACA( ),FRACB( )h nMAXCOEFFS   );"*** Mapping S to Z Plane Using Bilinear Transformation ***" *** Prompt for Analog Transfer Function ***" - );y" "Enter the # of numerator coefficients (30 = Max, 0 = Exit) --> ",NNC, NNC  : :Exit to DOS6 NNC MAXCOEFFS NNC  @ NNNC  JI(NNC)N"T  :convert index to characterd^ " Enter a(";C$;")s^";P$;);"--> ";: "",AS(N)lh Nrr| " Enter the # of denominator coefficients --> ",NDC NDC MAXCOEFFS NDC   NNDC  I(NDC)N3  :convert index to characteru " Enter b(";C$;")s^";P$;);"--> ";: "",BS(N)} N " Are the above coefficients correct ? (y/n) ",C$ C$"N" C$"n" ! *** Perform Bilinear Transformation ***'9 I NDCICARY(,I)Q I[NUMm& I NDC0NUMNUM((NDC)(I))(I):CARY(I,)NUMD IN I NDCX J NDCbCARY(I,J)CARY(I,J)CARY(I,J)CARY(I,J) l Jv I# I NDC1SUMOFAS?SUMOFBSQ J NDCuSUMOFASSUMOFASCARY(I,J)AS(J)SUMOFBSSUMOFBSCARY(I,J)BS(J) JAZ(I)SUMOFASBZ(I)SUMOFBS I *** Divide all Coefficients by B0 ***' I NDC> AZN(I)AZ(I)BZ()UBZN(I)BZ(I)BZ()]  Ic*4 *** Generate Fractional Coefficient Arrays ***>H I NDCR (AZN(I))  FRACA(I)AZN(I): p :already fractionV\FRACA(I)(AZN(I))((AZN(I))) :FRACA(I)=fractional part of AZN(I)|f AZN(I)  FRACA(I)FRACA(I)p (BZN(I))  FRACB(I)BZN(I):  :already fractionzFRACB(I)(BZN(I))((BZN(I))) :FRACB(I)=fractional part of BZN(I)< BZN(I)  FRACB(I)FRACB(I)D IJ *** Negate b's for Filter Implemetation *** I NDCFRACB(I)FRACB(I) I *** Convert Fractional Coefficients to Hexidecimal ***D ` :invoke conversion routineJ *** Output Transfer Function Coefficients *** B :invoke output routine$. 8B ========================== Output routine =============================%L+V3` Xj " Send coefficients to:"nt );"(S)creen"~ );"(P)rinter" );"(R)un BLT program again" );"(E)xit to DOS" " Enter desired path --> ",PATH$ PATH$ "E" PATH$ "e" :C PATH$ "R" PATH$ "r" k PATH$ "S" PATH$ "s"  PATH$ "P" PATH$ "p"  V -------------------- Output Coefficients to Screen --------------------  7 " The coefficients in the S - plane:"=T( NNDC  d2I(NDC)N<  :Convert index to characterF );:"a(";C$;")s^";P$;);"= ";P "##.#####";AS(N);Z +);:"b(";C$;")s^";P$;4);"= ";d "##.#####";BS(N)n N(x \ " Press to view H(z)/b0 ",RPLYbj u ); "are mapped into the Z - plane using the Bilinear Transformation" ); "and normalized by b0, yielding:" I NDC8  :Convert index to characterb );:"a(";C$;")z^-";C$;);"= ";| "##.#####";AZN(I); +);:"b(";C$;")z^-";C$;5);"= "; "##.#####";BZN(I) I " );$, "Press to view fractional parts of the coefficients ",RPLY*62@ zJ " FRACTIONAL part of each coefficient is converted to HEX:"T " (Note: b's are negated for implementation.)^h );"FRACTION";");"HEX";8);"FRACTION";G);"HEX"r| I NDC>  :Convert index to characterg );:"a(";C$;")z^-";C$;);"= "; "##.#####";FRACA(I); );"*2^15 = ";FRACA$(I); +);:"b(";C$;")z^-";C$;5);"= "; "##.#####";FRACB(I);  ?);"*2^15 = ";FRACB$(I)  IY  : " Press to return to Output Path Menu ",RPLY_   ----------------------------------------------------------------------- ! ------------------- Output Coefficients to Printer --------------------! );"FRACTION";");"HEX";8);"FRACTION";G);"HEX"$H$R I NDC$\  :Convert index to character%f I NDC  %p );E%z"a(";C$;")z^-";C$;);"= ";: "##.#####";FRACA(I);f% );"*2^15 = ";FRACA$(I);r% +);%"b(";C$;")z^-";C$;5);"= ";: "##.#####";FRACB(I);% ?);"*2^15 = ";FRACB$(I)% I%(& -----------------------------------------------------------------------v& =======================================================================|&& ======================= Integer to Character ==========================&&S1$(I)&S2$(N)& C$(S1$,)' P$(S2$,))' I  C$(S1$,)D'$ N  P$(S2$,)`'. I c C$(S1$,)|'8 N c P$(S2$,)'B 'L ======================================================================='V $(` ===================== Convert Coefficients to Hex =====================*(j <(t M NDC\(~ FAHEX(M)(FRACA(M))|( FBHEX(M)(FRACB(M))( FAHEX(M)   ( FAHEX(M)FAHEX(M)( FBHEX(M)   ( FBHEX(M)FBHEX(M)) FRACA$(M)(FAHEX(M))) FRACB$(M)(FBHEX(M))&) M,) z) =======================================================================