Docsity

Appunti Biomedical Signal and Data Processing prof. Burattini, Appunti di Elaborazione Di Dati E Segnali Biomedici

Toggle sidebar
bg1
Biomedical signals and data processing
A signal is something that changes in time; the independent variable of the signal is time. The signal can be,
easily or not, modeled as an analytic function. Time is a continuous variable and biomedical signals also are
continuous. A biomedical signal s(t) is a function, continuous in time (t) and in amplitude (s), analytically
written as f(t,s)=0 or s=f(t), used in medicine to monitor the functionality of an organ or of a part of it, for
diagnostic and treatment purposes. A biomedical signal is used to monitor one system, or cell’s function.
What makes a signal biomedical is not only that is generated by our body, but the fact that it is useful to have
informations about the body: we can know which is the meaning of the signal. Biomedical signals are
typically classified based on their nature or modality of occurrence.
Life is a continuous phenomena; in mathematics continuity means that we can take two points as close as we
want, but between them there is an infinite number of points. Anyway life is defined in a particular interval,
but according to the mathematic meaning, continuous goes from to . However our life is inside a
certain time window. Thus, life is not mathematically continuous, but from an engineering point of view we
can approximate life as continuous. For example we can imagine to put the 0 time before our born and after
our death, so life can be approximated as continuous. We can also make a distinction between the
observational time and the real time of the signal, which is infinite. The observational window compared to
the whole life is infinitely small (e.g. 1 minute of signal compared to the length of our life), so from a practical
point of view we can approximate our life as infinite if compared to the observational period. Biomedical
signals are full of physiological informations. We have an extra problem: since the observational signal is a
continuous signal, with an infinite number of point, we want to analyze the signal with our computer, so we
need to transform the signal from continuous to digital.
Biomedical signals can have different origins because inside our body there is a huge number of phenomena
that can generate different signals. We are very good when we analyze the electrical signal, so is good to
transform any kind of signal into an electrical signal and still we need to know what the pulses of the signal
mean, we have to be aware of what is the original nature of the signal we analyze. The second problem is
that life is a set of several phenomena (a lot of phenomena simultaneously occur), so in the same time our
organism is generating a huge number of signal and sometimes they also interact with each other.
Based on its nature, s(t) is classified as:
• Electrical: electrocardiogram, electromyogram, electroencephalogram;
• Magnetic: magnetocardiogram, magnetoencephalogram;
• Impedentiometric: pneumogram;
• Chemical: partial-pressure signal;
• Acoustic: phonocardiogram;
• Mechanical: pressure signal.
Based on its modality of occurrence, s(t) is classified as:
• Spontaneous, e.g. heart, some frequencies of our brain, some internal organs. They work independently of
our will.
• Induced: artificially generated as a response to the interaction between an external energy sent to the tissue
and the tissue itself. These are our reaction to an external signal, e.g. a drug, a mechanical impulse, some
substances.
Usually for medical causes we are interested only in one signal to investigate the function of only one system,
but sometimes this signal can interfere with other signals that occur simultaneously (e.g. when I do the ECG
I’m also recording breathing and other signals from the muscles). So when you get a signal, you have to know
which is the signal you are interest in and you need to extract it. So you have to have some informations
about the frequencies of this signal. All the signals that are in the same recording, that have a biomedical
origin, and that are not of interest are called interference or crosstalk. From a signal processing point of view
we don’t care about which is the origin of the noise, we consider noise as a part of the signal we have to
remove. Thus, a biomedical signal is always corrupted (often hidden) by external noise (noise) or other
biological signals of no interest (interferences or crosstalk). Biomedical signal processing consists in the
−∞
+∞
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f

Anteprima parziale del testo

Scarica Appunti Biomedical Signal and Data Processing prof. Burattini e più Appunti in PDF di Elaborazione Di Dati E Segnali Biomedici solo su Docsity!

Biomedical signals and data processing

A signal is something that changes in time; the independent variable of the signal is time. The signal can be,

easily or not, modeled as an analytic function. Time is a continuous variable and biomedical signals also are

continuous. A biomedical signal s(t) is a function, continuous in time (t) and in amplitude (s), analytically

written as f(t,s)=0 or s=f(t), used in medicine to monitor the functionality of an organ or of a part of it, for

diagnostic and treatment purposes. A biomedical signal is used to monitor one system, or cell’s function.

What makes a signal biomedical is not only that is generated by our body, but the fact that it is useful to have

informations about the body: we can know which is the meaning of the signal. Biomedical signals are

typically classified based on their nature or modality of occurrence.

Life is a continuous phenomena; in mathematics continuity means that we can take two points as close as we

want, but between them there is an infinite number of points. Anyway life is defined in a particular interval,

but according to the mathematic meaning, continuous goes from to. However our life is inside a

certain time window. Thus, life is not mathematically continuous, but from an engineering point of view we

can approximate life as continuous. For example we can imagine to put the 0 time before our born and after

our death, so life can be approximated as continuous. We can also make a distinction between the

