Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Plain Text by Eugene Saun ( 14 years ago )
// ****************************************************
// 10th order lattice form IIR filter
// ****************************************************
// set up modify registers
M0 = 1;
M1 = 1;
// load r5 with the number of speech frame size -
// it will be used as the loop counter of the outer loop
r5 = r10,
// read the first sample from the input buffer - ep(n)
r0 = M[I0,M0];
// load r1 with the kp
r1 = M[I1,-1],
// load r2 with the bp-1(n-1)
r2 = M[I5,1];
// start the loop to filter the prediction error signal,
// i = 0, ..., BLOCK_SIZE - 1
// TODO: global constant - order of inverse filter
synthesis_loop:
// load loop counter with the (order of the filter - 1)
r10 = 9; // TODO: global constant - (order of inverse filter - 1)
// load rMAC with the ep(n)
rMAC = r0;
// compute the ep-1(n) = ep(n) + kp * bp-1(n-1)
rMAC = rMAC + r1 * r2,
// load r1 with the kp-1
r1 = M[I1,-1],
// load r2 with the bp-2(n-1)
r2 = M[I5,-1];
// temporarily store the ep-1(n) in r0
r0 = rMAC;
// start the loop to calculate the prediction error
// ej(n) at j-th stage of the filter, j = p-1, ..., 1
do lattice2_loop;
// load rMAC with the ej(n)
rMAC = r0;
// compute the ej-1(n) = ej(n) + kj * bj-1(n-1)
rMAC = rMAC + r1 * r2;
// temporarily store the ej(n) in r3
r3 = rMAC;
// load rMAC with the bj-1(n-1)
rMAC = r2;
// compute the bj(n) = bj-1(n-1) - kj * ej-1(n)
rMAC = rMAC - r1 * r3,
// load r1 with the kj+1
r1 = M[I1,-1];
// -
M[I5,2] = rMAC;
// load r2 with the bj(n-1)
r2 = M[I5,-1];
// move the ej-1(n) back to r0
r0 = r3;
lattice2_loop:
// -
M[I5,2] = r0;
// decrement the loop counter of the outer loop
r5 = r5 - M0,
// read the next sample from the input buffer - ei+1(n)
r0 = M[I0,M0],
// write the processed sample to the output buffer
M[I4,M1] = r0;
if NZ jump synthesis_loop;
Revise this Paste