GBM - Acquisition Et TDBM

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 60

ENSET-RABAT AU: 2016/2017

Filière: Ingénieur en Génie Biomédical


Option: Instrumentation biomédicale

Module: Acquisition et traitement


de données biomédicales
Prof: A.JBARI
atmjbari@gmail.com

GBM-Inst BM 1
Plan
A. Electrodes de mesures et grandeurs biomédicales:
– Biopotentiels et électrodes de mesure
– Grandeurs biomédicales
– Caractéristiques de signaux ECG, EEG, EMG et EOG
B. Conditionnement
– Amplification
– Réjection
– Filtrage
– Isolation
– Types de branchement
C. Acquisition de données
– Conversion A/N
– Centrales d’acquisition
D. Traitement de données
– Traitement de signaux ECG
– Traitement de signaux EMG
Travaux pratiques: deux TPs sur iWorx HK-ELVIS Teaching Kit.

GBM-Inst BM 2
GBM-Inst BM 3
Biopotential electrodes
The current is carried by ions in the body, whereas it is carried by electrons on the
wires connecting the electrodes to the readout circuit.
Therefore, a transducer interface is necessary between the body and the readout
circuit that converts the ionic current into electronic current, or vice versa.
This interface is called a biopotential electrode. Cation

Oxidation
In order to allow the current flow between:
Reduction
-the electrolyte, which has no free electrons,
Anion
-and the electrode, which has no free cations or anions,
a chemical reaction has to occur at the interface that can be
represented by the following general equations:

GBM-Inst BM 4
Biopotential electrodes

Equivalent circuit model of a biopotential electrode

half-cell potential

silver/silver choloride (Ag/AgCl)

The most important advantages of the Ag/AgCl electrodes are their


low impedance and low artifact due to the motion of artifact.

GBM-Inst BM 5
Biopotential signals from the human body

Electrocardiogram Electroencephalogram
(ECG) (EEG)

Electrooculogram
(EOG)
Electromyogram
(EMG) electrodes above or below
(up–down) and the sides of
the eyes along with an
independent reference.
GBM-Inst BM 6
Biopotential recording
Electrocardiogram (ECG) ECG, normal sinus rhythm

Electroencephalogram (EEG) EEG, normal patient with open eyes

Electromyogram (EMG) EMG, flexion of biceps muscles

Electrooculogram (EOG) EOG, movement of eyes from left to right

GBM-Inst BM 7
Electric interference in biopotential recordings

(a) ECG signal with


baseline changes and
motion artifacts

(b) muscle signal


interference

(c) electromagnetic
interference (60 Hz
power line and RF).

GBM-Inst BM 8
Biopotentials,, Specifications,
Biopotentials Specifications, and Applications