observational time and the real time of the signal, which is infinite. The observational window compared to

the whole life is infinitely small (e.g. 1 minute of signal compared to the length of our life), so from a practical

point of view we can approximate our life as infinite if compared to the observational period. Biomedical

signals are full of physiological informations. We have an extra problem: since the observational signal is a

continuous signal, with an infinite number of point, we want to analyze the signal with our computer, so we

need to transform the signal from continuous to digital.

Biomedical signals can have different origins because inside our body there is a huge number of phenomena

that can generate different signals. We are very good when we analyze the electrical signal, so is good to

transform any kind of signal into an electrical signal and still we need to know what the pulses of the signal

mean, we have to be aware of what is the original nature of the signal we analyze. The second problem is

that life is a set of several phenomena (a lot of phenomena simultaneously occur), so in the same time our

organism is generating a huge number of signal and sometimes they also interact with each other.

Based on its nature, s(t) is classified as:

• Electrical: electrocardiogram, electromyogram, electroencephalogram;

• Magnetic: magnetocardiogram, magnetoencephalogram;

• Impedentiometric: pneumogram;

• Chemical: partial-pressure signal;

• Acoustic: phonocardiogram;

• Mechanical: pressure signal.

Based on its modality of occurrence, s(t) is classified as:

• Spontaneous, e.g. heart, some frequencies of our brain, some internal organs. They work independently of

our will.

• Induced: artificially generated as a response to the interaction between an external energy sent to the tissue

and the tissue itself. These are our reaction to an external signal, e.g. a drug, a mechanical impulse, some

substances.

Usually for medical causes we are interested only in one signal to investigate the function of only one system,

but sometimes this signal can interfere with other signals that occur simultaneously (e.g. when I do the ECG

I’m also recording breathing and other signals from the muscles). So when you get a signal, you have to know

which is the signal you are interest in and you need to extract it. So you have to have some informations

about the frequencies of this signal. All the signals that are in the same recording, that have a biomedical

origin, and that are not of interest are called interference or crosstalk. From a signal processing point of view

we don’t care about which is the origin of the noise, we consider noise as a part of the signal we have to

remove. Thus, a biomedical signal is always corrupted (often hidden) by external noise (noise) or other

biological signals of no interest (interferences or crosstalk). Biomedical signal processing consists in the

removal (filtering) of noise and interferences and in the reduction of the biomedical signal of interest in few

significant parameters (data reduction) from which to derive clinical information.

Another problem is that we are generating tons of data that we can’t manage. The approach we can use is

that all this data can be analyzed by computers, but if we examine a lot of data we lose interpretation. A

different approach is the data reduction: extraction of clinical-interesting data, we extract some feature from

the data so that we limit our analysis only to the parts of the recording that have a clinical evidence. Now the

trend is to combine this two approaches: extract as many features as possible form the recording and then to

provide to the artificial intelligences the features, and not the signals.

A huge problem we have is that biological signals are continuous and computers are discrete. Biomedical

signals are continuous also in amplitude, so we need to make it digital both in time and in amplitude. Making

the time digital means observing the phenomena from time to time, not continuously: we sample the signals,

which means making the time discrete (if we

sample at 1Hz it means we are looking at the

signal every second). The distance between two

different observations is the same when we

sample the signal. Sampling is making the time

discrete and the computer will represent the time

axis with natural numbers (first sample, second

sample, third sample…).

After this sampling we have a signal that is digital

in time, but continuous in amplitude. We do the

quantization: making the amplitude discrete.

Conceptually is similar to the sampling. The

quantization is rounding, is taking the range of

the minimum and the maximum and round every

amplitude to a natural number. So now I’m using

natural numbers also to describe the y axis

(amplitude axis). Now the signal is digital (digital

time and digital amplitude) and I can use it with

computers.

The types of biomedical signals are:

- Analog signals f(t,s): continuous time and continuous amplitude;

- Sampled signals f(nT,s): discrete time and continuous amplitude (n is a natural number);

- Quantized signals f(t, kQ): continuous time and discrete amplitude (n is a natural number);

- Digital (numerical) signals f(nT, kQ): discrete time and discrete amplitude.

Biomedical signals may also be divided into:

- Deterministic signals: perfectly known and representable at each time instant, and thus studied and

analyzed through mathematical analytical methods. This means that I could “predict” the future, because

if I know the formula I can predict how the signal will be. Anyway this is not realistic, in fact biomedical

signals are not deterministic at all. There are some signals that are almost deterministic, as the cardiac

signal (ECG is the repetition of a specific wave form), anyway everything can always happen, the heart

may not work always perfectly so also the cardiac signal is not perfectly deterministic. Thus, some

biomedical signal can be approximated to deterministic, even is any of them is perfectly deterministic. A

deterministic signal may be studied in time, if we plot it in time it has a clear shape and a clear meaning.

- Stochastic or random signals: they are not completely known a priori and thus are studied through

statistical methods. Also in this case there are some signals that are similar to stochastic signals. Anyway

since biomedical signals are generated by our body, they are not random, they are generated for some

