<<

Effects of Sampling and Aliasing on the Conversion of 1.0 Analog Signals to Digital Format 0.8 Alias B Alias A Freq A Freq B Ruwan Welaratna, Data Physics Corporation, San Jose, California 0.6 Sampling Frequency A key step in any digital processing of and above. Unfortu- (51.2 kHz) 0.4 real world analog signals is converting nately, perfect filters are not physically Amplitude Nyquist the analog signals into digital form. We realizable in analog or digital form. Frequency sample continuous data and create a dis- Physically realizable filters must have 0.2 (25.6 kHz) crete signal. Unfortunately, sampling can variation in the passband, a smooth tran- 0 introduce aliasing, a nonlinear process sition from the passband to the stopband, 0 5 10 1520 2530 35 40 45 50 which shifts frequencies. Aliasing is an and finite attenuation in the stopband. Frequency, kHz inevitable result of both sampling and Therefore, we must design a filter with Figure 1. Frequency components above the sample rate conversion. It can be ad- unity gain and low variation in the pass- Nyquist frequency of 25.6 kHz will create dressed with a properly designed anti- band and with the lowest tolerable at- aliases. aliasing filter (AAF). An analog AAF tenuation in the stopband. must be applied before the initial sam- Note that finite attenuation means that out signals over time. Channel to channel pling process. If any sample rate conver- you cannot eliminate aliasing, only re- match is important when making cross sion, such as decimation, is performed, a duce it. Suppose you sample a signal that channel measurements. Low variation digital AAF must also be applied. An contains a 1 V tone at 1 kHz and a 1 V and low dispersion are both desirable, AAF is one of the limiting factors in sys- tone at 39.9 kHz. You wish to analyze the but are hard to achieve with high order tem performance. An improperly de- data to 20 kHz, so the sampling frequency analog filters. Channel to channel match signed AAF, or improper application of fs is 40 kHz. If the AAF gain is –80 dB in is compromised by analog component one, can introduce artifacts the stopband (above 20 kHz) then the variations. In the above example, sam- that may interfere with certain types of sampled signal will appear as a 1 V, 1 kHz pling at 51.2 kHz and keeping 20 kHz of analysis. Modern AAF architectures tone and a 0.1 mV, 100 Hz tone (the 39.9 information required an 8th order ellip- eliminate these artifacts. kHz tone aliases to 100 Hz and is attenu- tic filter. This filter has high variation and The Nyquist sampling theorem defines ated 80 dB). The amplitude of the alias is dispersion across the passband and is dif- the minimum sampling frequency to dependant on the original amplitude of ficult to fabricate. completely represent a continuous signal the out-of-band components and the If we could increase the sampling rate, with a discrete one. If the sampling fre- amount of attenuation in the AAF. The we could make the filter less aggressive, quency is at least twice the highest fre- effect is harder to analyze in the more thus reducing the variation and disper- quency in the continuous baseband sig- realistic case of broadband energy that sion and making it easier to manufacture. nal, the samples can be used to exactly must be rejected. All of the broadband We could even sample at a very high rate, reconstruct the continuous signal. A sine energy will fold back into the analysis then perform digital filtering (Figure 2). wave can be described by at least two band. In general, the AAF attenuation It is much easier to make low variation samples per cycle (consider drawing two must be chosen considering the desired filters digitally, and dispersion can be dots on a picture of a single cycle, then noise floor and the frequency content of essentially eliminated. Digital filters are try and draw a single cycle of a different the energy that needs to be rejected. trivially duplicated across channels. This frequency that passes through the same The next consideration is the width of technique is used in a class of analog to two dots). Sampling at slightly less than the transition band. Consider designing digital converters called delta-sigma two samples per cycle, however, is indis- a system with a useful frequency band- ADCs. For a 51.2 kHz sample rate, these tinguishable from sampling a width of 20 kHz and 80 dB of alias pro- converters often sample at 3.2768 MHz, close to but below the original frequency. tection. If the sampling frequency is 40 making the Nyquist frequency 1.6384 This is aliasing – the transformation of kHz, the AAF gain must change from 0 dB MHz. A 3rd order Butterworth filter pro- high frequency information into false low at 20 kHz to –80 dB at just over 20 kHz. vides sufficient anti-alias protection in frequencies that were not present in the We must increase the sampling frequency this situation. A Butterworth filter is original signal. The Nyquist frequency, to make the filter realizable. Consider a maximally flat in the passband, has maxi- also called the folding frequency, is equal sampling frequency fs = 51.2 kHz. The mally low dispersion, and is easier to fab- to half the sampling frequency fs and is Nyquist frequency is 25.6 kHz, which ricate than an elliptic filter. Additionally, the demarcation between frequencies that means that frequencies above 31.2 kHz the lower order means there are fewer are correctly sampled and those that will will fold back into the band of interest. parts, improving the channel to channel cause aliases. Aliases will be ‘folded’ Therefore, the AAF gain must go from 0 match. The rest of the filtering and from the Nyquist frequency back into the dB at 20 kHz down to –80 dB at 31.2 kHz sample rate conversion is performed digi- useful frequency range. Thus a tone 1 kHz (see Figure 3). The region between the tally inside the ADC with digital filters above the Nyquist frequency will fold highest useful frequency and the Nyquist that can be designed with essentially zero back to 1 kHz below, while a tone 1 kHz frequency is known as the guard band. dispersion. below the sampling frequency will ap- Frequencies in this range will be attenu- The advantage of the Butterworth anti- pear at 1 kHz as shown in Figure 1. Fre- ated and may suffer from aliasing, and are alias filter in dispersion performance is quencies above the sampling frequency usually discarded in the presentation of significant. Dispersion corresponds to fil- are also folded back. spectral results. ter delay that varies with respect to fre- Aliasing is irreversible. There is no So far we have considered the rejection quency. For instance, a pure delay corre- way to examine the samples and deter- band attenuation and guardband width as sponds to a linear phase shift. If the phase mine which content to ignore because it performance limits in AAF design. Three is not a straight line, the delay will be came from aliased high frequencies. more error sources are passband varia- different for different frequencies. Thus, Aliasing can only be prevented by attenu- tion, dispersion, and channel to channel broadband signals, like transients, will be ating high frequency content before the match. These error sources are in the spread in time, or dispersed. The deriva- sampling process as shown in Figure 2. passband, and are thus very important in tive of the phase with respect to fre- To prevent aliasing completely, we must determining the overall performance of quency provides a measure of the delay. apply a perfect filter that passes all en- the system. Passband variation creates If we examine this function for the two ergy from DC to the highest frequency of absolute accuracy errors, while disper- proposed AAFs shown in Figure 4, we see interest and rejects all energy at the sion, or nonconstant group delay, spreads that the 8th order elliptic filter has over

