Fast and precise implementation of low-pass digital filters for data acquisition.
Data acquisition is the first step in every application that involves digital signal processing. In order to ensure a high quality of acquired signal, good signal conditioning is required, especially for avoiding alias.
An analog low-pass filter (Mancini, 2003) is placed before the A/D converter to remove all signal components with frequencies greater than half of sampling frequency fs. Because electronic implementation of good low-pass filters (sharp transition between pass-band and stop-band) is very difficult and expensive, oversampling techniques are often used.
The structure of an oversampled data acquisition system is presented in Figure 1.
The sampling frequency of the A/D conversion is N times greater than the desired sampling frequency. Hence, the analog filter can have a lower complexity. The actual low-pass filtering is done by a digital filter with the ratio between the cut-off frequency and the Nyquist frequency of 1 :N.
This structure requires a large amount of computational effort for the digital filter evaluation, because of the high values of product N-fs. In order to avoid processor overloading, fixed point implementation is required.
This paper introduces an implementation form for the digital low-pass filter, which achieves a good precision of output evaluation, while keeping low the computational effort.
2. DIGITAL FILTER IMPLEMENTATION
A high order filter can be decomposed in a set of elementary filters (first or second degree) connected either in series or parallel (Shenoi, 2006). Hence, implementation of a high order filter leads to implementation of elementary filters.
There are two main issues related to fixed point implementation of a digital filter: quantisation of filter coefficients and control of round-off errors.
Quantisation of coefficients can distort the frequency response. Several techniques were developed to reduce distortions (Krukowsky & Kale, 1999; Vanuytsel et al., 2002). However, in case of data acquisition, the sensitivity of coefficients to quantisation is only a minor problem.
The second issue is created by signal rounding and has two caveats: limit-cycle oscillations and round-off noise. Limit-cycle oscillations are undesirable periodic components of filter output, which are not generated by the input signal. Round-off noise affects the filter output like a random perturbation.
[FIGURE 1 OMITTED]
There are several methods to reduce the effects of round-off errors. Some of them are based on quantisation error compensation, such as Error Spectrum Shaping, or finding a filter structure less affected by these errors--Low-Noise Design via State Space Optimisation (Douglas, 1987).
A very good reduction of round-off errors can be obtained by increasing the number of bits used for signal representation. For example, second orders filter implemented in direct form I is described by the following equation:
[y.sub.k] = [b.sub.0] [u.sub.k] + [b.sub.1] [u.sub.k-1] + [b.sub.2] [u.sub.k-2] - [a.sub.1] [y.sub.k-1] - [a.sub.2] [y.sub.k-2], (1)
where [u.sub.k] and [y.sub.k] stand for the actual input and output samples, [u.sub.k-1], [u.sub.k-2], [y.sub.k-1], [y.sub.k-2] are previous samples of these signals and [a.sub.1,] [a.sub.2,] [b.sub.0,] [b.sub.1,] [b.sub.2] are filter coefficients.
The value of [y.sub.k] is a sum of products between filter coefficients and signal samples. If fixed point arithmetic is used, the product of two numbers represented on [N.sub.1] and [N.sub.2] bits requires [N.sub.1] + [N.sub.2] bits.
In order to avoid a growing number of bits for [y.sub.k] representation, the sum in Equation 1 is quantized to same number of bits as the input samples. The round-off error introduced by this quantisation is fed back in the filter equation at next steps via [y.sub.k-1] and [y.sub.k-2] samples.
If reduction of round-off errors is desired, the number of bits used for the binary representation of [y.sub.k], [y.sub.k-1] and [y.sub.k-2] samples must be increased by [N.sub.x] bits. The influence of [N.sub.x] over round-off effects is presented in Table 1.
The values in Table 1 were obtained for two 8-orders Butterworth low-pass filters F1 and F2. The ratio between cutoff frequency and the Nyquist frequency is 1:10 for F1 and 1:20 for F2.
The values of round-off noise energy were estimated as the energy of difference between the outputs of the "ideal" filter (implemented using double precision floating point) and the fixed point implementation. Two white noise input signals were used: one with [+ or -] 5000 LSB and another one with [+ or -] 500 peak to peak amplitude. Although the first one produces higher round-off noise energy than the second one (see columns 3 and 5 of Table 1), as [N.sub.x] increases, the difference is attenuated. For 8 bits added to each signal sample, the difference is canceled. This proves that the technique is quite robust.
Obviously, it can easily be noticed that adding extra-precision bits for output samples lead to reduction of round-off effects. Adding 8 bits is enough for limit-cycle elimination and reduction of round-off noise to a negligible level.
In the next section, a new digital filter structure is presented. It allows similar performances as the one with 8 extra-precision bits but without additional arithmetic complexity caused by the bits number growing.
3. THE PROPOSED STRUCTURE OF THE DIGITAL FILTER
Because any filter of even orders can be decomposed in a series connection of second orders filters, in this section, the new filter structure is presented for the second orders filter case.
The round-off errors (especially induced by limit-cycle) are more important when the filter approaches the steady-state and the outputs variations are small.
Because the low-pass filter has unitary gain, the filter coefficients have the following property:
[b.sub.0] + [b.sub.1] + [b.sub.2] = 1 + [a.sub.1] + [a.sub.2]. (2)
According to this, equation 1 can be rewritten in terms of output variation, as below:
[dy.sub.k] = [b.sub.0] [u.sup.*.sub.k] + [b.sub.1] [u.sup.*.sub.k-1] + [b.sub.2] [u.sup.*.sub.k-2] + [a.sub.2] [dy.sub.k-1], (3)
[MATHEMATICAL EXPRESSION NOT REPRODUCIBLE IN ASCII]. (4)
The filter output [y.sub.k] can be obtained if previous sample [y.sub.k-1] is stored:
[y.sub.k] = [y.sub.k-1] + [dy.sub.k] (5)
Assuming that n bits of arithmetic precision are available, higher precision of output can be achieved if [y.sub.k-1] and [dy.sub.k-1] are stored using n+8 bits (with 8 extra-precision bits).
In order to avoid additional arithmetic complexity for evaluation of the [a.sub.2] [dy.sub.k-1] term, the following technique is used:
* if [dy.sub.k-1] [member of] [??][-2.sup.n-1] ... [2.sup.n-1] - 1[??] (i.e. the value fits in n bits), then the [a.sub.2] [dy.sub.k-1] product is computed using only the least significant n bits of [dy.sub.k-1] value;
* otherwise, the [a.sub.2] [dy.sub.k-1] product is computed using the most significant n bits of [dy.sub.k-1] value (discarding the least significant 8 bits).
The sum of Equation 3 is computed within 2n bits precision and only n+8 bits are retained for the [dy.sub.k-1] value. The output value in Equation 5 is computed within n+8 bits precision.
This technique allows keeping multiplications to n x n precision, only the additions being performed using higher number of bits.
Performance evaluation of this new implementation was tested in the cases of the two 8-order filters analysed in the previous section.
The tests were performed in same conditions and the results are presented in Table 2:
It can be noticed that limit-cycle effect was reduced to zero and round-off noise energy is small enough to be negligible, like in case [N.sub.x] = 8 of Table 1. However, in this case, the computational complexity is smaller.
The proposed structure for low-pass filter implementation provides good accuracy for the output signal, while using no extra arithmetic complexity.
The low arithmetic complexity allows high orders filters to be used in data acquisition systems, which are implemented on low-end microcontollers.
Further research inversigations are necessary, in order to analyse structure sensitivity to overflow errors, which can occur in fixed point implementation. Another possible approach is to adapt this structure for different types of digital filters like band-pass and high-pass.
Douglas, F.E., (1987). Handbook of Digital Signal Processing --Engineering Applications, Academic Press Inc., ISBN 0-12-237075-9, San Diego, California, 92101
Krukowsky, A. & Kale, I. (1999). Two approaches for fixed-point filter design: "bit-flipping" algorithm and constrained downhill simplex method, Proceedings of Fifth International Symposium on Signal Processing and its Applications ISSPA'99, vol. 2, pp 965-968, ISBN 1-86435451-8, Brisbane, Australia, August 1999, Queensland University of Technology, Queensland, Australia
Mancini R. (2003). Op amps for everyone--Design reference, Elsevier Science (USA), ISBN 0-7506-7701-5, Burlington, MA 01803, USA
Vanuytsel, G., Boets, P., Van Biesen, L. & Temmerman, S. (2002). Efficient Hybrid Optimization of Fixed-Point Cascaded IIR Filter Coefficients, Proceedings of the 19th IEEE Instrumentation and Measurement Technology Conference, vol. 1, pp. 793-797, ISBN 0780372182, Anchorage, Alaska, USA 21-23, May 2002, IEEE, Piscataway, New Jersey, USA
Shenoi A.A. (2006). Introduction to Digital Signal Processing and Filter Design, John Wiley & Sons, Inc., ISBN 0-471-46482-1, Hoboken, New Jersey, USA
Tab. 1. Influence of extra-precision bits over round-off errors Filter F1 (1:10) Filter F2 (1:20) [N.sub.x] Max. limit- Round-off Max. limit- Round-off cycle noise energy cycle noise energy aplitude [LSB] aplitude [LSB] [LSB] [LSB] 0 11 27.86 / 23.20 59 93.7 / 34.5 1 7 13.83 / 12.82 31 49.0 / 28.9 2 3 6.95 / 6.70 15 25.1 / 19.7 3 1 3.49 / 3.43 7 12.7 / 11.4 4 0 1.77 / 1.75 4 6.39 / 6.07 5 0 0.93 / 0.92 1 3.21 / 3.13 6 0 0.54 / 0.54 0 1.63 / 1.61 7 0 0.38 / 0.38 0 0.86 / 0.85 8 0 0.33 / 0.33 0 0.50 / 0.50 Tab. 2. Test results of the new filter structure Filter F1 Filter F2 Max. limit- Round-off Max. limit- Round-off cycle aplitude noise energy cycle aplitude noise energy [LSB] [LSB] [LSB] [LSB] 0 2.40 / 1.01 0 2.46 / 1.05
|Printer friendly Cite/link Email Feedback|
|Author:||Petrescu, Catalin; Stefanoiu, Dan; Lupu, Ciprian|
|Publication:||Annals of DAAAM & Proceedings|
|Date:||Jan 1, 2009|
|Previous Article:||A low-cost solution for controlling human body vibrations.|
|Next Article:||Dilatancy in unreinforced masonry.|