reason from some organs. Strictly speaking no biomedical signal is random, even if some of them seem

random, so we can approximate them as random. Stochastic signals are studied in frequency.

(This way of representing the signal is wrong, we

don’t have the black bars in the real representation.

With the bars we are representing the Delta function,

so is a representation from a mathematical point of

view.)

process that brings the signal of interest into a memory device to allow automatic (by means of a

computer) analysis. By their nature, biomedical signals are analog while automatic processing is digital.

Acquisition consists in:

- Detection and, possibly, signal transduction. Electrodes (for electrical signals) or transducers (for

nonelectrical signals) are used. Entropy must be kept low in order to have a high signal-to-noise

ratio. The sensors must be applied in the best possible way: in a way in which we maximize the

signal to noise ratio (if we want to record the electrocardiogram we have to put the electrodes in the

chest and possibly we ask to the patient not to breathe and not to move). This is useful to minimize

the level of noise and interference in the final signal.

- Signal conditioning (pre-filtering). For example use of a hardware filter for an initial power line-

noise reduction.

- Analogs to digital conversion that transforms the signal from continuous to digital. It consist in the

numerical transformation of the biomedical signal for subsequent automatic processing.

- Digital storage

2. Signal transformation. It may include the following procedures:

- Signal cleaning: removal or reduction of noise and interferences through numerical filtering.

- First data-redundancy reduction: identification of the significant signal components and removal of

the others. Also performed through numerical filtering. If for example we are analyzing an holter for

24 hours, but the device has recorded for 25 hours instead, we can eliminate one hour.

- Domain transformation: transformation of the signal from the time domain (original) to the

frequency domain (Fourier’s analysis) for an efficient information extraction.

- Characteristic waves identification: it is performed in the analysis domain and allows to discriminate

abnormalities (pathologies) and a second data-redundancy reduction.

3. Parameter selection: until here we still have signals. In this block we extract the clinically significant

features. The selection of the features is related to the kind of study we are performing and are useful for

the decision making procedure. The identified parameters have to be ‘features’, that is they have to be

characterized by the following:

- have semantic content, that is provide information of the analyzed biological system;

- usable as input to subsequent procedures of clinical decision making;

- have discriminant power, that is allow identification of a pathology or of its trend during

development.

- allow a second data-redundancy reduction.

4. Signal classification. Here for example we can understand if there is a disease or not. Classification may

be due to statistic information or thanks to artificial intelligence. If you perform the signal classification

on the parameters of the signal, you can have information on the physiological phenomena that

generated the disease; otherwise you find out the disease but you don’t understand why. This block

consists in searching for links between the event classes and characteristics identified in the previous stage,

which must be interpreted and classified by means of methods similar to those of pattern recognition

(based on heuristic reasoning, logic, statistics, or a combination them). A strict collaboration between the

biomedical engineer and the physician is needed.

Biomedical images

A biomedical image i(x,y) is a bi-dimensional function in space (x,y) and in “amplitude” (i), analytically

written as f(x,y,i)=0 or i=f(x,y), used in medicine to monitor the functionality of an organ or of a part of it,

for diagnostic and treatment purposes. Not all images which represent the body are biomedical images, they

are biomedical images when they have a medial content. The amplitude of the image is the level of grey or

color. “Amplitude” may refer to grey level or color. Analogously to the signal, also the images may have

different origins. Also images are transformed into electrical bi-dimensional signals. Based on the acquisition

technique, they are classified as :

• X-ray radiography

  • Fluoroscopy
  • Magnetic resonance imaging (MRI)
  • Medical ultrasonography or ultrasound
  • Endoscopy
  • Elastography
  • Tactile imaging
  • Thermography
  • Medical photography and nuclear medicine functional imaging techniques e.g. positron emission

tomography (PET)

The body region (here: cervical vertebra) appears completely different when altering the imaging modality.

Depending on the nature of their domain and codomain, images are divided into:

  • Analog images f(x,y,i): continuous space and continuous amplitude;
  • Pixeled images f(nTx, nTy, i): discrete time and continuous amplitude;
  • Quantized images f(x,y,kQ): continuous space and discrete amplitude;
  • Digital (numerical) images f(nTx, nTy, kQ): discrete time and discrete

amplitude. At the end a digitalized image is a matrix, where the

numbers of the matrix represent the level of grey. For a colored image,

the colors are obtained trough the superimposition of 3 matrix: one for

red, one for blue and one for yellow.

Biomedical data

In general data are number, are numerical. Also images are numbers. Also signal is data, but we distinguish

the data from the signals because biomedical data are parameters that provide informations, are features. You

approach data through statistical tool or classification tools. Signals are analyzed through signal processing

techniques. Strictly, measures and features obtained by analyzing biomedical signals or images. Biomedical

data can be divided into:

  • Dynamic data: expressed as function of time. For example signals (ECG, EEG, EMG) or tracings (action

potential, glycemic curve);

  • Static data. For example biochemical data, temperature, short-time heart rate.

Cardiac signals

