Filtering Effects of a Simple Average
Russ Carpman
Hewlett-Packard Co.
This document describes the digital filtering effects of a simple average function, and shows how it may be used in combination with a low order analog filter to provide additional alias protection for a sampled data channel.  The average function can be expressed as a weighted sum of a sequence of samples as shown below.

average function
The average function is seen to be a simple FIR filter with equal weight coefficients on all taps.  The average function can be re-expressed as the convolution of the input sequence with the filter impulse response.

The filter's impulse response is:

The frequency response of this filter can be found by taking the Laplace transform of the impulse response h(t) and evaluating it at s = jw.

the integrand is 0 except for where t=nT

For a simple average, the hn are all equal to 1/N, so the Laplace transform is given by:

Evaluating the Laplace transform at s = jw yields:

This expression can be further simplified to:

The magnitude response of this function is periodic with period 2p/T plotted below for N = 8 and T = 1.

redefine with w, N, and T as parameters

The formulas listed above can be used to calculate the frequency response of the average function for any combination of N and T.  The plot below illustrates the effects of varying N and T while maintaining a constant NT product.  This averages over the same time period in all cases.  Note that the passband response is virtually identical for all three cases, but beyond the first null, performance is improved with increasing N.  In all cases, the response peaks back up to offer no attenuation at the sampling frequency.  Since the response is periodic in frequency, this peak will occur at all multiples of the sampling frequency.  This characteristic highlights the need for an analog filter on the input channel to offer additional alias protection.  The average function does provide a steeper rolloff than a low order analog filter, along with deep notches at multiples of 1/NT, except where these multiples are also multiples of the sampling frequency.

The plot below illustrates the responses obtained using several available TRIG:TIMER settings along with various average lengths chosen to achieve a data output rate near 200 Hz (actual is 208.33 Hz).  Note that the E1413 can do averaging internally for N equal to binary multiples ( 4 and 8 below ), but that external post processing would be required for N = 6.

The plot below is the same as the preceding plot with logarithmic axes.

The filtering effects of the average function are in addition to the analog input's filter characteristics, and the combined effects add on a logarithmic scale.  The plot below shows the combined effects of analog and digital filtering using a 75 Hz, second order analog input filter.

analog filter transfer function

analog filter magnitude response in dB

combined analog and digital response in dB

Note that if the averaged data are decimated in time by the factor 1/N (as is done using the E1413 average function), that the Nyquist frequency now becomes 1/N times the original sampling frequency, and the degree of alias protection must be measured from the new Nyquist frequency ( 104 Hz in the example above ).