_cos_sin
mov
T0, AC0
; T0 a
sfts AC0, #11
; Size of lookup table
mov
#tab_0_PI, T0
; Table based address
j j
mov
hi(AC0), AR2
mov
AR2, AR3
abs
AR2
; cos(Àa) cos(a)
add
#0x200, AR3
; 90 degree offset for sine
and
#0x7ff, AR3
; Modulo 0x800 for 11±bit
sub
#0x400, AR3
; Offset 180 degree for sine
abs
AR3
; sin(Àa) sin(a)
j j
mov
*AR2(T0), *AR0 ; *AR0 cos(a)
mov
*AR3(T0), *AR1
; *AR1 sin(a)
ret
.end
In this example, we use a half table (0 3 p). Obviously, a sine (or cosine) function
generator using the complete table (0 3 2p) can be easily implemented using only a few
lines of assembly code, while a function generator using a quarter table (0 3 p=2) will
be more challenging to implement efficiently. The assembly program cos_sin.asm
used in this example is available in the software package.
9.1.2 Linear Chirp Signal
A linear chirp signal is a waveform whose instantaneous frequency increases linearly
with time between two specified frequencies. It is a broadband waveform with the lowest
possible peak to root-mean-square amplitude ratio in the desired frequency band. The
digital chirp waveform is expressed as
cn A sinfn,
9:1:7
where A is a constant amplitude and fn is a quadratic phase of the form
fn 2p f
L
n
f
U
À f
L
2N À 1
n
2
a, 0 n N À 1,
9:1:8
where N is the total number of points in a single chirp. In (9.1.8), a is an arbitrary
constant phase factor, f
L
and f
U
, are the normalized lower and upper band limits,
respectively, which are in the range 0 f 0:5. The waveform periodically repeats with
fn kN fn, k 1, 2, . . .
9:1:9
The instantaneous normalized frequency is defined as
f n f
L
f
U
À f
L
N À 1
n, 0 n N À 1:
9:1:10
402
PRACTICAL DSP APPLICATIONS IN COMMUNICATIONS