The basics of DSP for use in intelligent sensor applications: Part 2

Creed Huddleston

July 6, 2010

Creed Huddleston

Sampling the Analog Signal
Sensor signals are inherently analog signals, which is to say that they are continuous in time and continuous in their value. Unfortunately, processing analog signals as analog signals requires special electronic circuitry that is often difficult to design, expensive, and prone to operational drift over time as the components age and their properties change.

A far better approach is to convert the input analog signals to a digital value that then can be manipulated by a microprocessor. This technique is known as analog-to-digital conversion, or sampling.

Figure 2.7a. Example of a Continuous-time Voltage Signal

Figure 2.7a above shows an example of a continuous time voltage signal, and Figure 2.7b below shows the sampled version of that signal. One key concept that can sometimes be confusing to those who are new to sampled signals is that the sampled signal is simply a sequence of numeric values, with each numeric value corresponding to the level of the continuous signal at a specific time.

Figure 2.7b. Corresponding Sampled Version of the Signal in Figure 2.7a

For a sampled signal such as that shown in Figure 2.7b, the signal is only valid at the sample time. It is not zero-valued between samples, but the convention for presenting sampled data graphically is to display the sample values on a line (or grid), with the X-axis denoting the parameter used to determine when the data is sampled (typically time or a spatial distance).

Another convention is to associate sampled signal values in a sequence using an index notation. In this scheme, the first sample of the signal x(t) would be x0, the second sample would be x1, and so on.

If we add two signals x and y, then the resulting signal z is simply the sample-by-sample addition of the two signals:

Sampling has two important effects on the signal. The first of these effects is what’s known as spectral replication, which simply means that a sampled signal’s frequency spectrum is repeated in the frequency domain on a periodic basis, with the period being equal to the sampling frequency.

Figure 2.8a. Example Analog Signal Frequency Spectrum

Figures 2.8a above and 2.8b below show an example of the frequency spectrum of an example signal and the resulting frequency spectrum of the sampled version of the signal.

Figure 2.8b. Corresponding Frequency Spectrum of the Sampled Signal

As one can easily see, a problem arises when the highest frequency component in the original signal is greater than twice the sampling frequency, a sample rate known as the Nyquist rate.

In this case, frequency components from the replicated spectra overlap, a condition known as aliasing since some of the higher frequency components in one spectrum are indistinguishable from some of the lower frequency components in the next higher replicated spectrum.

Aliasing is generally a bad condition to have in a system and, although the real world precludes eliminating it entirely, it is certainly possible to reduce its effects to a negligible level.

Let’s look at a simple example to illustrate how aliasing can fool us into thinking that a signal behaves in one way when in reality it behaves totally differently. Imagine that we are sampling the position of the sun at various times during the day over an extended period of time.

Figure 2.9a. Sun’s Position Sampled Every 1.5 Hours

Being good scientists, we want to verify that our sampling rate really does make a difference, so we decide to take two sets of measurements using two different sampling rates.

The results from the first set of measurements, which employ a sampling rate of once every 1.5 hours, are shown in Figure 2.9a above. As we would expect, the measurements show that the sun proceeded from east to west during the course of the experiment.

Now take a look at the results from the second set of measurements, which have a sampling rate of once every 22.5 hours in Figure 2.9b below.

From the data, we can see that the sun appears to move from west to east, just the opposite of what we know to be true! This is exactly the type of error one would expect with aliasing, namely that the signal characteristics appear to be something other than what they really are (hence the term aliasing).

Figure 2.9b. Sun’s Position Sampled Every 22.5 Hours

Low-pass Filters
We’ve seen an example of the first type of filter, the low-pass filter, which passes low-frequency components and blocks high-frequency signal components. An idealized example of a low-pass filter is shown in Figure 2.10 below, in which the passband, the frequency range of the signal components that are passed, is 1500 Hz wide. Note that the bandwidth in this case is also 1500 Hz, since that’s the highest frequency component of the filter.

Figure 2.10. Idealized Low-pass Filter with a Bandwidth of 1500 Hz

Low-pass filters are probably the most widely used type of filter for the simple reason that, in the real world, we don’t deal with signals of infinite bandwidth.

At some point, the frequency content of a signal drops off to insignificance, so one of the most common approaches to noise reduction is to establish some limit for the frequency components that are considered to be valid and to cut off any frequencies above that limit.

For example, when we are using thermocouples to measure temperature, the thermocouple voltage can change only so quickly and no faster because the temperature of the physical body that is being monitored has a finite rate at which it can change (i.e., the temperature can’t change discontinuously).

In practice, this means that the frequency components of the temperature signal have an upper bound, beyond which there is no significant energy in the signal.

If we design a low-pass filter that will cancel all frequencies higher than the upper bound, we know that it must be killing only noise since there are no valid temperature signal components above that cutoff frequency.

< Previous
Page 2 of 4
Next >

Loading comments...

Most Commented

  • Currently no items

Parts Search Datasheets.com

KNOWLEDGE CENTER