6.4. FINITE WORD LENGTH EFFECT 99
inputBuffer[N + i] = inputSamples[i];
}
for( i = 0; i < N; i++) {
temp = 0;
for( j = 0; j < N; j++) {
idx = N + (i - j);
result += (inputBuffer[idx]*coefficients[j])<<1;
}
output[i] = (short) (result>>16);
}
}
In the above code, the input frame size is considered to be equal to the number of coefficients
in the FIR filter. us, inputBuffer , which is an array of type short, should be twice the
number of FIR coefficients. Index zero in the array corresponds to the oldest sample and index
2N 1 corresponds to the newest sample. e first “for loop” performs the operation of shifting
the previous frame to the lower half of the array while copying in new samples to the upper
half. e second “for loop” implements the FIR convolution. Since inputBuffer contains the
newest samples in its upper half, the idx expression is computed to get the correct sample
corresponding to the FIR filter coefficient.
6.4 FINITE WORD LENGTH EFFECT
Due to the fact that memory or registers have finite number of bits, there could be a noticeable
error between desired and actual outcomes on a fixed-point processor. e so-called finite word
length quantization effect is similar to input data quantization effect introduced by an A/D
converter.
Consider fractional numbers quantized by a b C 1 bit converter. When these numbers are
manipulated and stored in an M C 1 bit memory, with M < b, there is going to be an error
(simply because b M of the least significant fractional bits are discarded or truncated). is
finite word length error could alter the behavior of a system to an unacceptable degree. e
range of the magnitude of truncation error "
t
is given by 0 j"
t
j 2
M
2
b
. e lowest level of
truncation error corresponds to the situation when all the thrown-away bits are zeros, and the
highest level to the situation when all the thrown-away bits are ones.
is effect has been extensively studied for FIR and IIR filters (for example, see [1]). Since
the coefficients of such filters are represented by a finite number of bits, the roots of their transfer
function polynomials, or the positions of their zeros and poles, shift in the complex plane. e
amount of shift in the positions of poles and zeros can be linked to the amount of quantization
error in the coefficients.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.163.58