Upload
al-jonathan-tolentino
View
220
Download
0
Embed Size (px)
Citation preview
8/21/2019 Unesco Final
1/53
Digital Signal Processing with Applications in Medicine
Paulo S. R. Diniz***, David M. Simpson**, A. De Stefano**, and Ronaldo C. Gismondi*.
* School of Medicine, State University of Rio de Janeiro, Brazil
** Institute of Sound and Vibration Research, University of Southampton, UK
*** Program of Electrical Engineering, COPPE/EE/Federal University of Rio de Janeiro, Brazil
Corresponding Author:
Paulo S. R. Diniz
Prog. de Engenharia Eltrica e Depto. de Eletrnica
COPPE/EE/Federal University of Rio de Janeiro,Caixa Postal 68504, Rio de Janeiro, 21945970
Brazil
1
8/21/2019 Unesco Final
2/53
1. Introduction
Most natural phenomena occur continuously in time, such as the variations of temperature of the
human body, forces exerted by muscles, or electrical potentials generated on the surface of the
scalp. These are analogue signals, being able to take on any value (though usually limited to a finite
range). They are also continuous in time, i.e. at all instants in time is their value available. However,analogue, continuous-time signals are not suitable for processing on the now ubiquitous computer-
type processors (or other digital machines), which are built to deal with sequential computations
involving numbers. These require digital signals, which are formed by sampling the original
analogue data.
The theory of sampling was developed in the early 20 th century by Nyquist [1] and others, and
revolutionized signal processing and analysis [2]-[6] especially from the 1960s onwards, when the
appropriate computer technology became widely available. The rapid development of high-speed
digital integrated circuit technology in the last three decades has made digital signal processing the
technique of choice for many most applications, including multimedia, speech analysis and
synthesis, mobile radio, sonar, radar, seismology and biomedical engineering. Digital signalprocessing presents many advantages over analog approaches: digital machines are flexible,
reliable, easily reproduced and relatively cheap. As a consequence, many signal processing tasks
originally performed in the analog domain are now routinely implemented in the digital domain,
and others can only feasibly be implemented in digital form. In most cases, a digital signal
processing systems is implemented using software on a general-purpose digital computer or digital
signal processor (DSP). Alternatively, application specific hardware usually in the form of an
integrated circuit can also be employed.
In this chapter we will discuss a number of fundamental principles and basic tools for digital signal
processing. These will be illustrated with examples from medical applications, where signal
analysis has been widely applied in patient monitoring, diagnosis and prognosis, as well asphysiological investigation and in some therapeutic settings (e.g. muscle and sensory stimulation,
hearing aids).
We will first discuss the principles of sampling. Here it is demonstrated that certain signals (those
limited in the range of frequencies they contain), can be fully represented by a sequence of samples.
These digital signals coincide with the original analog (and continuous-time) signals at predefined
time instants. By interpolation, the continuous-time signal can be recovered (without error!) from
the sequence of samples.
Next we will discuss digital filters, which are one of the main tools employed in signal processing,
as they suppress certain frequency bands, and enhance others. This is particularly useful in reducingnoise and other sources of interference, which are an almost constant problem in medical
applications. In these signals the most common sources of noise are electromagnetic interference at
50/60 Hz (and in higher frequency ranges), and contamination by other, unwanted physiological
signals (e.g. electrical signals from muscles may obscure signals of neural origin). Patient motion
often results in short-lasting artifacts in recorded data, and filters can again be used to mitigate
these. Digital filters can also be employed to describe the relationship between physiological
signals, such as that between blood pressure and blood flow. As such, they are also useful in
characterizing physiological systems.
In Fourier analysis, a signal is split into constituent sinusoidal oscillations (we will assume that
readers are familiar with the continuous time Fourier transform), and the discrete Fourier transform
is an extension developed for the analysis of digital signals. For the current work in particular, it
2
8/21/2019 Unesco Final
3/53
provides a very convenient tool for specifying and describing digital filters, and it also provides the
basis for the sampling theorem.
Many signals, including most from a biomedical origin, can be classified as random: repeated
recordings result in signals that are all different from each other, but share the same statistical
characteristics. The power spectrum reflects some of the most interesting of these characteristics.
The interpretation and estimation of the power spectral density will be addressed in the final part ofthis chapter.
3
8/21/2019 Unesco Final
4/53
2. Digital Signal Processing of Continuous-Time Signals
A typical digital signal processing system includes the following subsystems, as illustrated in Fig 1.
A/D Converter transforms the analogue input signal into a digital signal. It does so by
acquiring samples from the signal at (normally) equally spaced time intervals and converting thelevel of these samples into a numeric representation that can be used by a digital signal processing
system. In accordance with the sampling theorem, a low-pass (anti-alias) filter is usually required
prior to A/D conversion.
Digital Signal Processing - the digital signal processing system (DSPS) performs arithmeticoperations on the input sequence. In a typical application, the desired signal features are enhanced
in output signal, and unwanted components (such as noise and artifact) are suppressed. Further
analysis of the output signal may be carried out in order to extract information. In a medical
application, this could for example be to determine the average heart-rate, the peak blood pressure,
or an index of muscle activity. If an output signal is required (e.g. in a hearing aid), the next two
steps are carried out.
D/A Converter - converts the DSPS output into analog samples that are equally spaced in time.
Lowpass Filter - converts the analog samples into a continuous-time signal. This step isequivalent to an interpolation operation between the discrete analogue samples produced in the
previous step.
Figure 1. Architecture of a complete DSPS used to process an analogue signal.
EXAMPLE 1.A hearing aid
A hearing aid may be used to illustrate the operation of a DSPS: the sound is picked up
by the microphone, converted into an electric signal, and then digitized. The digital signal
is then filtered to selectively amplify those frequency bands in which the patient shows
the most severe hearing loss. Further processes may also be applied, including amplitude
compression, in which the system gain is reduced when the amplitude exceeds some pre-
defined threshold values, in order to avoid excessive loudness to the ear. Finally the
processed digital signal is converted back to analog form in the digital-to-analog (D/A)
converter, and delivered to the ear via the earphone.
4
8/21/2019 Unesco Final
5/53
2.7 2.75 2.8 2.85 2.9 2.95 3-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
time [s]
a.u.
Figure 2. A short segment of speech signal, that may form the input to a hearing aid. The
segment displayed corresponds to the sound /um/.
2.7 2.75 2.8 2.85 2.9 2.95 3-6
-4
-2
0
2
4
6
time [s]
a.u.
Figure 3. The output of the digital filter (digital signal). The frequencies around 1500 Hz,where the patient showed the greatest loss in hearing, have been most amplified. Further
details on the filter used may be found in an example below.
5
8/21/2019 Unesco Final
6/53
0 2 4 6 8
-100
-50
0
50
100
time [s]
a.u.
input signaloutput signal
Figure 4. In a further stage of signal processing in hearing aids, the amplitude-range
may be compressed. Thus the gain of the system is progressively reduced when the
sound-volume exceeds a specified level, as is the case near the end of this recording. A
small delay in adapting the gain to the signal-levels may also be noted, as the average of
the most recent amplitudes drives the gain control.
In signal analysis the periodic signals play a major role since they serve as basic signals from
which many other signals can be constructed and analyzed. Lets take as example the sinusoid
sin , that is a periodic signalsincesin( = sin . There are periodic signalsthat are harmonically related, meaning that they consist of a set of periodic signals whose
fundamental frequencies are all multiples of a single positive frequency . For example, theperiodic signalssin k , for any integer k, is called the k-th harmonic of sin . Also insignal analysis it is often performed a linear transformation of the signal from the time domain
to the frequency domain and vice versa, depending on the domain in which either the relevant
information is exposed in a clearer way or the mathematical manipulations are simpler. In the
particular case of periodic signals, they have quite compact representation in the frequency
domain where only the fundamental frequency information and their harmonics are required,whereas in the time domain they are represented by a continuous function of time.
t0 t)20 + t0
0
t0 t0
0
6
8/21/2019 Unesco Final
7/53
3. Sampling of Continuous-Time Signals
The sampling theorem states that a band-limited continuous-time signal, , whose frequency
content has no energy beyond the frequency can be exactly recovered from sample values, ,
taken at the time instants t , provided the sampling frequency is larger than twice
. The sampling rate is called the Nyquist rate. The original continuous-time signal can berecovered from the sampled signal by the interpolation formula
)(tx
T/
cf )(nx
nT=
c
fs 1=
cf f2)(nx
[ ]
=
=
n s
s
nTt
nTtsinnxtx
2)(
2)()()(
(1)
withT
fss
2
2 == . Directly applying the above interpolation formula for the recovery of a
continuous-time signal from its samples is however not feasible, since this involves the summation
of an infinite number of terms, and requires future as well as past samples of the signal . The
digital-to-analog (D/A) converter and low-pass filter of Fig. 1 approximate this equation in anefficient manner.
)(nx
When a continuous-time signal is sampled with a sampling frequency smaller than the
Nyquist rate, distinct frequency regions of will be mixed, causing an undesirable and
irremovable distortion in the digital signal (and the continuous-time signal recovered from the
samples), known as aliasing. This issue will be further discussed.
)(tx sf
)(tx
The sampling process can be considered as multiplying (in the time-domain) the continuous-time
signal by a train of unitary impulses at time intervals of T: . The resulting
signal is , which consists of a sequence of samples of . Fig. 5-b illustrates thefrequency representation of the original signal before sampling. Fig. 5-c shows the spectrum of
the impulse train . According to the convolution theorem [6], the Fourier transform of the
sampled signal is given by the convolution, in the frequency domain, of the Fourier transform
of the impulse train and the Fourier transform of the original signal before sampling. This leads to
the following result, illustrated in Figs. 5- b and c:
)(tx
x
)()( iTttxi =
)(tx)()()( txtxt i=
)(txi
)(tx
)(tx
)(121
)(* ljjXTT
lj
TjX
TeX s
l
a
l
j
=
=
+=
+= , (2)
where is the Fourier transform of the sampled signal, is the Fourier
transform pair of the original analogue signal, and l is any integer. From the above equation and
Fig. 6 it can be inferred that the spectrum of the sampled signal will be repeated at a frequency
interval of
)(* jeX )()( txeX j
T
2s = .
This periodic repetition of the spectrum is illustrated in Fig. 6. The continuous-time signal is shown
in Fig. 6-a; Figs. 6-b and 6-c show the sampled signal spectra for the cases 2sc > and
2sc < , respectively. It can be concluded that in the latter case the original spectrum is
preserved in the frequency range and . Figure 6-b however shows that when the sampledsignal has frequency components above
c c2s (half the sampling frequency), the repeated spectra
7
8/21/2019 Unesco Final
8/53
overlap and result in distortion at frequencies around 2s . This is aliasing, and undesirable in most
cases, as a frequency component (say ) originally above1 2s will be transferred to a frequency
an equal distance below 2s1.
th )(
To avoid aliasing, clearly the maximum frequency of the continuous-time signal must be known.
This is usually achieved by applying a low-pass filter (the so-called anti-alias filter) prior tosampling. This filter eliminates frequency-components above its cut-off frequency, which may then
be taken as . In practice the filter only attenuates high frequency components to a level at whichthey become insignificant (see example below). Due to the imperfections of the anti-alias filter and
more generally the smooth decay of signal spectra, usually sampling rates of 35 times (whichis only a nominal value) are chosen.
c
c
The recovery of the continuous-time signal spectrum from the sampled signal sampling can be
accomplished, in theory, by using an analog filter (filters will be discussed in more detail below)
with a flat frequency response, that retains only the components between 2s and 2s of the
spectra shown in Fig. 6-c, and that sets the spectrum outside the range 2s to 2s to zero. Thefrequency and impulse responses of the analog filter with these characteristics are shown in Fig. 7.
The impulse response of this filter is
t
tsinT lp
)(= (3)
1
More rigorously, will be transferred to a frequency (which is a negative frequency). However, for realsignals (i.e. those without an imaginary component) spectra are symmetric (as illustrated in the figure), and will bealiased to .
1 s1
1
1s
8
8/21/2019 Unesco Final
9/53
(a) Signal sampling corresponds to time-domain multiplication.
((b) Spectrum of the continuous-time signal )tx .
)(tx(c) Spectrum of the impulse train .i
Figure 5. Sampling of continuous-time signals.
9
8/21/2019 Unesco Final
10/53
(a) Spectrum of the continuous-time signal )(tx .
)(* tx(b) Spectrum of sampled signal for 2sc > . The spectrum of the sampled signal is given by
the sum of the overlapping spectra.
)(* tx f(c) Spectrum of sampled signal or 2sc < .
Figure 6. The effect of sampling on the spectrum.
10
8/21/2019 Unesco Final
11/53
Figure 7. Ideal lowpass filter.
a means analog frequency.
lp
means cutoff frequency of a lowpass filter.
1F means inverse Fourier transform.)( ajH frequency response of an ideal lowpass filter.
)(th impulse response of an ideal lowpass filter.
11
8/21/2019 Unesco Final
12/53
The parameter is the cutoff frequency of the designed lowpass filter. The frequency is
chosen to ensure that all the desired frequencies, and no others, are included - i.e.,
lp lp
2lpc
8/21/2019 Unesco Final
13/53
0 20 40 60 80 10010
-8
10-6
10-4
10-2
100
frequency (Hz)
normalizedu
nits
Figure 9. The power spectrum of this signal shows that most of the power is concentrated
in frequencies below approximately 20 Hz, with peaks at the heart-rate (about 1.4 Hz)
and multiples of this frequency (the harmonics). In addition there is a sharp peak at
mains frequency (50Hz).
0 5 10 15 20 25 30 35
10-6
10-4
10
-2
100
frequency (Hz)
normalizedunits
Figure 10. The power spectrum of this signal, sampled at 67 Hz. Without the anti-alias
filter (dotted lines), the 50 Hz noise is aliased, and appears as a very large peak at 17 Hz
(67-50 Hz). With the anti-alias filter (solid line), this peak is very much reduced (though
not eliminated, due to the imperfection of the filter), and can be considered insignificant.
13
8/21/2019 Unesco Final
14/53
4. Digital Signal Processing Systems
Once the signal has been digitized, it may be desirable to calculate signal parameters that reflect the
signal characteristics. The most commonly used are the mean value, the power, the peak-to-peak
amplitude, and the signal-to-noise ratio. These will now be defined, and their significance and use
will be illustrated on some biomedical examples.
The mean value of a signal is defined as
N
nx
m
N
n
==
1
0
)(
(4)
This represents the value around which the signal fluctuates, and is also known as the signal's 'DC
value'. The fluctuating part (i.e. the residual when the mean is subtracted) is known as the 'AC
component' of the signal. The peak-to-peak amplitude of the signal is given by the range from the
minimum to the maximum value. This is also sometimes known as the dynamic range of the signal.
EXAMPLE 3. Arterial blood pressure
The arterial blood pressure signal shows the fluctuations of the pressure in an artery
during the cardiac cycle. This increases when the heart contracts, and decreases as the
blood drains away while the heart relaxes. There is also a 'notch' (the 'dichrotic notch'),
associated with the closure of cardiac valves, as the pressure decreases.
0 1 2 3 480
100
120
140
160
180
time [s]
mmHg
blood pressuremean value
Figure 11. A segment of arterial blood pressure recorded in an adult subject, showing 6
heart-beats. The mean value of this signal is 124 mmHg. The peak-to-peak amplitude is
74 mmHg.
The mean blood pressure gives the average value during the recorded period. The
fluctuations around the mean constitute the AC component of the signal. In many
applications (though not for the case of blood pressure), only the AC component is of
clinical interest.
The power of a signal is defined by
14
8/21/2019 Unesco Final
15/53
N
nx
P
N
nAV
==
1
0
2 )(
(5)
and thus represents its mean-square value. The square root of PAV is the root-mean-square (rms)
value of the signal, and gives a measure of the mean amplitude, which takes both the DC and the
AC component into account. However, in many cases it is only the power (or rms value) of the AC
component that is of interest, and this corresponds to the variance (or standard deviation) of the
signal. The power is in squared units (e.g. mmHg2, or V2), and therefore rather difficult tointerpret; the rms value is more convenient since it has easier interpretation and it is directly related
to the measure data unit. The mean absolute value (or magnitude) of a signal is also often used, but
the power lends itself more readily to further statistical analyses (see section on random signals,
below).
EXAMPLE 4.The power and standard deviation in the electromyogram (EMG)
The electromyogram is the electrical signal recorded from muscles. During muscle
contraction, the signal amplitude increases, and is used extensively in studies of neuro-
muscular disease.
0 1 2 3 4
-2
-1.5
-1
-0.5
0
0.5
1
1.5
time [s]
a.u
.
Figure 12. The EMG signal recorded from a quadriceps muscle during two cycles ofhuman gait, showing how the muscle is periodically activated. The mean value of the
signal is zero. The standard deviation (rms value) of the signal during the shaded periods
are 3.5894, 0.1983 and 4.1880, respectively, reflecting the change in signal amplitude.
The powers (variance) for the same periods are 12.8836, 0.0393 and 17.5396,
respectively. The rms value provides a reasonable measure of the 'average signal
amplitude', whereas the power is more difficult to interpret. Note that the calculations
were performed excluding the sharp spike at the beginning of each muscle-activation.
This is probably an artifact, caused by the small movement of the electrodes on the skin.
Many signals, including most from biomedical origin, are contaminated by noise. The signal-to-
noise ratio gives the ratio of signal power, to that of the noise:
15
8/21/2019 Unesco Final
16/53
nP
PSNR= (6)
wherePis the power of the signal, andPnthe power of the noise-component. Because the order of
magnitude of signal and noise powers can be very dissimilar, a logarithmic scale is often employed,
with the result expressed in dB (Deci-Bell):
=
n
dBP
PSNR 10log10 (7)
Of course, the definition of signal and noise is application dependent: what is signal for one
problem, may be noise for another. For example, an ECG (heart-signal) may be contaminated by
EMG (muscle) noise; for other studies, it is the EMG which is of interest, and the ECG is
considered as noise (or artefact).
EXAMPLE 5. An electrocardiogram (ECG) signal, with increasing levels of noise.
The ECG signal is the electrical signal generated by the heart. It shows clear peaks during
each cardiac cycle, and is used in the diagnosis of a wide range of heart-diseases. It is
also the most commonly used signal for monitoring the heart electrical activity.
16
8/21/2019 Unesco Final
17/53
Figure 13. An ECG signal contaminated by noise of progressively increasing power, with
signal to noise ratios decreasing form SNR=(no noise top row) to SNR=10, 2 and 1(bottom row). In the last line, the signal is almost completely obscured by the noise.
Digital Signal Processing Systems relate input signals to outputs. The relationship between the
output sequence of this system and may be represented by the operator as)(ny )(nx F
)]([)( nxFny (8)
17
8/21/2019 Unesco Final
18/53
Figure 14. Discrete-time signal representation.
4. 1 Linear Time-Invariant Systems
The main class of DSPS is the linear, time-invariant(LTI) and causalfilters. A linear digital filter
is one that obeys the following expression
[ ] [ ] )()()()( nxFnxFnxnxF bbaabbaa +=+ [ ]
]
(9)
for any sequences and , and any arbitrary constants and . Thus if the input is the
weighted sum of two (or more) signals, the output is a similarly weighted sum of the responses to
the individual inputs. A digital filter is said to be time-invariant when its response to an input
sequence remains the same, irrespective of the time instant that the input is applied to the filter.
That is, if then
)(nxa
)(ny=
)(nxb a b
)]([ nxF
)()]([ 00 nnynnxF = (10)
for all integers and (where is the delay, in samples, of the signals). A causaldigital filter is
one whose response does not anticipate the behavior of the excitation signal. Therefore, for any two
input sequences and such that for , the corresponding responses of
the digital filter are identical for , that is,
n
x
on
)
0n
n
(na )(nxb )()( nxnx ba = 0nn
0n
[ ] [ )()( nxFnxF ba = , for n , (11)0n
irrespective of each signal's characteristics for n . An initially relaxed, linear, time invariant
digital filter is fully characterized by its response to the impulse (or unit sample) sequence .The filter response when excited by such sequence is denoted by and it is referred to as
impulse responseof the digital filter. Observe that if the digital filter is causal, then for
. An arbitrary input sequence can be expressed as a sum of delayed and weighted impulse
sequences, i.e.,
0n>
)(n
0
)(nh
)( =nh0
8/21/2019 Unesco Final
19/53
=
=k
knxkhny )()()( (14)
In order to analyze, describe and design digital filters, the Fourier and the z transforms are very
convenient and powerful tools. A large class of sequences (e.g. signals and impulse responses) can
be expressed in the form
=
deeXnx njj )(2
1)( (15)
where
=
=n
jj enxeX )()( (16)
)( jeX is called the Fourier transform of the sequence . represents the signal in the
time-domain, and gives the same signal in the frequency domain, and the two can, in
general, be calculated from each other according to the above pair of equations. A sufficient but not
necessary condition for the existence of the Fourier transform is that the sequence is
absolutely summable, i.e.,
)(nx )(nx
)( je
)( jeX
X )(nx
=