`
`L-/
`DSP-pP routine computes magnitude
`
`Amarnath Palacherla
`Minochip Teclwwlngg, ClwndW, AZ
`The 320C10 DSP rrP pmgram in Listing I computes
`the magnitude of a complex number, X+jY. Fiirding
`the sum of che squarcs of the real (X) and imaginary
`(Y) parts of a complex number is no problem with a
`320C10 because the IC performs a multiplication in
`one instruction cycle (122 nsec at 32.8 MHz).
`But finding the square root of the sum of the squares
`is not trivial. If you use sommon iterative methods,
`such as the Newton'Raphson rnethod, the B20Cl0 wiU
`take 350 or more clock cycles for this calculation (4p
`psec).
`The method embodied in the listing takes only about
`30 clock cycles (3.? psec) and uses the following ap-
`proximation:
`' I - \fE.o
`MAX (X,y) + KrMIN (x,y).
`the MAX(X,Y) function examines the real and imagi-
`nary parts of a complex number and selects the part
`having the largest absolutp value. MIN(X,Y) similarly
`looks for the absolute minimum part of each complex
`number in your sample set. You can choose any vdue
`for the eonstsnt K between 0.25 and 0.31. Recom.
`mended values for K are 0.26?304 for exact extimated
`mean, and 0.300585 for minimum variance.
`Fig I graphs the pertentage error between the ac-
`tual value of the complex numbefs magnitude and the
`dgorithm's estimate for phase angles in the filst oc-
`tant. Note that the maximum error is about ll,% for
`K=0.26?304, but the mean ernor is 0. The second rou-
`tine in Listing t modiftes the algorithm slightly to
`lessen the estimate's error for phase angles greater
`lhan 41". In pseudocode, the modified algorithm is
`
`et
`!r5o
`
`-7
`
`-a
`
`Flt l-thb fut gra?b Chc pncnlagc ctr!fi bcttpccn tlw ochn
`nagrnitudl of u carnplez nrtmbcr and ttu appv.lina;titq algorikm':
`oEtirrntc of tlu nw4ttilrlde qo,iut Utz ptosc ottglc of tlu conrpla
`numbcr ovcr jtut llu fitr,t or,t4nl. Th. gnph &s rce ilwut thal fa,
`K-O.SE,8AL, Uu n an eTrot cq!,/4;k zcm.
`
`xl = MAX f A3S(x), ABS(y) I ;
`yl = MIN I ABS(x), AAS0) I ;
`IF ( xl == yl ) THEN Z - SQRT(Z).xI ; RETURN ;
`z=xl+K.yl;
`IF I yl > xlrTAN({l) ] THEN z -- 2.1.09865; RETURN
`
`This algorithm yields a manimum ertor of less thar
`67o, Qf cource, with this modification, the rnean ener
`6t
`is no longer zero.
`
`References
`l. Onoe, Morio, "Fast Amptitude Approximation Yielding
`Either Exact Illean or Minimum Deviation for Quatrature
`Pairs," hoceedings of the IEEE, July l9?2.
`2. Knuth. D E, The At1' Of Computcr Prcgmmming: Vol
`ume Il, Addison-Wesley Publishing Co, Reading, MA.
`
`To Vote For This Design, Circle No ?50
`
`LISTING I-COMPLEX.NUMBER MAGNITUDE ROUTINE
`latalaaaatttatattataaaataaalllt!taataaaaaataataaattata
`I
`a 'l a aaaar
`'
`
`.
`compute Hagnltude , z - SQRT( x.x + Yry )
`a a aaa aa art aaa..
`aa l t a t a a a ! a t a r a a a ttaa r a a a l aa a t
`tata
`Assune X & Y are ln Locattons O & 1 Respectlvely
`egu
`equ
`equ
`equ
`equ
`
`o 1234
`
`axYD
`
`ax
`n1n
`z
`
`EDN Oetober::6. tgttg
`
`Petitioner Sirius XM Radio Inc. - Ex. 1005, p. 1
`
`
`
`DESIGN IDEAS
`
`1 -GOMPLEX-NUMBER itAGNtruDE Roufl NE-conunued
`equ
`Gqu
`
`36 8
`
`?59
`-28a8s
`135?3
`
`DATA
`DATA
`DATA
`
`/.1. o.2673Oa332?69 .../
`.../
`/ttt
`-tan(fl1r3at6g
`Bqrt ( 2I -1' t. /
`/"t
`
`EGI:K * y
`at, /
`/...
`... /
`Aln -
`/...
`l.
`/... Load Conatant K frou ROM
`
`Y n
`
`:a
`
`ln
`
`EXB
`atn
`caoel
`coDtr'
`ARO, Eax
`uln
`Da:c
`ARO,nin
`conat
`
`R u
`
`LISTING
`
`Kt
`
`heta
`conat
`angle
`root2
`Eag
`
`conp
`... /
`
`"
`
`Jac
`abe
`sacl
`tac
`abe
`sacl
`sub
`bz
`bgez
`lar
`lac
`eacl
`aar
`lack
`tblr
`lEc
`ax.15
`It
`Kaln
`Epy
`apac
`aach
`2,1
`t rt t tt
`t | !r"ta
`r
`a ri a a a a aarraal a a a'at a a a a r a aa aa t t a a aart a a a a a t a
`t
`"
`Thls part of Codc l{eceaaary only tf
`r
`.... f ..' r. ......f3*l 1::.*:*1.1:.::::..: f ......,,.... .. l
`lack
`anglc
`tblr
`theta
`lacIr
`Bl,n,15
`theta
`Ea:r
`caee2
`
`/.. bragch lf nln > nax.lan({l)
`
`/t.Z-2.!.0985.../
`
`/.t
`
`1f ( x -o
`
`) z .:r.1.414
`
`"
`
`z, l5
`233
`zr!-
`root2
`Ettr
`ntn
`D:T:G
`uaxr 15
`Z'L
`
`z3
`
`EDN October e6, l$g
`
`... /
`caec2
`
`casel
`../
`
`Bpy
`aPac
`bgez
`ret
`lac
`It
`BPYK
`aPac
`sach
`ret
`lack
`tblr
`It
`upy
`lac
`apec
`aach
`ret
`
`Petitioner Sirius XM Radio Inc. - Ex. 1005, p. 2
`
`