14
Software Examples
14 – 5
correspond to the forty-third filter tap.
The subroutine that realizes the sum-of-products operation used in
computing the transversal filter is shown in Listing 14.1.
.MODULE fir_sub;
{
FIR Transversal Filter Subroutine
Calling Parameters
I0 —> Oldest input data value in delay line
L0 = Filter length (N)
I4 —> Beginning of filter coefficient table
L4 = Filter length (N)
M1,M5 = 1
CNTR = Filter length - 1 (N-1)
Return Values
MR1 = Sum of products (rounded and saturated)
I0 —> Oldest input data value in delay line
I4 —> Beginning of filter coefficient table
Altered Registers
MX0,MY0,MR
Computation Time
N - 1 + 5 + 2 cycles
All coefficients and data values are assumed to be
in 1.15 format.
}
.ENTRY
fir;
fir:
MR=0, MX0=DM(I0,M1), MY0=PM(I4,M5);
DO sop UNTIL CE;
sop:
MR=MR+MX0*MY0(SS), MX0=DM(I0,M1), MY0=PM(I4,M5);
MR=MR+MX0*MY0(RND);
IF MV SAT MR;
RTS;
.ENDMOD;
Listing 14.1 Single-Precision FIR Transversal Filter