coordinate rotations digital computer real rotation

24
1 • COordinate Rotatio ns DIgital Compute r • Real Rotation x (i+1) = R (i) cos(+ (i) ) = x (i) cos (i) – y (i) si n (i) y (i+1) = R (i) sin(+ (i) ) = y (i) cos (i) + x (i) si n (i) CORDIC X Y (i) R (i+1) 0 pseudorotation rotation R (i) (x (i+1) ,y (i+1) ) (x (i) ,y (i) )

Upload: ronny

Post on 21-Jan-2016

29 views

Category:

Documents


0 download

DESCRIPTION

CORDIC. COordinate Rotations DIgital Computer Real Rotation x (i+1) = R (i) cos( + (i) ) = x (i) cos  (i) – y (i) sin  (i) y (i+1) = R (i) sin( + (i) ) = y (i) cos  (i) + x (i) sin  (i). Real rotation. Real Rotation x (i+1) = x (i) cos  (i) – y (i) sin  (i) - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: COordinate Rotations DIgital Computer Real Rotation

1

• COordinate Rotations DIgital Computer

• Real Rotationx(i+1)= R(i)cos(+(i)) =

x(i)cos(i) – y(i) sin (i)

y(i+1)= R(i)sin(+(i)) = y(i)cos(i) + x(i) sin(i)

CORDIC

X

Y

(i)

R(i+1)

0

pseudorotation

ro ta tio n

R(i)

(x(i+1),y(i+1))

(x(i),y(i))

Page 2: COordinate Rotations DIgital Computer Real Rotation

2

• Real Rotationx(i+1)= x(i)cos(i) – y(i) sin(i)

y(i+1)= y(i)cos(i) + x(i) sin(i)

z(i+1)= z(i) – (i)

z(0)=wanted rotationz(i+1)0R(i+1)= R(i) in real rotationLet x(0)= x, y(0)= y, z(0)= z

Real rotation

Page 3: COordinate Rotations DIgital Computer Real Rotation

3

• After m iterations:x(m)=xcos((i)) – ysin ((i)) y(m)= ycos((i)) + xsin((i)) z(m)= z– ((i))

Real rotation(2)

X

Y

(i)

R(i+1)

0

pseudorotation

ro ta tio n

R(i)

(x(i+1),y(i+1))

(x(i),y(i))

Page 4: COordinate Rotations DIgital Computer Real Rotation

4

• Pseudo-RotationR(i+1)= R(i) (1+tan2 (i))1/2

x(i+1)= R(i+1) cos(+(i)) = x(i)– y(i) tan(i)

y(i+1)= R(i+1)sin(+(i)) = y(i) + x(i) tan(i)

z(i+1)= z(i) – (i)

Let x(0)= x, y(0)= y, z(0)= z

Pseudo-rotation

X

Y

(i)

R(i+1)

0

pseudorotation

ro ta tio n

R(i)

(x(i+1),y(i+1))

(x(i),y(i))

Page 5: COordinate Rotations DIgital Computer Real Rotation

5

Pseudo-rotation(2)

X

Y

(i)

R(i+1)

0

pseudorotation

ro ta tio n

R(i)

(x(i+1),y(i+1))

(x(i),y(i))

• After m iterations:x(m)=(xcos((i))–ysin ((i)))

(1+tan2 (i))1/2 =K(xcos((i))–ysin ((i)))

y(m)=(ycos((i))+xsin((i))) (1+tan2 (i))1/2 ) =K(ycos((i))+xsin((i)))

z(i+1)= z(i) – ((i))

Page 6: COordinate Rotations DIgital Computer Real Rotation

6

Rotation mode Operation

• CORDICSelect (i)= di2–i

x(i+1)= x(i)–di y(i)2–i

y(i+1)= y(i)+ di x(i)2–i

z(i+1)= z(i) –di tan–1 2–i

Store tan–12–i at a table (right)

i tan i2

i

0 45.0

1 26.6

2 14.0

3 7.1

4 3.6

5 1.8

6 0.9

7 0.4

Page 7: COordinate Rotations DIgital Computer Real Rotation

7

Rotation mode (2)

• Example z(m)0z(0)= 30.0After 7 iterations:

• Rotation:x(m)=K(xcos z –ysin z)y(m)=K(ycos z +xsin z)z(0)=0Rule: di=1 s.t. z(m)0

i Z(i)+ditan i2

i= Z(i+1)

0 30.0 45.0 = 15.01 15.0+26.6=11.62 11.6 14.0= 2.43 2.4+7.1=4.74 4.7 3.6=1.15 1.1 1.8= 0.76 0.7+0.9=0.27 0.2 0.4= 0.2

Page 8: COordinate Rotations DIgital Computer Real Rotation

8

Rotation mode (3)

• Rotation:x(m)=K(xcos z –ysin z)y(m)=K(ycos z +xsin z)z(0)=0Rule: di=1 s.t. z(m)0

• K=1.646760258121...z(k)0 (k-bit k iteration)Compute cos z

Let x=1/K & y=0obtain x(m)=cos z

Computer sin zLet y=1/K & x=0obtain y(m)=cos z

Page 9: COordinate Rotations DIgital Computer Real Rotation

9

Rotation mode(4)

• Convergenceif i large, then tan–12–i=2–i

z (m) 0 possible for z(i) z(i+1)

99.7° z – 99.7converge

Page 10: COordinate Rotations DIgital Computer Real Rotation

10

Vectoring mode