Both biomedical signals and biomedical images are defined as this if they are use

to monitor, if they have clinical meaning. This implies that every time we do

biomedical signal processing we must know something of the biological system

that has generated that signal.

The heart is an involuntary muscle the size of a fist, located in the center of the

chest cavity and divided into a right and a left section, separated by a septum.

Each of the two sections consists of two cavities, (chambers ) the upper is termed

atrium , and the lower ventricle. Each atrium communicates with the

We may have a huge number of cardiac signals; for each

chamber we can measure the pressure, the flux, the volume.

The most used are represented in this picture. The

electrocardiogram represents the electrical activity of the

heart. All this are different signals generated by the same

complex phenomena; this means that they have all the same

periodicity, they share the x axis. So one of this signals

somehow influences the others.

The electrocardiogram

Is the most used cardiac signal. It represents the electrical activity of the heart of all the cells of the heart and

is usually obtained through surface electrodes. The electrocardiogram (ECG) is a graphical representation of

the cardiac electrical activity. The ECG is usually recorded through surface electrodes located on the body

surface at standardized positions. The ECG reflects the spatiotemporal integration of the continuous change

of all action potentials in relation to the cardiac cycle. The ECG analysis constitutes the most important

clinical investigation in the cardiac diagnostics since is simple, non-invasive and cheap.

Depolarization: the action potential goes from negative to

positive;

Repolarization is the opposite.

The ventricle action potential is the one that we usually study.

There is a delay within which the action

potential has origin because the action

potential occurs first in the atria and then in

the ventricles, not simultaneously. The

electrocardiogram is the summation of all the

action potentials that are generated in the

heart.

Each part of the electrocardiogram has a very specific meaning. The first wave is the atrial depolarization (P

wave) which is the one with the smallest amplitude. Then there is a segment that represents the time that the

action potential needs to go to the ventricles. Then we have the QRS complex, that is the highest in

amplitude complex of the ECG and represents the depolarization of the

ventricles. The amplitude of this wave is big and this depolarization is

very fast (short period of time, high frequency), in fact this wave is almost

vertical. Simultaneously to the QRS wave there is also the repolarization

of the atria which is not visible in normal cases because is hidden by the

QRS complex. Then, we have the ST segment, which is flat because there

are no electrical event; in fact it represents the time between the ventricle

depolarization and repolarization. The T wave finally represent the

ventricular repolarization. The PR interval measures the atrioventricular

conduction time. The QT interval measures the total duration of systole.

The TP segment is the baseline. In the ECG the amplitude is in the order

of mV, whereas the frequency bandwidth is: 0.05-100 Hz.

A lot of arrhythmia are due to problems in the repolarization part. The QT

interval represents the time interval in which the ventricles are active and is

one of the most used indexes to discover some diseases. Very dangerous are

both the long and the short QT intervals. In the short QT interval the heart

doesn’t have enough time to push all the blood out. In each of us the

duration of the QRS complex is almost constant, either if you are sleeping

or running, because that part is the most important phase of the

electrocardiogram that allows to push all the blood out of the heart. Instead

the intervals between the depolarization and the repolarization are different according to the activity we are

performing.

The ECG recorder

The machine for recording the ECG was invented in 1887 by the German Augustus Waller and improved

later by the physiologist William Einthoven. Initially the ECG recorder was a very big device. Nowadays are

smaller. ECG recording is done through electrodes placed at various points of the body:

  • Surface ECG: ECG recording made using electrodes placed on the body surface and thus is noninvasive

and commonly performed.

  • Internal ECG: ECG recording made with electrodes placed directly on epicardium. This invasive

technique is performed only in a few occasional experimental circumstances.

The ECG can be recorded from any position in our body. We can imagine the electrodes as a camera that is

looking at the heart from different directions. The morphology of the ECG may be different according to

where you locate the electrodes. In order to have always the same shapes of the signal, we have a

standardized position of the electrodes. The electrodes are located in fixed positions. Anyway also in the same

subject is not possible to locate the electrodes always in the same spot because the body of the subject may

change. The amplitude of the ECG changes from a subject to another one according to the body structure,

this is the reason why the intervals are more used to study the ECG with respect to the amplitudes.

We can perform in particular two types of ECG:

  • Resting ECG: static track that can highlights coronary diseases, cardiac rhythm disturbances (extrasystoles,

arrhythmia, fibrillation), changes in heart volume (hypertrophy) and the electrical impulse conduction

problems (block).

  • Stress ECG: dynamic track can highlight latent heart disease, as well as to establish the limits of physical

activity for patients with coronary failure. High heart rate may trigger some cardiac diseases.

Wearable sensors

They measure ECG not in an hospital. They can’t

replace the real ECG done with ECG recorder

because if you take the ECG in other points of the

body you obtain different numbers so there is no

standardization with this sensors, also they provide

only one tracing, not 16 as the clinical devices.

Some advantages are that you can wear at any time

Fetal electrocardiography

This is the recording of the heart activity of the baby inside the abdomen of the mother. Fetal ECG can be