GBM-Inst BM 9
Electrocardiogram (ECG)
• Heart rate: RR interval
• ECG waveform:
 P wave, atrial depolarization: duration, amplitude
 PR interval, AV (Atrioventricular(AV) propagation time:
duration
 QRS complex, ventricular depolarization: duration,
shape, amplitude
 ST segment, isoelectric: elevation
 T wave, ventricular repolarization: amplitude,
orientation
 QT segment, ventricular depolarization+
repolarization:duration, dispersion

Schematic representation of
normal ECG GBM-Inst BM 10
Electrocardiogram (ECG)

GBM-Inst BM 11
Electromyogram (EMG)
An electromyogram (EMG) is a common clinical test used to assess function of muscles and
the nerves that control them.
EMG studies are used to help in the diagnosis and management of disorders such as the
muscular dystrophies and neuropathies.
 Nerve conduction studies that measure how well and how fast the nerves conduct impulses
are often performed in conjunction with EMG studies.

GBM-Inst BM 12
GBM-Inst BM 13
Biopotential Amplifiers

High CMRR (Common Mode Rejection Ratio) to reject interference from mains (>120dB).

HPF characteristics for filtering differential DC electrode offset.

Low-noise for high signal quality.

Ultra-low power dissipation for long-term power autonomy.

Configurable gain and filter characteristics that suit the needs of different biopotential

signals and different applications.

Tension de mode différentiel: ࢜ࢊ = ࢜ࢋ૚ − ࢜ࢋ૛


‫ ݀ݒ ݀ܣ = ݏݒ‬+ ‫ܿݒ ܿܣ‬
‫݁ݒ‬1 + ‫݁ݒ‬2
Tension de mode commun: ‫= ܿݒ‬
2
࡭ࢊ
࡯ࡹࡾࡾ(ࢊ࡮) = ૛૙ ࢒࢕ࢍ૚૙ ฬ ฬ
࡭ࢉ

GBM-Inst BM 14
Instrumentation amplifier

Biopotential electrode

Biopotential electrode
HP and LP Filters
Reference or Ground (1/(2πR5C1) 1/(2πR7C2)
electrode
ܴ1
‫ܧ‬1 − ‫ܧ‬2 = (‫݋ݒ‬1 − ‫݋ݒ‬2 ) ×
ܴ1 + 2ܴ2

GBM-Inst BM 15
Instrumentation amplifier

The AD8627 JFET operational amplifier used as a buffer for The AD8224 JFET instrumentation amplifier offers low
low input bias current. input bias current

GBM-Inst BM 16
Instrumentation amplifier
AD8224
Two channels in a small 4 mm × 4 mm LFCSP
Low input currents
10 pA maximum input bias current (B grade)
0.6 pA maximum input offset current (B grade)
High CMRR
100 dB CMRR (minimum), G = 10 (B grade)
90 dB CMRR (minimum) to 10 kHz, G = 10 (B grade)
Excellent ac specifications and low power
1.5 MHz bandwidth (G = 1)
14 nV/√Hz input noise (1 kHz)
Slew rate: 2 V/μs
750 μA quiescent current per amplifier APPLICATIONS
4.5 V to 36 V single supply Medical instrumentation
+/-2.25V to +/-18V Precision data acquisition
Transducer interfaces
Differential drives for high resolution input ADCs
Remote sensors

GBM-Inst BM 17
Electrostatic interference to the human body

GBM-Inst BM 18
Filtering

Band pass filter 50 or 60 Hz notch filter to remove high-pass filter


(front end of biopotential electrode) the power line interference (baseline reduction

GBM-Inst BM 19
Electrical Isolation
Electrical Isolation
Electrical isolation limits the possibility of the passage of any leakage current from
the instrument in use to the patient.

GBM-Inst BM 20
Connection circuits
Voltage:

Mesure simple
(Single ended)

Mesure différentielle
(Differential )

GBM-Inst BM 21
Connection circuits
Current:

Mesure avec
Shunt interne

Mesure avec
shunt externe

GBM-Inst BM 22
Connection circuits
Resistances:

2 wire technique

4 wire technique
3 wire technique
GBM-Inst BM 23
Connection circuits
Digital inputs:

GBM-Inst BM 24
GBM-Inst BM 25
Constitution

ࢂࡲࡿ
Resolution (quantum): ࢗ=
૛࢔ Conversion word: n bits ;
Full scale voltage : VFS
GBM-Inst BM 26
Entrées analogiques
– Pour mesurer une tension analogique (entre -10V et 10V), on doit préciser le
nombre Ne d’échantillons à lire et la fréquence d’échantillonnage Fe.
– Pour obtenir une mesure correcte, il faut que la fréquence d’échantillonnage soit
au minimum le double de la fréquence maximale du signal :
Théorème de Shannon : Fe ≥ 2fmax

GBM-Inst BM 27
Conversion A/N
Convertisseur simple rampe :

Convertisseur à rampe numérique

GBM-Inst BM 28
Conversion A/N
Convertisseur double rampe (ou par intégration) :

Ces convertisseurs offrent une bonne résolution, mais sont très lents. On peut les utiliser avec
des cycles de conversion de 20ms de manière à s’affranchir de l’influence du secteur (50Hz).

GBM-Inst BM 29
Conversion A/N

Convertisseur par approximations successives

GBM-Inst BM 30
Conversion A/N
Convertisseur FLASH :

Av: Very Fast


Comparaison:
Inc: For n bits : 2n – 1 comparators

GBM-Inst BM 31
E/S logiques
• Commande de sorties logiques (DO= Digital Output)
– Ces actions peuvent être utilisées pour commander la mise en marche d'un
moteur, allumer une LED, actionner un relais, faire avancer un moteur pas
à pas ...
• Lectures d'entrées logiques (DI = Digital Input)
– Les niveaux d’entrées sont adaptés TTL :
• Le 0 logique : 0V à 0,8V
• Le 1 logique : 2V  5V
– Les entrées logiques sont utilisées pour les capteurs divers de type TOR, les
codeurs de déplacement…

GBM-Inst BM 32
Data Acquisition (DAQ)

Components of a Typical DAQ System

GBM-Inst BM 33
Data Acquisition (DAQ)

NI USB-621116-Bit, 250 kS/s M Series


Multifunction DAQ, Bus-Powered

16 analog inputs (16-bit, 250 kS/s)


2 analog outputs (16-bit, 250 kS/s); 4 digital inputs; 4 digital outputs; 2 32-bit counters
Bus-powered USB for high mobility; built-in signal connectivity
NI signal streaming for sustained high-speed data streams over USB; OEM version available
Compatible with LabVIEW, LabWindows™/CVI, and Measurement Studio for Visual Studio .NET
NI-DAQmx driver software and NI LabVIEW SignalExpress LE interactive data-logging software

GBM-Inst BM 34
Data Acquisition (DAQ)

USB--621x
USB 621x Block Diagram

GBM-Inst BM 35
Data Acquisition (DAQ)
USB--621x
USB 621x Analog Input Circuitry

GBM-Inst BM 36
Data Acquisition (DAQ)
USB-621x devices support the following analog input ground-reference settings:
• Differential Mode—In DIFF mode, USB-621x devices measure the
difference in voltage between two AI signals.
• Referenced Single-Ended Mode—In RSE mode, USB-621x devices
measure the voltage of an AI signal relative to AI GND.
• Non-Referenced Single-Ended Mode—In NRSE mode, USB-621x
devices measure the voltage of an AI signal relative to the AI SENSE input.

GBM-Inst BM 37
GBM-Inst BM 38
ECG Processing
ECG Diagram:

ECG Example:

GBM-Inst BM 39
ECG Processing

 Baseline: les défauts des électrodes et des réactions


chimiques secondaires produisent une différence de potentiel
altérant le signal de l’activité cardiaque:

 Solutions possibles:
- Filtre passe-haut: fc>0.05Hz
- Filtre passe-bas: fc<0.05Hz suivi de la soustraction
- Moyennage avec déplacement (Moving average)

GBM-Inst BM 40
ECG Processing
Pan–Tompkins algorithm:

The algorithm developed by Pan and Tompkins identifies QRS complexes based on
analysis of the slope, amplitude, and width of the QRS.

Block diagram of the Pan–Tompkins algorithm for the detection


of QRS complexes in ECG signals.

The bandpass filter, formed using lowpass and highpass filters, reduces noise in the ECG
signal, such as muscle noise, 60 Hz interference, and baseline drift.
The signal is then passed through a differentiator to provide a large response at the high
slopes that distinguish QRS complexes from low-frequency ECG components such as the P
and T waves.

GBM-Inst BM 41
ECG Processing

The next operation is the squaring operation, which emphasizes the higher values
expected due to QRS complexes and suppresses smaller values related to the P and T
waves, as well as noise in the output of the preceding stage.
The squared signal is then passed through a moving-window integrator of window
length Example: N = 30 samples (for the sampling frequency of fs = 200 Hz).
The expected result is a single smooth peak related to the QRS complex for each ECG
cycle.
The output of the moving-window integrator may be used to detect QRS complexes,
measure RR intervals, and determine the duration of the QRS complex.

GBM-Inst BM 42
ECG Processing
Moving-window integrator :

Schematic ECG signal.

Output of the moving-window integrator.


QS: QRS complex width.
W: width of the integrator window, given as N/fs

GBM-Inst BM 43
ECG Processing

0.6

a1=load('a01m.mat') 0.5

Nbits=10; 0.4
fs=100;
ecg_x=a1.val/(2^Nbits); 0.3

Amplitude
base_line=0.2*sin(2*pi*0.03*(0:length(ecg_x)-1)/fs); 0.2
ecg_x=ecg_x+base_line;
figure(1); 0.1

plot(ecg_x) 0
xlabel('time');ylabel('Amplitude');
-0.1
grid
-0.2
0 100 200 300 400 500 600 700 800 900 1000
time

ECG+Baseline

GBM-Inst BM 44
ECG Processing

0.3

%Bandpass filtering 0.25


filter_ord=30;
0.2
band_freq=[5 40]/(fs/2);
b = fir1(filter_ord,band_freq); 0.15

ecg_filter=filter(b,1,ecg_x); 0.1

Amplitude
figure(2);
0.05
plot(ecg_filter)
xlabel('time');ylabel('Amplitude'); 0

grid -0.05

-0.1

-0.15

-0.2
0 100 200 300 400 500 600 700 800 900 1000
time

Bandpass filtering

GBM-Inst BM 45
ECG Processing

0.3

%Differentiation
0.2
diff_ecg=diff(ecg_filter);
figure(3);
0.1
plot(diff_ecg)
xlabel('time');ylabel('Amplitude'); 0

Amplitude
grid
-0.1

-0.2

-0.3

-0.4
0 100 200 300 400 500 600 700 800 900 1000
time

Differentiation

GBM-Inst BM 46
ECG Processing
0.09

0.08

%Squaring
0.07
sq_ecg=diff_ecg.^2;
figure(4); 0.06

plot(sq_ecg);

Amplitude
0.05
xlabel('time');ylabel('Amplitude');
grid 0.04

0.03

0.02

0.01
Peak detection?
0
RR distance =……………..? 0 100 200 300 400 500
time
600 700 800 900 1000

Heart Rate =……………….?


Squarring

GBM-Inst BM 47
ECG Processing

%Moving window integrator


Lw=15;
0.2
ecg_intg=[];
for k=Lw:length(sq_ecg-Lw) 0.15
ecg_intg(k-Lw+1)=sum(sq_ecg(k-Lw+1:k));

Amplitude
0.1

end
0.05
figure(5);
plot(ecg_intg); 0
0 100 200 300 400 500 600 700 800 900 1000
xlabel('time');ylabel('Amplitude'); time
grid

GBM-Inst BM 48
EMG Processing
Analyse parameters:
In modern digital systems two indicators of sEMG amplitude are used: mean absolute
value (MAV), also called average rectified value (ARV), and root-mean-square (RMS)
value.

Mean frequency (MNF) :

where fs is the sampling frequency, and P(f) is the PSD of the signal.

Median frequency (MDF) is defined as:

where fmed is the median frequency, fs is the sampling frequency, and P(f) is the PSD of
the signal
GBM-Inst BM 49
Clinical Biomechanics Research Group

EMG Processing
Etapes:
1) Supprimer la composante continue (DC) du signal EMG
2) Calculer la valeur absolue du signal EMG.
3) Détecter l’enveloppe: par application d’un filtre passe-bas ou moyennage sur une
fenêtre glissante.
4) Calculer le spectre en amplitude du signal résultant et sa densité spectrale de
puissance.
5) Analyser le comportement du muscle dans les phases de « contraction – relaxation ».

