Digital Signal Processing Reference
In-Depth Information
TABLE 4.3
Memory Organization of Coefficients and Samples for FIRcasm
Samples
Coefficients
Time n
Time n + 1
h(0)
A4 Æ x(n - (N - 1))
A4 Æ x(n - (N - 2))
h(1)
x(n - (N - 2))
x(n - (N - 3))
h(2)
x(n - (N - 3))
x(n - (N - 4))
.
.
.
.
.
.
.
.
.
h(N - 2)
x(n - 1)
x(n)
B4 Æ h(N - 1)
x(n)
¨ newest Æ
x(n + 1)
postdecremented without modification to point at the memory location containing
the oldest sample. As a result, the oldest sample, x ( n
-
( N
-
1)), is replaced (updated)
by x ( n
2)). The updating of the delay samples is for the next unit of time. As
the output at time n is being calculated, the samples are updated or “primed” for
time ( n
-
( N
-
+
1). At time n the filter's output is
() =-
(
)
(
(
)
) +-
(
)
(
(
)
) +◊◊◊+ ()
(
) +
()()
yn
hN
1
xn
--
N
1
hN
2
xn
--
N
2
h
1
xn
-
1
h
0
xn
2,...,an output
value is calculated, with each sample updated for the next unit of time. The newest
sample is also updated in this process, with an invalid data value residing at the
memory location beyond the end of the buffer. But this is remedied since for each unit
of time, the newest sample, acquired through the ADC of the codec, overwrites it.
Accumulation is in A8 and the result, for each unit of time, is moved to A4 to be
returned to the calling function. The address of the calling function is in B3.
The loop is processed 41 times. For each time n , n
+
1, and n
+
Viewing Update of Samples in Memory
1. Select
Memory using a 16-bit hex format and a starting address of
dly. The delay samples are within 82 (not 41) memory locations, each loca-
tion specified with a byte. The coefficients also occupy 82 memory locations
in the buffer h. You can verify the content in the coefficient buffer stored as
a 16-bit or half-word value. Right-click on the memory window and deselect
“Float in Main Window” for a better display with both source program and
memory.
2. Select
Æ
View
Æ
Mixed C/ASM. Place a breakpoint within the function FIR-
casmfunc.asm at the move instruction
Æ
View
Æ
MV A8,A4
You can either double-click on that line of code or right-mouse-click to Toggle
Breakpoint).
Search WWH ::




Custom Search