3-Tap Fir Filter - Motorola DSP56009 User Manual

24-bit digital signal processor
Table of Contents

Advertisement

Application Examples
C.8

3-TAP FIR FILTER

The following program implements a 3-tap FIR filter. This type of program is
typically used in generating early reflection information for surround sound and
reverb applications. The filter structure is illustrated in Figure C-5 . This code
segment assumes accesses of 16-bit words on an 8-bit bus, "fast" DRAM timing (26
instruction cycles), and 0-wait state SRAM timing (20 instruction cycles).
Number of memory storage locations = T3(seconds) × fs (Hz).
For a 50 ms delay and 44.1 KHz sampling rate: 0.05 × 44100 = 2205 locations.
FIR Filter Assembler Code (EMI mode: increment EBAR on write operation):
movep
x:FIR_BASE,x:EBAR0
movep
#T1_OFF,x:EOR0
movep
#T2_OFF,x:EOR0
clr a
x:G1,x0
movep
x:EDRR0,y0
movep
#T3_OFF,x:EOR0
mac
x0,y0,a
movep
x:EDRR0,y0
mac
x0,y0,a
x:G3,x0 y(n) = y(n)+G2 x(n-T2)
movep
x:EDRR0,y0
movep
x:SAMPLE,x:EDWR0
mac
x0,y0,a
C-10
; set FIR base address
; offset T1 and trigger mem. read
; wait 3 (DRAM) or 1 (SRAM) inst.
; cycles or do other tasks
; offset T2 and trigger mem. read
; get G1,clear accumulator
; get x(n-T1)
; offset T3 and trigger r mem. read
x:G2,x0
; y(n) = G1 x(n-T1),get G2
; wait 2 (DRAM) or 0(SRAM)
; inst. cycles or do other tasks
; get x(n-T2)
; get G3, wait 4 (DRAM)or 2 (SRAM) inst. cycles
; or do other tasks
; get x(n-T3)
; store x(n) in mem.
; calculate y(n) = y(n) + G3 x(n-T3)
DSP56009 User's Manual
MOTOROLA

Advertisement

Table of Contents
loading

Table of Contents