EMG activity: averaging


absolute values

GBM-Inst BM 50
Clinical Biomechanics Research Group

EMG Processing

• Loading the EMG data into the MATLAB environment


y=load('emg.txt');

y is the variable (vector) that contains the EMG data.

• Plotting the data


plot(y)

xlabel('Sample number')

ylabel('EMG signal')

GBM-Inst BM 51
Clinical Biomechanics Research Group

EMG Processing

• Remove any DC offset of the signal


y2=detrend(y);

y2 is the signal without DC offset.

• Rectification of the EMG signal


rec_y=abs(y2);

plot(rec_y)

xlabel('Sample number')

ylabel('Rectified EMG signal')

GBM-Inst BM 52
Clinical Biomechanics Research Group

EMG Processing
Linear Envelope of the EMG signal
You need to construct a low pass filter of a cut off frequency of say, 10Hz. In this example,
the sampling frequency is 1000Hz, and we shall use the 5th order filter.
[b,a]=butter(5,10/1000,'low');
The next step is to filter the signals to obtain the linear envelope. The command filtfilt
performs filtering in both directions to eliminate any
phase shift of the signal.
filter_y=filtfilt(b,a,rec_y);
plot(filter_y)
xlabel('Sample number')
ylabel('Low Pass Filtered EMG signal')
filt_y is the filtered signal.
You should obtain the following