12 SOUND AND VIBRATION/DECEMBER 2002 (Always included in delta-sigma ADCs)

AAF Filter Continuous To AAF Filter Digital x[n] x(t) (Analog, Discrete (Digital, Resampling (Discrete, (Continuous, Lowpass) Conversion Lowpass) Process unknown alias protected) bandwidth)

Sample Clock Resample Clock (fs, Hz) (Ns Samples)

Figure 2. An anti-aliasing filter is required before sampling or sample rate conversion.

0 plify analog design and manufacturing, Region between folding the ADC can be used at a fixed sample frequency and stopband –20 folds onto region between rate. Then digital filters are implemented passband and folding frequency. in a DSP (Digital Signal Processor) for fur- –40 ther sample rate conversion. The question might arise, should the –60 acquisition system use an AAF at all? Amplitude, dB After all, oscilloscopes do not include Passband (20 kHz) Stopband (31.2 kHz) –80 dB Rejection –80 any filtering. Oscilloscopes, however, are

Nyquist Frequency capable of significantly higher sample –100 01020 30 40 50 60 70 rates than typical frequency domain ori- Frequency, kHz ented instruments. A state of the art scope boasts GHz sample rates. It is quite easy Figure 3. 8th order elliptic analog AAF for 51.2 kHz sampling, 20 kHz useful bandwidth. to start at the high end of the sample rate range and work down, observing if the character of the signal changes. Dynamic 1.0 signal analyzers and vibration control- lers, on the other hand, have sample rates 0.8 8th Order Elliptic 3rd Order Butterworth that do not go much above the frequen- cies they are used to measure, so aliasing

= 51.2 kHz) 0.6 s is a larger concern. Certain analysis techniques, such as 0.4 shock response spectrum calculations,

0.2 have also historically not included filter- ing. Suppose the signal is inherently Delay, Samples (f Delay, 0 within the frequency band of interest. An 048 12 16 20 AAF with high dispersion will tend to Frequency, kHz alter the time domain shape of the signal, Figure 4. Delay versus frequency over 20 kHz spreading it out. However, today’s AAF passband for two proposed AAFs. architectures create almost no dispersion, so the time domain shape will be un- 0.6 more samples of delay at 20 kHz than changed. In this case, using the AAF when near DC. However, the 3rd order makes no difference in the final result. Butterworth filter has less than 0.015 Now suppose the signal has energy be- samples of delay difference. This filter yond the AAF cutoff. If you use the AAF, will not noticeably change the shape of this energy will be attenuated, providing any time domain pulses. a more correct answer. If you do not use What if we want to sample at a lower the AAF, this energy will be folded into rate? The examples we’ve discussed so the analysis band, contaminating the an- far use 51.2 kHz sampling to acquire 20 swer in a manner that is impossible to kHz information. What if we want to ana- characterize. lyze data to 10 kHz? We could sample at As we have discussed, the purpose of 25.6 kHz to keep the ratio of passband to an AAF is to attenuate (not eliminate) fre- stopband the same. Then the Nyquist fre- quencies that may alias into the analysis quency would be 12.8 kHz for normal band in the course of sampling. Aliasing sampling, and 819.2 kHz for delta-sigma scrambles frequency content and is im- ADCs. The AAF must be scaled with the possible to correct after sampling. Impor- sampling frequency. In fact, as the sample tant characteristics for an AAF are mini- rate is reduced, the aliasing band might mal variation in the passband, linear encounter more energy than initially phase shift for low dispersion, width of thought. For instance, 819.2 kHz is in the the transition band, and attenuation in middle of the AM radio band, exposing the stopband. A combination of analog the delta-sigma ADC to a strong source of and digital filters, with appropriate aliasing energy. If we go to very low sample rate conversions, are used in cur- sample rates, the aliasing energy may in- rent designs of high performance sam- clude mechanical and acoustic signals, pling systems. The use of an AAF is al- which will definitely be present in the ways recommended when sampling acquired data. It is very important that dynamic signals. some AAF be used, whether purely ana- The author can be contacted at: rwelaratna@ log or a mix of analog and digital. To sim- dataphysics.com.

SOUND AND VIBRATION/DECEMBER 2002 13