recorder only in the last weeks of the pregnancy because before there is a layer that covers the baby in the

mother’s abdomen. The ECG recorded is very noisy due to the presence of liquids and tissue layers between

the baby and the mother and has a low amplitude because the electrodes are far form the baby chest. The

main interference is the heart beat of the mother. Another problem is that the baby may be in any position,

we can’t ask the baby to stay in a position and not to move. It can be performed in two ways:

  • Indirect method. The indirect method implies the use of standard electrodes placed on the maternal

abdomen according to a particular

configuration. Despite the fact that

several configurations of the

electrodes have been proposed, the

variability remains very high because

the baby may move. So this is a very

difficult test, but is non invasive and

may be helpful to discover some

abnormalities in the baby and you

can start treating the baby before its

birth.

  • Direct method. The direct method

implies the use of a spiral electrode

inserted through the cervix of the

pregnant woman and placed on the

presenting part of the fetus

(generally the scalp). This is possible

only during the delivery. The risk of

infection is very high and is not a

comfortable test both for the mother

and the clinician. On the other hand

the quality of the signal reordered is

higher than the previous one and

you don’t have the maternal interference.

The Cardiotocogram

Cardiotocography (CTG) is the most commonly used test for fetal. During a CTG examination, an

ultrasound probe and a surface transducer are placed through a sort of belt on the mother’s abdomen to

simultaneously record fetal heart rate (FHR; bpm) and maternal uterine contractions (UC; mmHg). Most of

the time this records are still analyzed visually and not with computers. However there are some automatic

p ro g r a m s t h a t c a n a n a l y z e t h e

cardiotocogram. The automatic analysis

will be better than the human analysis,

but will be worst than the experience a

clinician may have. The automatic

analysis may support the clinician

analysis, and is very helpful in those

situations in which the clinician is far

away.

Fetuses have a positive feedback so the

nervous system is not able to properly

control the heart: if the heart rate is

decreasing, the nervous system decreases

much more it. The consequence is that

they do not have enough oxygen. So we

need alarms each time that the heart

The blue squared peaks are the heart beats of the mother. The

small circled red peaks are the heart beats of the baby. In one

maternal beats there are almost 2 baby beats because in smaller

animals the heart rate is higher.

rate goes down, decelerations are very dangerous. Not all decelerations are bad: if the uterine of the mother

is contracting, the heart of the baby decelerates and this is physiological, if the fetus decelerates when the

uterus is relaxed there is a problem. That’s why is very important to record both the baby’s heart rate and the

uterus contractions.

Frequency analysis of biomedical signals and images

First of all we have to define what is the energy of a signal. In general we can talk about the energy of a

signal in a time interval and the energy of a signal along its entire length. The energy of the signal in a time

interval is defined as:

- Continuous signal in [-T/2^ T/2]:

Digital signal in [-N/2 N/2]:

For a digital signal, the integral is replaced by a summation. So we have the module of the signal and it is

squared, so this integral exists if the module of the signal never goes to.

We can also talk of the energy of a signal with infinite length; to compute this energy we simply use the

definition of the signal energy in a time interval and do the limit to :

Continuous signal:

Digital signal:

We now will go to see some energy values of some signals that are particularly popular in engineering:

• The first one is the step signal that is used to model a phenomena that is not

occurring at the beginning but only after a certain time. This signal is continuous and

has an infinite energy. With the energy formula for this signal, practically I'm

summing the area under the signal. For the step as we move to we have more

area to add. When we go to the area under the signal becomes so the energy

of this signal is infinite.

• Then we have the^ periodical signal^ (for example sine, cosine or ECG). This

signal is continuous and infinite. If we compute the energy this is infinite because

the negative part of the signal becomes positive with the absolute value.

• Finally we have the exponential signal (decreasing) which has infinite duration

and finite energy, because as we move to the area under the signal tends to 0.

Thus, just looking at the signal we can understand if its energy is infinite or not. To understand if a signal has

a finite energy we have to see that the signal doesn't have infinite values and that the area under the signal

goes to 0, because in this way the contribution to the energy after a certain time becomes negligible and the

energy is limited.

ES ( T ) =

T /

− T /

| s ( t ) |

2 d t

ES ( T ) =

N /

− N /

| s ( n ) |

2

E

S = lim T →∞ ∫

T /

− T /

| s ( t ) |

2 d t = ∫

+∞

−∞

| s ( t ) |

2 d t

E

S = lim N →∞

N /

− N /

| s ( n ) |

2

+∞

−∞

| s ( n ) |

2

What is important to remember is: what convolution is, what Delta function is (for us is a continuous signal)

and that the convolution of any signal with the delta function has the effect of shifting in time the signal

around the value of the Delta function.

Fourier analysis

Fourier (1768-1830) was obsessed with he physics of heat and developed the Fourier series and transform to

model heat-flow problems. The Fourier analysis remains one of the main topics of all engineering, no matter

which kind on engineering. Kelvin (1824-1907) commented the Fourier series saying that Fourier's theorem is