GBM-Inst BM 53
Clinical Biomechanics Research Group

EMG Processing

Detection of onset of muscle contraction


onset_time=onset(filter_y,500,1000,1000,5000)
In this example, (500,1000) are the beginning and
end of the sample which refers to the muscle at rest.
(1000,5000) are the beginning and end of the sample
which is to be analysed. onset_time is the onset time.
You should obtain the following graph.

The onset is the parameter that indicates the


beginning of swallowing.

GBM-Inst BM 54
Clinical Biomechanics Research Group

EMG Processing
Fourier Transform (FFT) of the EMG signals
In this example, we assume a sampling frequency of
1000Hz.
This command will compute the median frequency
(mf) of the FFT spectrum
which is often employed for analysing muscle fatigue.
The plot is very useful in examining the
frequency content of the signals, for instance, if there
is any dominant noise of 50Hz due to the mains and
its harmonics. The following
plot shows that the signal is possibly contaminated by
the mains.
Saving processed data
save 'filteremg.dat' filter_y - ascii

GBM-Inst BM 55
EMG Processing
Source:
https://www.physionet.org/physiobank/database/emgdb/

Description:
A 25mm concentric needle electrode was placed into the tibialis anterior muscle of each
subject. The patient was then asked to dorsiflex the foot gently against resistance. The
needle electrode was repositioned until motor unit potentials with a rapid rise time were
identified. Data were then collected for several seconds, at which point the patient was
asked to relax and the needle removed.
Data Acquisition:
The data were recorded at 50 KHz and then downsampled to 4 KHz. During the recording
process two analog filters were used: a 20 Hz high-pass filter and a 5KHz low-pass filter.

