Digital Signal Processing Reference
In-Depth Information
% Recoding b as r with +1,-1
for k=1:M
r(k) = 2*b(k) - 1;
end
% First modified CORDIC rotation
x(1) = x0 - r(1)*(tan(2^(-1)) * y0);
y(1) = y0 + r(1)*(tan(2^(-1)) * x0);
% Remainder of the modified CORDIC rotations
for k=2:M,
x(k) = x(k-1) - r(k)* tan(2^(-k)) * y(k-1);
y(k) = y(k-1) + r(k) * tan(2^(-k)) * x(k-1);
end
tableX = [tableX x(M)];
tableY = [tableY y(M)];
end
In hardware implementation, the initial M iterations of the algorithm are skipped and the output
value from the Mth iteration is directly indexed from the ROM. The address for indexing the ROM is
calculated using the M most significant bits of b as:
index ¼ b 0 2 M 1
þ b 1 2 M 2
þ ... þb M 1 2 0
ð 12 : 19 Þ
Reading from the ROM directly gives x[M 1] and y[M 1] values. The rest of the values of x[k]
and y[k] are then generated by using the approximation of (12.18). This substitution replaces
multiplication by tan 2 i with a shift by 2 i operation. The equations implementing simplified
iterations for i
¼
M
þ
1, M
þ
2,
...
, N are:
x i ¼ x i 1 r i 2 i y i 1
ð
12
:
20a
Þ
y i ¼ r i 2 i x i 1 þ y i 1
ð 12 : 20b Þ
Fixed-point implementation of the modified CORDIC algorithm that uses tables for directly
indexing the value for the Mth iteration and implements (12.20) for the rest of the iterations is given
here:
P = 22;
N = 16;
M=4;
% Tables are computed for P=22, M=4 and values are in Q2.20 format
tableX = [
1045848
1029530
997147
949203
886447
Search WWH ::




Custom Search