not only one of the most beautiful results of modern analysis, but it may be said to furnish an indispensable

instrument in the treatment of nearly every recondite question in modern physics.

Sometimes it may appear strange and difficult to work in frequency, but actually we talk about frequency

every time we are talking about a certain event that occurs with a regularity (e.g. we go to classes 3 times a

week; in this case we are talking in frequency). Thus, we speak in frequency when we have to measure

something we do with a certain regularity; if we translate this in mathematical terms, when we do it

periodically. Another synonymous of periodic action is ciclic action; we can say that a phenomenon is ciclic

when it is prepared always in the same way. The word ciclic is also associated to the unit circle in

trigonometry; if we normalize the unit circle with time, for example considering the unit circle as a

representation of one year, we can say that the phase (angle) is a normalization of time, e.g. an angle of /

corresponds to 3 months.

Everything starts from the Fourier series. In order for a signal s(t) to be decomposed into the Fourier's

series, it needs to verify the Dirichlet's criteria:

- s(t) is periodic with period T

- s(t) is absolutely integrable in T

0 (if it has a finite energy in T 0 );

- s(t) is continuous, or shows, at most, a finite number of discontinuities of first species in each period (the

discontinuity of first species are those in which we have an instantaneous transition of the signal between

two values: for example a step signal in the origin goes instantaneously from 0 to 1);

- s(t) is differentiable in time in the period, excluding at most a finite number of points where there exist

both left and right derivatives.

Now we have to check if the biomedical signals satisfy the Dirichlet's criteria:

- Periodicity. There exist biomedical signals that are perfectly periodic? Life never repeats, so strictly

speaking none biomedical signal is perfectly periodic. However there is a small subset of signals (all those

generated by the heart, the respiratory signals…) that can be approximated to periodic signals.

- Integrability. Being absolutely integrable in T

0 means that the signal never goes to infinity, because

otherwise the area under the integral becomes infinite. Actually any biomedical signal is generated by a

physiological phenomena and infinity is not real, not physiological. Thus, biomedical signals are integrable

for definition, because their amplitude is limited by the nature of the phenomena that generate it.

- Continuity. We have already seen that we can approximate the biomedical signals as continuous.

Biomedical signals can't even show discontinuity of first species, because that type of discontinuity means

that there is a phenomena that is occurring with infinite speed and this is not physiological obviously.

- Differentiability. This assumption is connected with the previous one because the discontinuities of first

species are the ones for which the derivative does not exist. The fact that we can't have instantaneous

transitions implies that the phenomena may not be characterized by infinite frequency, because

instantaneous transitions are those that occur in a null period and the inverse of the null period is the

infinite frequency.

y ( n ) = x ( n ) * ∂( n − n 0 ) =

+∞

−∞

x ( k )∂( n − n 0 − k ) d τ = x ( n − n 0 )

π

Thus, the Dirichlet's criteria are satisfied, the only problem is that we only some biomedical signals as

periodic in T 0. For those signals we can decompose the signal in Fourier series, in particular the signal can be

decomposed in a series, in a summation:

With:

However for real signals this series has another formulation:

With:

We can observe that this is a simpler formulation. Biomedical signal are real by definition, so we can use this

simplified formulation for them. is the term that comes for n=0 in the summation, whereas all the terms

with negative values of n (from to -1) are flipped because we have the 2 that multiplies the summation.

is a real number, is the phase of.

The fundamental frequency is 1/T 0 , so if the period of my signal is T 0 its fundamental frequency is 1/T 0 , if

the ECG has a period of 1 second, its fundamental frequency is 1Hz. So in the formulation the first cosine

(for n=1) is characterized by a frequency equal to the fundamental frequency; the second cosine is

characterized by a frequency equal to 2/T 0 ; the third one 3/T 0 and so on. So I'm moving on the frequency

axis with multiples of the fundamental frequency. Also, while n increases the frequency that characterizes the

cosine tends to. Anyway biomedical signals can't occur with infinite frequency, so for biomedical signals

we can have a finite number of terms in the summation:

For a biomedical signals the Fourier series becomes a finite Fourier summation. Biomedical signals are band-

limited, which means that exists a maximum frequency after which there in nothing. N is the point after

which goes to 0. For an ECG N 25, for the respiration N 4-5. Having a limited summation is a great

advantage because to represent a real signal in frequency we have to memorize one period, , one constant,

, N values of and N values of. This means that to represent our signal in frequency we need 52

values, considering for example the ECG.

The decomposition in Fourier series allows the representation of a continuous and periodic signal (period T0)

as an infinite sum of sines and cosines (Complex exponential functions such HARMONIC) at multiple

frequencies of the FUNDAMENTAL frequency defined as the reciprocal of the period (1/ ).

is the mean of the signal and it is constant; if I change the mean value I shift up or down the signal, but

I'm not changing anything in the morphology of the signal, there is not lack of information. In signal

processing we take the signal, we compute the mean and we subtract the mean from the signal, so that we

have a signal translated in the amplitude which has 0 mean, so that in the formula the term is 0. We