GBM-Inst BM 56
EMG Processing

1) a 44 year old man without history


of neuromuscular disease;

2) a 62 year old man with chronic low


back pain and neuropathy due to a right
L5 radiculopathy;

3) a 57 year old man with myopathy


due to longstanding history of
polymyositis, treated effectively with
steroids and low-dose methotrexate.
Source
https://www.physionet.org/physiobank/database/emgdb/
GBM-Inst BM 57
Embedded Biomedical System
Example: Blood Pressure Monitor

GBM-Inst BM 58
Biomedical Labs
Labs:
LabVIEW Programmation
Two labs on iWorx HK-ELVIS Teaching Kit.

Foundations of Human Physiology iWorx Systems, Inc.


Experiments www.iworx.com
Cardiac Physiology
■ The Electrocardiogram (ECG) and the Pulse
Muscle Physiology
■ Electromyogram (EMG) Activity and Muscle
Strength LabScribe NI
Software

GBM-Inst BM 59
Bibliographie

• Chapitres de livres:
– 9781402090929-c2.pdf (www.springer.com)
– Biopotential Electrodes.pdf (http://www.fis.uc.pt/data/20062007/apontamentos/apnt_134_5.pdf)
– Biopotentials and Electrophysilogy Measurement.pdf (http://mx.nthu.edu.tw/~yucsu/3271/p07.pdf)

• Documents constructeurs:
– www.cypress.com
– www.ni.com
– www.analog.com

GBM-Inst BM 60

You might also like