In
the process of analogue to digital
conversion, an analogue signal is converted into a digital signal which can then
be stored in a computer for further processing. Analogue signals are "real
world" signals - for example physiological signals such as
electroencephalogram, electrocardiogram or electrooculogram. In order for them to be stored and manipulated by a computer, these signals must
be converted into a discrete digital form the computer can understand.
An
example of an A/D board which performs the analogue to
digital conversion. This board is placed inside the computer where it communicates with
the rest of the computer hardware and software. An alternate way to
acquire a signal is to use an integrated device which comprises the
electronics necessary to acquire as well as amplify the signals (shown
to the right).
Powerlab* recording system has an A/D board
as well as amplifiers and communicates with the computer through its USB
port.
(ADInstruments)*
Using A/D conversion and a
computer to analyze data has many advantages over older non-computerized methods. Computer
data is easily transported and manipulated. Computer analysis of signals is far more
efficient than analysis by hand and paper. Most importantly, real-time
analysis can be performed - this means that signals can be analyzed as they are acquired
during the course of an experiment
Sampling
Consider the signal shown in the figure which
is part of an electroencephalogram. It is an analogue signal,
since it is continuously changing in time. Any arbitrarily given value that is within the
range of the signal can be obtained simply by measuring electrical
activity at the right
point in time. The object of A/D conversion is to convert this signal into a digital
representation, and this is done by sampling the signal. A digital signal
is a sampled signal, obtained by sampling the analogue signal at discrete points
in time. These points are usually evenly spaced in time, with the time between being
referred to as the sampling interval.
In the figure, the sampling interval is
2.5 milliseconds, with
samples being taken at the times indicated by the red dots on the waveform.
The electronic circuit that carries out the
process of sampling the signal and A/D conversion is called an analogue-to-digital
converter (ADC). Being an electronic device, it requires an electrical signal at its
input. Thus the first step in the process of A/D conversion is to convert the analogue
(non-voltage) signal into an analogue voltage signal. The device that carries out this
function is called a transducer. For signals which are inherently
voltages such as the electrocardiogram from the heart, the electrooculogram from the eyes,
or the electromyogram from muscle, transduction is of course not necessary.
Resolution
The ADC we are using is a 16 bit board. This
means that when it performs an A/D conversion, the ADC samples the analogue voltage
present at its input at that point in time and converts it into a 16-digit binary number.
Since each digit of a binary number can take one of the two values 0 or 1, a 16 bit (bit =
binary digit) number can take one of 2^16 = 65536 values, representing the
integers from 0
to 65535. Our ADC also has an input range of -10 000
millivolts (mV) to +10 000 millivolts (mV). This
means that the binary value 0000000000000000, which is equivalent to the
decimal number 0,
will be returned by the ADC to the computer when a voltage of -10 000 mV is present at its
input, and the binary number 1111111111111111, whose decimal equivalent is
65535, will be
returned when the input voltage is +10 000 mV. Thus, the input voltage range from -10
000 mV to
+10 000 mV is divided into 65536 levels, with each level being 20 000 mV/65536 = 0.305
mV
wide. This value will determine the resolution of the sampled signal.
In the
example above, the resolution is 0.305 millivolts. An input voltage
lying within one of these 0.305mV wide ranges is converted
into a specific binary number: for example, any voltage lying in the range from
-10 000 to
-9 999.695 will be converted to the binary number:
0000000000000000, while any voltage in the range between +9 999.695 and
+10 000 mV will be converted to the decimal number 65535.
Click
here for an interactive applet which will further help you visualize and
understand the process of A/D conversion.
Saturation
As mentioned previously, one important step
when carrying out A/D conversion is to keep the input signal within the input voltage
range of the ADC. In our case, should the input signal exceed 10 000 mV a 16 bit binary
number with an equivalent decimal value of 65535 would still be returned to the computer.
The computer would thus interpret the voltage being sent to be +10 mV, which would be
in error. This error is called saturation of the ADC. However, the input
signal should span as much of the ADC input voltage range as possible, without saturating
the ADC, since this increases the signal to noise ratio. Thus if the voltage range of the
input signal is much smaller than +/-10 000 mV, the signal should be amplified before being
fed to the input of the ADC.
However, the input signal to the ADC
should also spanas much of the ADC input voltage range as possible,
without saturating the ADC, since this increases the signal resolution.
For example, if the signal to be recorded is much smaller than +/- 10
000 mV, say +/- 5 000 mV, then the range over which the board operates
should be decreased. By changing the hardware
gain from 10 000 mV (10 V) to 5 V, the operating range of the
board is changed from +/- 10 000mV to +/-5 000 mV. This allows the
experimenter to record a +/- 2V signal with a significant improvement in
signal resolution ( 2 times greater). This occurs because the minimum
resolvable voltage would be 10 000 mV/65536 or 0.152 mV versus 0.305 mV
when the board's operating range was set to +/-10 volts.
Sampling Rate and Aliasing
Another consideration to be kept in mind
during the process of A/D conversion is the choice of
sampling rate. The sampling rate is
the frequency expressed in Hertz (Hz) at which the ADC samples the input analogue signal.
As mentioned before, the sampling interval is the time between successive samples: the
sampling rate is thus the inverse of the sampling interval. Generally speaking, the faster
the rate at which a signal changes, the higher the frequency content of the signal, and
the higher is the sampling rate needed to reproduce it faithfully.
This can be appreciated from the figure, which shows that
the rapidly rising phase of the wave form is not represented as well in the sampled
waveform as is the more slowly changing part. In fact, it can be proven mathematically
that the sampling rate to be used must be greater than twice the highest frequency
contained in the analogue signal. This critical sampling rate is called the Nyquist
Sampling rate.
The figure to the right below illustrates the
sampling of a sine wave using two different sampling rates. The times at which A/D
conversion are made are given by the vertical lines beneath the signal, while the red
asterisks on the waveform show the voltages that are sampled. The highest frequency
present in this signal is the frequency of the signal itself, since it is a simple
sine wave, and so contains only one frequency.
Note that the sampling rate in the upper figure is about
ten times higher than the highest frequency present in the signal and so is about five
times the Nyquist rate. The sampled signal is thus a reasonable approximation of the
analogue signal.
The lower figure
above shows the situation that results when the sampling rate is reduced
to about 1.2 times the highest frequency contained in the analogue
signal. This sampling rate is thus lower than the Nyquist rate, and the
sampled signal (dashed line) bears little resemblance to the analogue
signal. Note that the frequency of the sampled signal is much smaller
than that of the analogue signal. This artifactual result due to
improper choice of the sampling rate is called aliasing.
Why not always sample
at the highest rate possible? It is critical that the sampling rate be
sufficiently high. For example, in experiments in which the resting membrane potential of
skeletal muscle is measured, a sampling rate of about 25-50 Hz is sufficiently high. In
contrast, when measuring action potentials in nerve axons, which are much more rapidly
changing events, a sampling rate of 10-20 kHz is required. However, for a signal of given
frequency content, increasing the sampling rate beyond a certain point does not
significantly increase the fidelity with which the signal is rendered. In addition, the
cost of an ADC increases as higher sampling rates are desired. Finally, more computer
processing time and storage space in memory or disk are needed to process the larger
number of data points produced when the sampling rate is increased. Thus there is a
tradeoff between fidelity of reproduction on the one hand, and computer storage space,
computing time, and cost on the other.
Filtering
Any ADC has a maximum sampling rate. In some
circumstances, this maximum sampling rate is not high enough to satisfy the Nyquist
conditions mentioned above. In that case, one can pass the analogue signal through a low-pass
filter before sending it on to the ADC. This filter acts to remove some of the
high-frequency content of the signal that would otherwise alias down in frequency,
producing spurious low-frequency content along the lines illustrated above. Note that this
anti-alias filtering could remove high frequency information of physiological importance
to the phenomenon under investigation. If it is important to retain these higher
frequencies, one has no choice but to use a better data acquisition system that has a
higher sampling rate.
A biological signal can be broken down
into fundamental frequencies, with each frequency having its own
intensity. Display of the intensities at all frequencies is a power
spectrum. Usually we are interested in signals of a particular frequency
range or bandwidth. The bandwidth is determined by filters, which are
devices that alter the frequency composition of the signal.
Ideal
frequency-selective filter: is a filter that exactly passes
signals at one set of frequency and completely rejects the rest.
There are three types of filter:
Low frequency or in old terminology
high pass. Filters low frequencies.
High frequency or in old terminology
low pass. Filters high frequencies.
Notch filter. Filters one frequency,
usually 60 Hz.
Real filters or
hardware filters alter the frequency composition of the
signal. It means after filtering the signal, we cannot recover the
frequencies that have been filtered. Digital filters change the frequency
of the signal by performing calculations on the data. It means you can
record all the frequency components of your signal and by digitally
filtering it, eliminate the unwanted frequencies.
Noise
Any unwanted signal that modifies the
desired signal is noise. It can have multiple sources.
Thermal
noise: the random motion of atoms generates this random,
uniformly distributed noise.
Thermal noise is present everywhere and has a nearly constant
Power Spectral Density (PSD).
Interference: imposition of an unwanted signal from an
external source on the signal of interest.
Sampling
noise: another artifact of the acquisition process,
sampling noise occurs when you digitize a continuous signal with an
A/D converter that has finite number of steps. It is interesting to
note that you can dither (add white noise:
i.e.: does not vary with frequency) your signal to reduce the
overall sampling noise.
Narrowband/broadband: two general categories of noise.
Narrowband noise confines itself to a relatively small portion of
the overall signal bandwidth as defined by Nyquist. Broadband noise
occupies a significant portion of the Nyquist bandwidth. For
example, 60Hz-hum is narrowband because it typically limits itself
to a 60 Hz component. Thermal noise is definitely broadband because
its PSD is constant, meaning that it distributes its energy over
nearly the entire spectrum.
Signal to Noise Ratio (SNR): it is
a measurement of the amplitude of variance of the signal relative to the
variance of the noise. The higher the SNR, the better can you
distinguish your signal from the noise.
A few definitions to remember
Desired
signal: a signal that is not corrupted by noise
Signal
sampling: the process of obtaining a sequence of
instantaneous values of a particular signal characteristic, usually
at regular time intervals.
Sampling
frequency: it is the frequency at which the ADC samples
the analogue signal (usually in number of samples per second (Hz))
Sampling
period: the reciprocal of the sampling frequency, i.e.,
the interval between corresponding points on two successive sampling
pulses of the sampling signal.
sampling
range: the range between the minimal and maximal values
at which you sample the signal (if you sample between -10 V and +10
V the sampling range is 20 V)
Offset:
a fluctuation in the baseline value of the signal
gain and
amplification: it is the factor by which you multiply
your signal. If a gain is one, the signal remains unchanged; if the
gain is higher than 1, the signal is amplified. If the gain is lower
than one, the signal is reduced.
amplitude
saturation: it occurs when the intensity of the signal
exceeds the values within the sampling range. For example, if we
acquire a signal which intensity is +20 V and we are sampling
between -5V and +5 V. It produces a distortion of the signal, i.e.,
over the interval in which the signal reaches +20V, the output of
our ADC will be +5V.
Nyquist
interval: the maximum time interval between equally
spaced samples of a signal that will enable the signal waveform to
be completely determined. ----the Nyquist interval is equal to the reciprocal of twice the
highest frequency component of the sampled signal. ----in practice, when analogue signals are sampled for the purpose
of digital transmission or other processing, the sampling rate must
be more frequent than that defined by Nyquist theorem, because of
quantization error introduced by the digitizing process. The
required sampling rate is determined by the accuracy of the
digitizing process.
Nyquist Sampling rate: is the
value of the sampling frequency equal to twice the maximal frequency
of the signal we are acquiring.