usually do that because sometimes may be much higher in amplitude than so if we plot it we see only

but not.

Thus, a continuous real signal can't be represented in time in a computer, but can be represented in

frequency because it's limited. We represent it in terms of:

  • Amplitude spectrum: graph of the amplitude as a function of n.
  • Phase spectrum: graph of the phase function as function of n.

s ( t ) =

+∞

n =−∞

Sne

j 2 π nt / T 0

S

n

T 0 ∫

T 0

0

s ( t ) e

− j 2 π nt / T (^0) d t c o m pl e x

s ( t ) =

+∞

n =−∞

Sne

j 2 π nt / T 0 = A 0 + 2

+∞

n =

An cos (

2 π n

T

0

t + Φ n )

S

n

1

T 0

T 0

0

s ( t ) e

− j 2 π nt / T (^0) d t c o m pl e x

A 0 = S 0

An = | Sn |

n

= ∠ S

n

A

0

−∞ A n

Ψ n

S

n

s ( t ) = A 0

N

n =

A

n cos (

2 π n

T 0

t + Φ n )

An ≈ ≈

T 0

A 0 An Ψ n

T 0

A 0

A 0

A 0

A 0 An

A 0 An

| Sn |

θn

Sn = Rn + jIn = | Sn | e

jθn

Example 3:

Also this signal satisfies the Dirichlet's criteria. This is not a biomedical

signal because the transitions from 0 to 1 and from 1 to 0 is instantaneous

and that is impossible because instantaneous means infinite speed and

infinite frequency. So we will have infinite components in frequency.

The continuous Fourier transform (CFT)

The continuous Fourier transform is a frequency representation of a continuous and non- periodic signal s(t).

We can think a non periodic signal as a periodic signal with infinite period. This is a mathematical trick; in

this way I have to do the limit of the series for the period that goes to infinite. The fundamental frequency

becomes 0 (1/ ), so now the distance in frequency between two consecutive cosines is 0; this is the definition

of continuity. Now the cosines are continuously located in the frequency axis. The summation becomes an

integral. From a mathematical point of view now I can go in the frequency domain with all the signals, but

however now the spectrum is continuous and not digital.

The direct formula allows to go from time to frequency. The indirect formula is the same of the direct, the

only difference is the - sign. The difference is that in the unit circle we are going in the opposite direction, but

the phases are the same.

Proprieties of the CFT ( ):

  • Linearity:

Scale change:. If I change the time I will change also the frequency.

  • Time shift:. If I have a time shift I will have a change of phase. The presence of

the double arrow means that this relations hold in both directions.

  • Frequency shift (modulation):
  • Multiplication and convolution:
  • Derivative:

Integration:

  • CFT of a real and even signal is real and even
  • CFT of s real and odd signal is imaginary and odd

T r a n s f r o m : S ( f ) = ∫

+∞

−∞

s ( t ) e

− j 2 π f t d t

In ver se T r a n s f or m : s ( t ) = ∫

+∞

−∞

S ( f ) e j 2 π f t d f

x ( t ) ↔ X ( f )

x 1 ( t ) + x 2 ( t ) ↔ X 1 ( f ) + X 2 ( f )

k x ( t ) ↔ k X ( f )

x ( k t ) ↔

k

X

f

k )

x ( t − t 0 ) ↔ e

− j 2 π f t (^0) X ( f )

e

− j 2 π f 0 t x ( t ) ↔ X ( f + f 0 )

x 1 ( t ) ⋅ x 2 ( t ) ↔ X 1 ( f ) * X 2 ( f )

x 1 ( t ) * x 2 ( t ) ↔ X 1 ( f ) ⋅ X 2 ( f )

x ′( t ) ↔ j 2 π f X ( f )

x ( t ) d t ↔

j 2 π f

X ( f )

  • Complex conjugate:

Perseval's theorem:. The energy of the signal in time domain must be

equal to the energy of the signal in the frequency domain

  • If the signal is periodic, the Continuous Fourier Transform is equivalent to the Fourier Series.

Example: the Fourier transform of a rectangle function

There are 2 things we “don’t like” about this function: there are instantaneous

variations and it introduces oscillations.

Example: Fourier transform of

We have also the negative frequency. This is a mathematical tool, we don’t have it in reality so practically when we have to

interpret the results we will look only at the positive part.

The Fourier transform is a linear transformation so you can perform the Fourier

transform of the sum of two functions. If you have a low rectangle, the main

loop is shorter. The Fourier transform of a sum of two functions is:

The scale theorem : the shorter the pulse, the

broader the spectrum and vice versa. Frequency is

the reciprocal of time, so if something is very short

in time it means that it has a large frequency. This is the essence of the

uncertainty principle: if one phenomena is well located in time, it cannot be

located at one specific frequency (e.g. if we have a delta function in time we

have a constant in frequency). You can’t have something very narrow in time

and at the same time located very well in frequency; what is large in one

domain is small in the other.

x * ( t ) ↔ X * (− f )

+∞

−∞

| x ( t ) |

2 d t = ∫

+∞

