Looking at the
raL raL+1
is. However, since these addresses are only relative positions on the ring buffer, the address description element “DEC” is added to the “...” part of the external memory read parameter “MR [...]”. “DEC” represents a counter that is decremented by 1 per sample, and the ring buffer operation is realized only by adding this to the address description element. The data read from the raL and raL + 1 positions on the ring buffer is
MEMS00 MEMS01
The above is expressed on the dAsms source code as follows.
LDI MEMS00,MR[raL+DEC] LDI MEMS01,MR[raL+DEC+1]
For reference, the addresses on the ring buffer accessed by the above two “MR [...]” are one address per sample by the action of “DEC” while keeping one address interval from each other. It will shift in the lower direction
(1) Multiply the value loaded in MEMS00 by the coefficient C0L.
(2) Multiply the value loaded in MEMS01 by the coefficient C1L and add it to the result of (1).
(3) Multiply the value of TEMP01 by the coefficient C2L and add it to the result of (2).
(4) Store the result of (3) in TEMP00.
The important thing here is that TEMP is a ring buffer. In TEMPxx, the subscript xx indicates the relative address as a ring buffer, and the data stored in TEMP00 appears in TEMP01 in the next sample. In (3) and (4) above, a delay of one sample is realized using this.
In dAsms, due to the characteristics of the SCSP / DSP hardware that it targets, the description method of the calculation formula is a little special. The contents of (1) to (4) above are expressed on the dAsms source code as follows.