****************************************************************************

fir.asm      N-tap finite impulse response filter (FIR)

Analog Devices, Inc.
DSP Division
Three Technology Way
P.O. Box 9106
Norwood, MA 02062

23-JUNE-2001 BJM

This directory contains an example ADSP-2191, single-core subroutine 
that implements a N-tap finite impulse response filter (FIR) using coefficients.

Files contained in this directory:

fir.dpj              VisualDSP project file
fir.asm              ADSP-2191 source for FIR
fir_test.asm         Calling function for fic.asm
ADSP-2191.ldf     Linker description file 
input_dec.dat        Sample data for FIR
 _________________________________________________________________

CONTENTS

I.    FUNCTION/ALGORITHM DESCRIPTION
II.   IMPLEMENTATION DESCRIPTION
III.  DESCRIPTION OF INPUT DATA         

I. FUNCTION/ALGORITHM DESCRIPTION

The project fir.dpj contains an implementation of a single-core subroutine 
that implements a N-tap finite impulse response filter (FIR).  This 
routine has been optimized to take advantage of the repetitive multiply 
accumulates inherent to the algorithm.

y(n) = Summation from k=0 to M of h(k)*x(n-k)


II.   IMPLEMENTATION DESCRIPTION

The assembly language module FIR_TEST.ASM initializes the input and 
coefficient buffers and then calls FIR.ASM.   
     
The first buffer declared, IN, is Num_Samp locations long.

The next buffer declared, OUT, is also Num_Samp long, and stores the 
output of the filter.

Delay_Line is the third buffer declared.  This buffer holds the delay line.  
Since there are past intermediate values for each stage of the FIR, the length of
this buffer is as long as the number of Taps.

The coefficient buffer, COEFF, contains the FIR filter coefficients.  The 
coefficients are typically generated by a filter design software package.

The linker descriptive file is ADSP-2191.LDF, which describes the hardware in 
terms of memory spaces and peripherals.

Because there is no data dependency between DSP cores, it is possible 
to do perform an FIR in DSP core 1, while also performing an FIR in DSP core 2 
on separate input data, using different coefficients.

III.  DESCRIPTION OF INPUT DATA

1. INPUT SAMPLES:
-----------------
This FIR routine expects input data which conforms to the following criteria:

Generate input data such that an array of input fixed point values are arranged 
in the following order:

INPUT DATA

indata(0)      
indata(1)      
indata(2)      
indata(3)      
...
...
...
     


2. COEFFICIENT DATA:
-----------------------
This FIR routine expects TAPS 1.15 fixed point values to be used as coefficients.

COEFFICIENT DATA

coef(0)
coef(1)
coef(2)
coef(3)
... 
... 
... 