• y(m) 0 by selecting di= –sign (x(i)y(i))After m iterations: tan((i))= – x/yx(m)= K[xcos ( (i) ) –ysin ((i))] =K(x–ytan

((i)))/ (1+tan2 ((i)))1/2 =K(x2+y2)1/2

y(m) =0; z(m) =z+tan–1(y/x)Rule: di=1 s.t. y(m)0

Page 11: COordinate Rotations DIgital Computer Real Rotation

11

Vectoring mode(2)

• Obtain tan–1y by selecting x=1 & z=0x(m)= K(1+y2)1/2

y(m) =0z(m) = tan–1y Obtain tan–1(1/y)= /2 – tan–1y

Page 12: COordinate Rotations DIgital Computer Real Rotation

12

CORDIC Hardware

x

y

ADD/SUB

ADD/SUB

zADD/SUB

lookup Table

Page 13: COordinate Rotations DIgital Computer Real Rotation

13

Generalized CORDIC

• General CORDIC iterationx(i+1)= x(i)–di y(i)2–i

y(i+1)= y(i)+ di x(i)2–i

z(i+1) = z(i) –di e(i)

=1: e(i) =tan–1 2–i Circular (basic) rotation

=0: e(i) =2–i Linear rotation = –1: e(i) =tanh–1

2–i Hyperbolic rotation

Page 14: COordinate Rotations DIgital Computer Real Rotation

14

Circular, Linear, Hyperbolic

=1

=0

= 1

A

O

r

B

C

DI

Page 15: COordinate Rotations DIgital Computer Real Rotation

15

Circular (basic) rotation (=1)

Pseudo-rotation by *(1+tan2(i))1/2=1/(cos(i))angle = 2AreaArea/r2

x(m)=K(xcos z –ysin z)y(m)=K(ycos z +xsin z)z(m)=0Rule: di=1 s.t. z(m)0

K=1.646760258121...

=1 A

O

r

B

Page 16: COordinate Rotations DIgital Computer Real Rotation

16

Circular vectoring mode (=1)

x(m)= K(x2+y2)1/2

y(m)=0z(m)= z+tan–1(y/x)Rule: select di=1 s.t. y(m)0

Page 17: COordinate Rotations DIgital Computer Real Rotation

17

Linear Rotation mode (=0)

x(m)= x

y(m)=y+xzz(m)= 0Rule: select di=1 s.t. z(m)0 =0

O

R=x

Page 18: COordinate Rotations DIgital Computer Real Rotation

18

Linear vectoring mode (=0)

x(m)= x

y(m)=0z(m)= z+y/xRule: select di=1 s.t. y(m)0 =0

O

R=x

Page 19: COordinate Rotations DIgital Computer Real Rotation

19

Linear mode (=0)

Perform MUL: rotation with y=0MUL&ADD: rotationDIV: vectoring with z=0DIV& ADD: vectoring

Page 20: COordinate Rotations DIgital Computer Real Rotation

20

Hyperbolic rotation (=–1)

R(i)=(x2–y2)1/2 *(1 –tanh2(i))1/2 = 1/cosh(i)

angle = 2AreaArea/r2

x(m)=K’(xcosh z +ysinh z)y(m)=K’(ycosh z +xsinh z)z(m)=0Rule: di=1 s.t. z(m)0

K’=0.828159360960...

= 1

O

C

D

r

Page 21: COordinate Rotations DIgital Computer Real Rotation

21

Hyperbolic vectoring (=–1)

x(m)=K(x2–y2)1/2 y(m)=0z(m)=z+tanh–1(y/x)

Rule: di=1 s.t. y(m)0= 1

O

C

D

r

Page 22: COordinate Rotations DIgital Computer Real Rotation

22

Hyperbolic mode(=–1)

Rotation: Hyperbolic sin, cosinex=1/K’, y=0

Vectoring: tanh–1

x=1, z=0

To ensure convergencerepeat steps 4, 13, 40,…, j, 3j+1, …in practice stop less than 121 iterations

Page 23: COordinate Rotations DIgital Computer Real Rotation

23

CORDIC

xyz

K(xcos z - y sin z)K(ycos z + x sin z)

0

=1 circular

Find sin & cos; setx=1/K & y=0

CORDIC

xyz 0

Find MUL set y=0

CORDIC

xyz

0

Find sinh & cosh; setx=1/K' & y=0

xy+xz

Rotation mode: z(i)->0;di=Sign(z(i))

=0 linear

=-1 hyperbolic

Vectoring mode:y(i)->0; di=-Sign(x(i)y(i))

K'(xcosh z - y sinh z)

K'(ycosh z + x sinh z)

ez=sinh z + cosh z

CORDIC

xyz

0

Find tan-1; set x=1 &z=0

K(x2+y2)1/2

z + tan-1(y/x)

CORDIC

0

Find DIV set z=0

x

z+y/x

xyz

CORDIC

0

Find tanh-1; set x=1 &z=0

z + tanh-1(y/x)

xyz

K(x2 - y2)1/2

Repeat iteration 4,13, 40, 121, ..., j,

3j+1

Page 24: COordinate Rotations DIgital Computer Real Rotation

24

• General CORDIC iterationx(i+1)= x(i)–di y(i)2–i

y(i+1)= y(i)+ di x(i)2–i

z(i+1) = z(i) –di e(i)

=1: e(i) =tan–1 2–i Circular (basic) rotation

=0: e(i) =2–i Linear rotation = –1: e(i) =tanh–1

2–i Hyperbolic rotation