Real-time digital signal processing: implementations, ... changes in the input signal is limited by its internal clock rate, so that it may be slow to
Document source : notes.ump.edu.my
Table 3.8 (continued )
amov
#coeff, XCDP
bset
FRCT
j j mov
T0, *AR5
; x[0] indata
;
; Perform IIR filtering
;
mpym *AR5, *CDP, AC0 ; AC0 x[0]*bn[0]
j j rpt #3
; i 1, 2, 3, 4
macm *AR5, *CDP, AC0 ;
AC0 x[i]*bn[i]
rpt #3
; i 0, 1, 2, 3
macm *AR6, *CDP, AC0 ;
AC0 y[i]*an[i]
amov #y2, XAR5
amov #y3, XAR6
sfts AC0, #2
; Scale to Q15 format
j j rpt #2
mov *AR5À, *AR6À
; Update y []
mov hi(AC0), *AR6
j j mov hi(AC0), T0
; Return y[0]in T0
amov #x3, XAR5
amov #x4, XAR6
bclr FRCT
j j rpt #3
mov *AR5À, *AR6À
; Update x[]
popboth XAR6
popboth XAR5
bclr SXM
bclr SATD
j j ret
.end
3.8.5 Experiment 3E ± Synthesizing Sine Function
For many DSP applications, signals and system parameters, such as filter coefficients,
are usually normalized in the range of À1 and 1 using fractional numbers. In Section
3.4, we introduced the fixed-point representation of fractional numbers and in Section
3.6, we discussed the overflow problems and present some solutions. The experiment in
this section used polynomial approximation of the sinusoid function as an example to
understand the fixed-point arithmetic operation and overflow control.
The cosine and sine functions can be expressed as the infinite power (Taylor) series
expansion
cosy 1 À
1
2!
y
2
1
4!
y
4
À
1
6!
y
6
Á Á Á ,
3:8:1a
EXPERIMENTS OF FIXED-POINT IMPLEMENTATIONS
117
Summary :
Table 3.8 (continued ) amov #coeff, XCDP bset FRCT j j mov T0, *AR5 ; Return y[0]in T0 amov #x3, XAR5 amov #x4, XAR6 bclr FRCT j j rpt #3 mov *AR5À, *AR6À ;
Tags :
ac0,amo,rpt,fixedpoint,cdp,ar5,xar5,section,bclr,xar6,function,frct,macm