−∞

| X ( f ) |

2 d f

r ec t ( t )

F ( ω ) = ∫

1/

−1/

e x p (− i ωt ) d t =

− i ω

[ e x p (− i ωt )]

1/ −1/

− i ω

[ e x p (− i ω /2) − e x p ( i ω /2)] =

( ω /2)

e x p ( i ω /2) − e x p (− i ω /2)

2 i

sin( ω /2)

( ω /2)

= s i n c ( ω /2)

cos( ω 0 t )

F {cos( ω 0 t )} = ∫

+∞

−∞

cos( ω 0 t )exp(− i ωt ) d t =

+∞

−∞

[exp( i ωt ) + exp(− i ωt )]exp(− i ωt ) d t =

+∞

−∞

exp(− i [ ω − ω 0 ] t ) d t +

+∞

−∞

exp(− i [ ω + ω 0 ] t ) d t = π δ ( ω − ω 0 ) + π δ ( ω + ω 0 )

F { a f ( t ) + bg ( t )} = a F { f ( t ) + bF { g ( t )}

In the computer you memorize only the values inside the window, not also the 0 values, but theoretically we

have a continuous signal that is 0 outside the window. The spectrum of the real signal is different from the

spectrum of the observed signal. As the time window becomes larger and larger, the observed signal becomes

the real one and this is true also for the spectrums. The wider the window the closer the signal to the original.

We can conclude that let’s observe the signal the longer possible because this will provide us a signal that is as

close as possible to the original one both in time and in frequency.

Analog to digital conversion

One problem of the truncation is that the truncation means that we are introduction some distortions. The

second problem is the analog to digital conversion, we can’t store in our computer continuous signal, even if

it is limited. So we have to convert our signal into a digital signal. The continuity in time of a signal implies

that between two time points we touch all the points between the two points (infinite number of points). We

have continuity in the time axis and in the amplitude axis. So we have to make digital both the time and the

amplitude.

In nature, biomedical signals are almost always analogue (continuous in time and amplitude), while

computerized applications (and not only) work on digital signals (discrete in time and amplitude). Thus we

have to perform and analog to digital conversion (A/D), which consists in:

  • Periodic time sampling : observation of the analog signal at equidistant instants. The signal becomes

discrete-time and continuous-amplitude. Making the time discrete is called sampling. Sampling means

observing the signal at very specific instants and this instants must be periodic, the time interval between 2

consecutive observations must be the same. The problem is that if there is an important part of the signal

between two consecutive samples, that information is lost. In this case we have to come back to the

continuous signal and sample again with another sampling frequency.

  • Quantization : the amplitude can take only a finite number of values, typically encoded with 8, 16, 32...

bits. The signal becomes discrete- time and discrete-amplitude.The digitalization of the amplitude is called

quantization. The quantization depends on the power of the computer.

Digital signals are both periodically time sampled and quantized.

s ̂( t ) = s ( t ) w ( t ) w i t h w ( t ) {

1 f or | t | ≤ T

0 f or | t | > T

S ( ω ) = S ( ω ) * W ( ω ) =

2 π ∫

  • in f t y

−∞

S ( α ) W ( ω − α ) d α

If the delta functions are separate enough (fs is big enough) so that the repetition of the morphology of S(f)

do not overlap, I can use a low pass filter to extract S(f) and come back to s(t). Reconstruction of a continuous

signal s(t) from SS(f) is possible if and only if s(t) is band-limited (i.e. S(f)=0 for |f |> B). In this case, in fact, it

is possible use a low-pass filter (hypothesize ideal) ideal for removing frequency components outside the [-B B]

range.

Shannon theorem (sampling theorem)

To reconstruct a continuous signal s(t) from a sampled signal ss(t):

1. s(t) has to be band-limited: S(f) = 0 for | f |> B

2. The sampling frequency must be at least twice the maximum frequency B of s(t) ( Nyquist Condition ):

fs≥2B

If fs=2B the two consecutive repetitions have one point in common, they touch in one point. To know exactly

the sampling frequency, I must know the band of the signal. Suppose you don’t know the correct sampling

frequency, you choose a sampling frequency, you sample the signal and go in the frequency domain. If the

spectrum does not go to 0, you are not using the correct sampling frequency.

, so when you are sampling you are somehow deciding the maximum band that the signal can have,

is like to apply a low-pass filter. Making higher than it’s needed the sampling frequency may not be

convenient because you are recording noise in addition to your signal.

If the Nyquist condition is not verified the reconstructed signal is not equal (i.e. does not have the same info

content) to the sampled one. This phenomenon is called aliasing.

The distance between 2 observation is

very large so that the sampling

frequency is very low and so the two

morphologies overlap. With the

aliasing I lose informations, the final

signal is very different from the

original one.

A bandpass signal can always be seen as a low-pass signal convolved by a cosine. It can be demonstrated that

Shannon theorem, for band-pass signals, becomes:

B ≤ f s

fs =

2 f ma x

m

wh er e m = max i n t ≤

f ma x

f ma x − f min