ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
Table of Contents
Résumé/Abstract 
2 

INTRODUCTION 
3 

1. CONTEXT AND PROBLEM STATEMENT : 
4 

1.1 Context / socioeconomic interest of the project 
4 

1.2 Problem statement 
4 

1.3 State of art 
4 

2. METHODOLOGY 
6 

2.1 Problem Decomposition 
6 

2.2 Summary of the various steps of the methodology 
8 

2.3 Modelling and algorithms of the different blocks 
16 

2.3.1 Block 1 ; 
17 

2.3.2 Block 2 : 
17 

2.3.3 Block 3 : 
18 

2.3.4 Block 4 : 
19 

2.3.5 Block 5 : 
20 

2.3.6 Block 6 : 
21 

2.3.7 Block 7 : 
21 

2.3.8 Block 8 : 
22 

2.4 
Synoptic of the program 
23 
3. RESULTS 
25 

4. ANALYSIS AND DISCUSSIONS 
31 

5. CONCLUSIONS ET PERSPECTIVES 
32 

6. REFERENCES 
33 
5 GTEL, 20122013
Page 1
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
Résumé
Ce projet vise à faciliter la prise en charge des maladies respiratoires, en mettant à la disposition des médecins et autres spécialistes de la santé un moyen rapide d‟analyser des relevés de la courbe respiratoire d‟un sujet. Il s‟agit notamment de concevoir une application qui prend en entrée la courbe de respiration (volume en fonction du temps) échantillonnée d‟un sujet, accomplit une analyse, détecte et classifie les maladies dont les empreintes se trouveraient dans ce signal. Ceci afin que le médecin en charge puisse apporter rapidement les soins nécessaires au sujet, en cas de maladie.
Abstract
The aim of this project is to improve on the diagnosis and treatment of diseases affecting the respiratory system, by providing doctors and other health personnel, with a rapid way of analyzing data of a subject‟s respiratory pattern. In fact, the objective is to design a program with a user interface, which uses as input, sampled data of a subject‟s respiratory pattern (volumetime curve) recorded under suitable conditions, analyzes the data in order to detect and classify any disease, whose signature may be present in the respiratory signal. This would enable a quick appropriate medical care to be given to the subject, in case of any illness.
5 GTEL, 20122013
Page 2
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
INTRODUCTION
Nowadays with the fast growing world population, efficient widespread methods of diagnosing diseases, with or without the presence of a medical doctor, are becoming very important. A wide variety of chronic diseases affect the human respiratory pattern. In this sense, it is essential to study the symptoms of these diseases and design methods for the analysis of this pattern so as to be able to detect and classify any disease influencing it. Our objective is to design a computer program capable of analyzing a subject‟s respiratory pattern and proposing a classification of the disease(s) the person may be suffering from. We shall first present the context and problem statement of this study and later the methodology applied in order to obtain the expected results.
5 GTEL, 20122013
Page 3
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
1. 
CONTEXT AND PROBLEM STATEMENT : 
1.1 
Context / socioeconomic interest of the project 
This project aims at providing a cheap and fast way of analyzing a subject‟s respiratory pattern, it requires little experience and qualification (a technician who knows how to manipulate some hardware – spirometer and record some data files). The results provided by the program (which we shall design) can then be appreciated by a specialist and necessary medical attention given to the subject, based on the results.
1.2 Problem statement
Once data files have been recorded for a given subject, they need to be treated for the necessary parameters to be extracted. We shall thus design a computer program to solve the latter problem. We shall assume in this study that the data have already been collected so we shall concentrate on the analysis of the above mentioned files.
1.3 State of art
There exist several manufacturers of computerbased systems comprising both the hardware necessary for data collection and the corresponding computer software for analysis.
Figure 1: A PCbased spirometer (Source: healthequip.com)
5 GTEL, 20122013
Page 4
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
Figure 2 : A USB spirometer, GUI interface (by Advanced Medical Engineering)
5 GTEL, 20122013
Page 5
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
2. 
METHODOLOGY 
2.1 
Problem Decomposition 
Figure 3: Architecture of the program
5 GTEL, 20122013
Page 6
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
NB:
 The above classification of a subject’s condition, under:
Normal;
Obstructive;
Restrictive or
Mixed,
is the most detailed possible classification that studies permit us to perform.
 The following information should be collected for each patient whose spirogram (breathing pattern data) is recorded since they are closely related to the respiratory pattern and necessary for further analysis of the results obtained:
Age
Gender: Male or Female
Height
Weight
Smoker or not a smoker?
If female subject, pregnant or not pregnant?
 In order to record the breathing pattern data of a subject, the examiner should ensure the following:
Subject should be relaxed, sit upright and exercise no effort during the examination.
The examination should be carried out with a device that records the volume of air in the subject‟s lungs with time, and stores the data in a digital format for analysis on a computer.
The subject should insert the mouthpiece while undertaking tidal breathing (ordinary breathing) at FRC (Functional Residual Capacity), and then, in one continuous sequence, make a slow inspiration to total lung capacity (TLC), followed directly by a slow expiration to residual volume (RV), followed by a full inspiration with maximal effort to TLC and then by a full expiration with maximal effort back to RV.
Figure 4 : The various characteristics of the respiratory pattern during ordinary and forced breathing conditions
5 GTEL, 20122013
Page 7
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
2.2 Summary of the various steps of the methodology
Figure 5 : Example to illustrate the smoothening algorithm
Step 2 : Detection of the maximum turning points of the curve and the minimum turning point just after each maximum
Consider (
) the set of maximum turning points.
5 GTEL, 20122013
Page 8
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
STEP 1: Detection of the maximum turning points
For a point (
mean and standard deviation respectively of the
)
consider a window of
points around it, denoted as
)
data points in
(
(
) Let m, s denote the
round 
. 
shall be chosen by the user to refine the peak selection process. 

This 
point is a peak or maximum turning point if : 

( ) 
( 
) 
 
 
for some suitably chosen value of 

[ 
] 
since this interval gave satisfactory peaks during tests. 

i.e. 
[ 
] 

( 
) 

 
( 
) 

( 
), 
(the set of peaks)
STEP 2: Detection of the minimum turning point consecutive to each maximum turning point
Minimum turning points occur at troughs between two consecutive maximum turning points.
So to detect the minimum sample between two consecutive maximum turning points, we apply the “min” function to each interpeak interval.
By so doing we obtain the set of minima
.
Figure 6 : Illustration of peak and trough detection. The maxima are the red points while the minima are black:
Step 3 : Classification of the maximum values detected under “ordinary” and “forced”
5 GTEL, 20122013
Page 9
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
Our objective here is classify the maxima into two subgroups of points ( ) ( ): those belonging to the ordinary breathing pattern and those belonging to the forced breathing pattern (greater values due to forceful breath). It will then be possible to evaluate characteristics pertaining to the ordinary breathing pattern (respiratory rate, tidal volume, functional residual capacity) and those pertaining to the forced breathing pattern (forced vital capacity, forced expiratory volume in 1 second, peak expiratory flow).
PROCEDURE
 A maximum turning point is selected at random amongst the above determined set of maximum
turning points (
), say,
 The difference between
This point is considered to be in the subgroup (
)
and each of the other values
of the set ( ) is then calculated :
If the absolute value of the difference is less than 0.5 litre, 

then the points
“ORDINARY” or “FORCED”.
and
belong to the same subgroup of points (
) which could be
NB: 0.5 L because the difference in volume between two points both belonging to either the ordinary or forced breathing pattern is normally negligible.
Otherwise (the absolute value of the difference is greater than 0.5 litre), the points
i.e.
and
belong to different subgroups.
belongs to (
).
 Now an arbitrary value, chosen from the set ( ) :
is chosen from the set (
)
and compared to an arbitrary value,
,
If
then the set ( ) is the set of points which belong to the ordinary breathing
) is that which contains the points of the forced breathing
pattern and the set ( pattern.
Otherwise ( ), ( ) is the set for the forced breathing pattern and ( ) the set for the ordinary breathing pattern.
Step 4 : Calculation of the respiratory rate, functional residual capacity and tidal volume
5 GTEL, 20122013
Page 10
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
Let
be the set of maximum turning points of the ordinary breathing pattern.
Volume
Sample n°
Time
(
)
 Determination of the tidal volume (in Liters) :
TV (Tidal Volume): The tidal volume is the volume of air that is inhaled or exhaled in a single breath/cycle.
Figure 7: Each dark doublearrowed line indicates the amplitude of the tidal volume
 Determination of the functional residual capacity(FRC) (in liters):
The FRC is the average volume of the set of minima, of the ordinary breath pattern.
Figure 8: The dark horizontal line indicates the volume level of the functional residual capacity
 Determination of the respiratory rate (in breaths per minute):
(
)
(
)
5 GTEL, 20122013
Page 11
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
This is done by determining the average time interval T (minutes) between two consecutive points of the set .
( )
(
)
(
)
( 
) 

( 
) 
Figure 9 : Each dark doublearrowed line arrows indicates the size of a period (time axis horizontal)
Step 5 : Plot of the Flow –Volume curve
It shows various parameters that can be read directly by a specialist.
5 GTEL, 20122013
Page 12
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
Step 6 : Calculation of the FVC (Forced Vital Capacity), FEV1 (Forced Expiratory Volume in 1 s) and PEF (Peak Expiratory Flow)
5 GTEL, 20122013
Page 13
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
Step 7 : Calculation of nominal values of FVC, FEV1 and PEF
Nominal values of FVC, FEV _{1} and PEF are calculated as follows:
5 GTEL, 20122013
Page 14
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
where:
 H is the height of the subject in meters.
 A is the age of the subject in years.
 Norms provide the values of the coefﬁcients
for each parameter.
The coefﬁcients for FVC, FEV1 and PEF, published by the European Respiratory Society are presented in the table below. According to the norms, the age range is from 25 to 70 years and the height range is from 1.55 to 1.95 meters (for men) and from 1.45 to 1.80 meters (for women).
Coefficients
FOR MEN
FVC
FEV _{1}
PEF
FOR WOMEN
FVC
FEV _{1}
PEF
Table 1 : Standard coefficients for the calculation of the nominal values of FVC, FEV1 and PEF
These parameters demonstrate a stronger dependence on the height (large absolute value of
on the age (small absolute value of
).
) than
Step 8 : Comparison of nominal values with those obtained from the subject‟s breathing pattern and classification of a subject‟s condition 



5 GTEL, 20122013
Page 15
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
The individual spirometry results vary depending on the conditions of the ventilation mechanism. In general, the results close to 100% of the nominal values are interpreted as normal. The results that differ 20% and more from the nominal value are considered abnormal.
With 
the 
age 
and 
height 
of 
a 
given 
subject, 
the 
above 
nominal 
values 
( 
) are calculated. 
The following classification of diseases (OBSTRUCTIVE, RESTRICTIVE or MIXED) is based on the comparison of the values obtained from measurements with the nominal values.
OBSTRUCTIVE 
RESTRICTIVE 
MIXED 

1) 
Chronic Obstructive Pulmonary Disease which includes emphysema and chronic bronchitis Asthma Bronchiectasis Cystic Fibrosis Lung Cancer Obliterative Bronchiolitis 
1) 
Interstitial lung disease Sarcoidosis Obesity, including obesity hypoventilation syndrome Scoliosis Muscular dystrophy or Amyotrophic Lateral Sclerosis Parenchymal lung tumors Pulmonary edema 

2) 

3) 

Diseases 
4) 
Both an obstructive and a restrictive disease 

2) 3) 
5) 

4) 

5) 
6) 

6) 

7) 

FVC 

FEV _{1} 

PEF 
(See Figure 10 on page 13, for the FlowVolume curve shape of each group of diseases)
2.3 Modelling and algorithms of the different blocks
5 GTEL, 20122013
Page 16
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
2.3.1 Block 1 ;
Real signals are noisy and need to be filtered. This block filters the input data in order to smoothen its curve and facilitate the subsequent detection of the maxima and minima it contains. After the input file is read, filtering is performed in MATLAB with the following command lines:
[C,L] =
wavedec(rough,8,'db4');
smooth = appcoef(C,L,'db4',5);
where:
 “rough” is the vector containing the samples of the input (rough) signal and
 “smooth” is the vector containing the samples of the smooth signal.
NB: The filter used is a „daubechies filter‟ and the resulting smooth signal contains times less samples than the initial rough signal.
Figure 13: Example showing a rough and corresponding filtered signal
2.3.2 Block 2 :
5 GTEL, 20122013
Page 17
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
The calculation of the required parameters (FVC, FEV1, PEF, Tidal Volume, etc…) is based on information concerning the peaks and troughs of the smooth signal. These maxima and minima therefore have to be detected.
%% Peak detection MATLAB PROGRAM max_counter_i = 0; max_counter_f = 0; for ctr = k+1 : length(xx)k local_mean(1,ctr) = mean( [smooth(ctrk:ctr 1),smooth(ctr+1:ctr+k)] ); local_std(1,ctr) = std( [smooth(ctrk:ctr 1),smooth(ctr+1:ctr+k)] ); if ((smooth(ctr) >= local_mean(1,ctr)) && (abs( smooth(ctr)  local_mean(1,ctr) ) >= 1.12* local_std(1,ctr))) % Selection criterion for maximum
smooth(ctr),ctr];
vector
end
max_counter_i = max_counter_i + 1; Maxima_i(max_counter_i, 1:3) = [xx(ctr), %% ctr is the index of this sample in the smooth
end %% On élimine les max éloignés de la moyenne for ctr = 1 : max_counter_i if ctr == ctr %abs( Maxima_i(ctr,2)  mean(Maxima_i(:,2)) ) <= 1.5*std((Maxima_i(:,2))) max_counter_f = max_counter_f + 1; Maxima_f(max_counter_f,1:3) = Maxima_i(ctr,1:3); Maxima_f_min(max_counter_f, 1:3) =
Maxima_f(max_counter_f,1:3);
end end %% Finding the minimum after each maximum for ctr1 = 1 : max_counter_f  1 index_start = Maxima_f(ctr1,3); index_end = Maxima_f(ctr1+1,
3);
[value, pos] = min(smooth(index_start:index_end));
%% On
recherche le min entre deux max consécutifs Maxima_f_min(ctr1,4:5) = [value, xx(pos+index_start)]; % Col1 = Time values for each max, Col2 = Max values; Col3 = index of max, Col4 = value of next min; Col5 = time of next min end test = Maxima_f_min(1,2); ctr_small_max = 1; Maxima_f_small_max(1,1:5) = Maxima_f_min(1,1:5); for ctr2 = 2: max_counter_f if (abs(test  Maxima_f_min(ctr2,2)) < 0.5) ctr_small_max = ctr_small_max + 1; Maxima_f_small_max(ctr_small_max, 1:5) =
Maxima_f_min(ctr2,1:5);
end
end
2.3.3 Block 3 :
5 GTEL, 20122013
Page 18
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
We shall process input signals which contain a waveform for ordinary breath and a waveform for forced breath. It is essential to classify the peaks and troughs as belonging to either the ordinary or forced breath phases.
%% A portion of the MATLAB code for the classification of the peaks and troughs ctr_small_max_1 = 2; Maxima_f_small_max_1(1:2,1:5) = Maxima_f_small_max(1:2, 1:5); ctr_small_max_2 = 0; ctr_small_max_3 =0; ctr_small_max_4 = 0;
for ctr3 = 3: length(Maxima_f_small_max) if ((Maxima_f_small_max(ctr3,1)  Maxima_f_small_max(ctr3 1,1)) < 2 * (Maxima_f_small_max(2,1)  Maxima_f_small_max(1,1)) ) ctr_small_max_1 = ctr_small_max_1 + 1; Maxima_f_small_max_1(ctr_small_max_1, 1:5) =
Maxima_f_small_max(ctr3,1:5);
else
ctr_small_max_2 = ctr_small_max_2 + 1; Maxima_f_small_max_2(ctr_small_max_2,1:5) =
Maxima_f_small_max(ctr3,1:5);
ctr_small_max_2 = ctr_small_max_2 + 1; Maxima_f_small_max_2(ctr_small_max_2,1:5) =
Maxima_f_small_max(ctr3+1,1:5);
end
end
break;
2.3.4 Block 4 :
%% Calculation of breath rate average1 = (length(Maxima_f_small_max_1(:,1))  1)/(Maxima_f_small_max_1(end,1)  Maxima_f_small_max_1(1,1)); average_resp_rate1 = 60 * average1;
average2 = (length(Maxima_f_small_max_2(:,1))  1)/(Maxima_f_small_max_2(end,1)  Maxima_f_small_max_2(1,1)); average_resp_rate2 = 60 * average2;
average3 = (length(Maxima_f_small_max_3(:,1))  1)/(Maxima_f_small_max_3(end,1)  Maxima_f_small_max_3(1,1)); average_resp_rate3 = 60 * average3;
average_resp_rate = (average_resp_rate1 + average_resp_rate2 + average_resp_rate3 )/3;
set(handles.resp_rate, 'String', num2str(average_resp_rate));
5 GTEL, 20122013
Page 19
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
%% Calculation of tidal volume tidal1 = mean(Maxima_f_small_max_1(:, 2))  mean(Maxima_f_small_max_1(1:end1, 4)); tidal2 = mean(Maxima_f_small_max_2(:, 2))  mean(Maxima_f_small_max_2(1:end1, 4)); tidal3 = mean(Maxima_f_small_max_3(:, 2))  mean(Maxima_f_small_max_3(1:end1, 4)); 

tidal_volume = (tidal1 + tidal2 + tidal3)/3; 

set(handles.tidal_volume, 'String', num2str(tidal_volume)); 

%% Calculation of Functional Residual Capacity frc = (mean(Maxima_f_small_max_1(1:end1, 4)) + mean(Maxima_f_small_max_2(1:end1, 4)) + mean(Maxima_f_small_max_3(1:end1, 

4)))/3; 

set(handles.frc, 'String', num2str(frc)); 

2.3.5 
Block 5 : 
A specialist, at a glance, can identify the various calculated parameters (FVC, FEV1, PEF).
%% Plot of the Flow  Volume curve %% Partie Expiration index_maxi = Maxima_f_min_big_max_1(2, 3); index_mini2 = find (xx == Maxima_f_min_big_max_1(2, 5)); %% Tableau de Volume  en 1ère colonne et Flow rate en 2ème
colonne
compteurpts2 = 0; for indexpt = index_maxi:index_mini2 compteurpts2 = compteurpts2 + 1; Vol_Flow_Tab_exp(compteurpts2, 1:2)= [smooth(indexpt) , abs((smooth(indexpt + 1)  smooth(indexpt  1))/( 2*xx(2)2*xx(1)))]; end %% Partie Inspiration index_mini1 = find (xx == Maxima_f_small_max_1(ctr_small_max_1, 5)); %% Tableau de Volume  en 1ère colonne et Flow rate en 2ème
colonne
compteurpts1 = 0; for indexpt = index_mini1:index_maxi compteurpts1 = compteurpts1 + 1; Vol_Flow_Tab_ins(compteurpts1, 1:2)= [smooth(indexpt) ,  abs((smooth(indexpt + 1)  smooth(indexpt  1))/( 2*xx(2)2*xx(1)))]; end
5 GTEL, 20122013
Page 20
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
2.3.6 Block 6 :
These parameters are essential for detecting and classifying a subject under (NORMAL, OBSTRUCTIVE DISEASE, RESTRICTIVE DISEASE OR MIXED).
Maxima_f_min_big_max_1(1, 1:5) = Maxima_f_min (ctr_small_max_1, 1:5); % Min before
+1 
, 1:5); Maxima_f_min_big_max_1(2, 1:5) = Maxima_f_min (ctr_small_max_1 % Max itself 

Maxima_f_min_big_max_2(1, 1:5) = Maxima_f_min (ctr_small_max_1 

+ 
ctr_small_max_2+1, 1:5); 
% Min before 
Maxima_f_min_big_max_2(2, 1:5) = Maxima_f_min (ctr_small_max_1 

+ 
ctr_small_max_2+2 , 1:5); % Max itself 
fvc = ( Maxima_f_min_big_max_1(2, 2)  Maxima_f_min_big_max_1(2, 4)+ Maxima_f_min_big_max_2(2, 2)  Maxima_f_min_big_max_2(2, 4) )/2;
fev1_1 = Maxima_f_min_big_max_1(2, 2)  smooth(find (xx ==
max(xx(find(abs(xx  (Maxima_f_min_big_max_1(2, 1)+1)) <=
xx(1)))))));
(xx(2)
fev1_2 = Maxima_f_min_big_max_2(2, 2)  smooth(find (xx ==
max(xx(find(abs(xx  (Maxima_f_min_big_max_2(2, 1)+1)) <=
xx(1)))))));
fev1 = (fev1_1 + fev1_2)/2;
(xx(2)
%% Calcul du PEF pef1 = max(smooth(Maxima_f_min_big_max_1(2, 3) + 1:find (xx == Maxima_f_min_big_max_1(2, 5)) + 1)  smooth(Maxima_f_min_big_max_1(2, 3)  1:find (xx == Maxima_f_min_big_max_1(2, 5)) 1))/(2 *(xx(2)xx(1))); pef2 = max(smooth(Maxima_f_min_big_max_2(2, 3) + 1:find (xx == Maxima_f_min_big_max_2(2, 5)) + 1)  smooth(Maxima_f_min_big_max_2(2, 3)  1:find (xx == Maxima_f_min_big_max_2(2, 5)) 1))/(2 *(xx(2)xx(1))); pef = (pef1 + pef2)/2;
2.3.7 Block 7 :
5 GTEL, 20122013
Page 21
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
These parameters are evaluated (depend on the sex, height and age of the subject) so as to be compared to those evaluated above.
%% FOR MEN 

if get(handles.sex, 'Value') == 1 

fvcnom = 5.76 * (height/100)  0.026 * age  4.34; 

fev1nom = pefnom = 4.3 * (height/100)  0.029 * age  2.49; 6.14 * (height/100)  0.043 * age + 0.15; 

else 
%% FOR WOMEN 

fvcnom = 4.43 * (height/100)  0.026 * age  3.28; 

fev1nom = 3.95 * (height/100)  0.025 * age  2.6; 

pefnom = 5.5 * (height/100)  0.03 
* age  1.11; 

end 

2.3.8 
Block 8 : 
Upon classification (by comparison), corresponding messages shall be displayed on the interface.
if
NORMAL SUBJECT
(fvc >0.8*fvcnom && fev1 > 0.8*fev1nom && pef > 0.7*pefnom)
%%
set(handles.classif_noresults, 'Visible', 'off'); set(handles.classif_normal, 'Visible', 'on'); set(handles.classif_obstruct, 'Visible', 'off'); set(handles.classif_restrict, 'Visible', 'off'); set(handles.classif_mixed, 'Visible', 'off');
elseif (fvc <= 0.8*fvcnom && pef <= 0.7*pefnom) %% OBSTRUCTIVE DISEASE
set(handles.classif_noresults, 'Visible', 'off'); set(handles.classif_normal, 'Visible', 'off'); set(handles.classif_obstruct, 'Visible', 'on'); set(handles.classif_restrict, 'Visible', 'off'); set(handles.classif_mixed, 'Visible', 'off');
elseif (fvc <= 0.8*fvcnom && fev1 <= 0.8*fev1nom) %% RESTRICTIVE DISEASE
set(handles.classif_noresults, 'Visible', 'off'); set(handles.classif_normal, 'Visible', 'off'); set(handles.classif_obstruct, 'Visible', 'off'); set(handles.classif_restrict, 'Visible', 'on'); set(handles.classif_mixed, 'Visible', 'off');
elseif (fvc <= 0.8*fvcnom && fev1 <= 0.8*fev1nom && pef <=
5 GTEL, 20122013
Page 22
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
0.7*pefnom) 
%% MIXED 
set(handles.classif_noresults, 'Visible', 'off'); set(handles.classif_normal, 'Visible', 'off'); set(handles.classif_obstruct, 'Visible', 'off'); set(handles.classif_restrict, 'Visible', 'off'); set(handles.classif_mixed, 'Visible', 'on'); 

else 

%% NONE 

set(handles.classif_noresults, 'Visible', 'off'); set(handles.classif_normal, 'Visible', 'on'); set(handles.classif_obstruct, 'Visible', 'off'); set(handles.classif_restrict, 'Visible', 'off'); set(handles.classif_mixed, 'Visible', 'off'); 

end 
2.4 Synoptic of the program
Figure 14 : Synoptic of the program
5 GTEL, 20122013
Page 23
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
5 GTEL, 20122013
Page 24
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
3.
RESULTS
The program once launched shows the interface below.
Figure 15 : Presentation of the program interface
To proceed we need to select an input file in one of three possible manners:
Either by clicking on the “File item of the Menu”, by clicking on the Text Box beneath “Respiratory data faile (*.mat)” or by clicking the “Browse …” button.
Figure 16 : Loading a file in 3 different manners
Then select an input file in the dialog box.
5 GTEL, 20122013
Page 25
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
Figure 17 : Selecting a file in the dialog box
After the input file is selected, its content is displayed on the interface. Both the raw input signal and the corresponding filtered signal are displayed on the interface.
Figure 18 : Display of the raw input signal and filtered signal
The type of data present in the file has to be selected and the age, sex and height of the subject defined. The size of the local statistics window used in peak detection has a default value which can be modified, so as find an optimum value for the selected input signal (i.e. a value which enables an acceptable peak detection as illustrated on the interface)
5 GTEL, 20122013
Page 26
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
Figure 19: Type of input data,age, sex ,height and local statistics window size
For instance, for
we have an acceptable peak and trough detection.
Figure 20 : Example of peak and trough detection for k = 3 (ordinary and forced breath)
For
the peaks and troughs detected are not satisfactory.
5 GTEL, 20122013
Page 27
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
Figure 21 : Example of peak detection for k = 10  Not satisfactory, since several peaks detected at a single point
For this other signal (in the ordinary breath mode),
gives the best results.
Figure 22 : Example of peak and trough detection for k = 5 (ordinary breath only)
In the ordinary breath mode, three parameters (TV, FRC and Respiratory rate) are evaluated, once the button:
is clicked.
Figure 23 : Calculation of respiratory rate, tidal volume and functional residual capacity (in ordinary breath mode)
In the “ordinary and forced breath mode”, with an appropriate signal of course, in addition to the above three parameters, the FlowVolume curve, nominal and derived values of FVC, FEV1 and PEF are evaluated as well as a classification of the subject‟s condition is given. In the example below, the subject is normal.
5 GTEL, 20122013
Page 28
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
Figure 24 : Output for the analysis of a signal in the "ordinary and forced breath mode"
A PDF report can be generated at this point.
5 GTEL, 20122013
Page 29
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
Figure 25 : Generating a PDF report
By clicking the “View Report” menu item, we can view this report.
Figure 26 : Viewing the report
Figure 27 : The "About" menu item
5 GTEL, 20122013
Page 30
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
4. ANALYSIS AND DISCUSSIONS
The work done in this project is an important part of the design of computerbased spirometers (comprising hardware and corresponding computer software for the analysis of data collected). The algorithms applied in the data processing are used worldwide and are known to be efficient. Nowadays manufacturers of computerbased spirometry systems sell their hardware accompanied by the corresponding software for data analysis, which cannot be used for just any type of hardware. They also provide the necessary connectors between the hardware and computer (usually USB communication).
This work is thus that fragment of the system, which is data processing on a computer, and requires conveniently formatted data for analysis. The data file should be accompanied by a header file containing information like the gain, the units of the samples, the sampling frequency, the duration of the record, etc… In this project, the input data was provided by a *.mat file (containing the values of the samples) accompanied by a header *.info file (containing information necessary for the interpretation of the samples). The following is an example of a header file:
Source: MATSON 5GTEL Start: [00:00:10.000] val has 1 row (signal) and 16001 columns (samples/signal) Duration: 1:04 Sampling frequency: 250 Hz Sampling interval: 0.004 sec
Row Signal Gain 
Base 
Units 

1 RESP 
1 
0 
Liters 
To convert from raw units to the physical units shown above, subtract 'base' and divide by 'gain'.
Useful output data can be rendered by our program, provided that the input data is correctly recorded and the header file correctly filled.
5 GTEL, 20122013
Page 31
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
5. CONCLUSIONS ET PERSPECTIVES
Our objective in this project was to provide a cheap and fast way of analyzing a subject‟s respiratory pattern, through a method requiring little experience and qualification. Our user interface had to take as input a subject‟s respiratory data file, age, height and sex. The results provided by our program can be appreciated by a specialist and necessary medical attention given to the subject, based on the results.
First and foremost, the input data was filtered, then the maxima and minima detected. The method used for detecting peaks and troughs on the respiratory curve uses a local statistics window for each sample, of size, , where can be entered by the user and modified until the peaks and troughs displayed on the curve appear to be satisfactory.
Upon classification of the obtained maxima and minima, useful parameters can then be evaluated, in order to perform the classification of a subject‟s condition under “normal”, obstructive disease”, “restrictive disease” or “both restrictive and obstructive disease”.
With our designed interface, it is possible to analyze data for “ordinary breath only” or “both ordinary and forced breath”.
The program could not be sufficiently tested due to the lack of real respiratory data files obtained from persons with different respiratory diseases or conditions.
Due to the absence of respiratory data files, a test signal was generated in MATLAB and recorded in a *.mat file, in order to test our program.
%% MATLAB CODE FOR THE GENERATION OF A TEST SIGNAL
x 
= [0:13, 20, 25:45, 52, 57:64]; 
y 
= [3, 2.5, 3, 3.5, 3, 2.5, 3, 3.5, 3, 2.5, 3, 3.5, 3, 2, 6, 2, 3, 3.5, 
3, 
2.5, 3, 3.5, 3, 2.5, 3, 3.5, 3, 2.5, 3, 3.5, 3, 2.5, 3, 3.5, 3, 2, 6, 
2, 
3, 3.5, 3, 2.5, 3, 3.5, 3]; 
xx 
= 0:1/250:64; 
val = spline(x,y,xx); plot(x,y,'o',xx,val) save('testsignal.mat', 'val', 'mat')
Further studies may enable us to refine our parameters, by testing our program with real data collected from real subjects.
In fact, programs designed for the analysis of the breathing pattern are most often hardwarespecific and the conditions under which the data should be collected are clearly specified otherwise the data are said to be nonacceptable.
5 GTEL, 20122013
Page 32
ANALYSIS OF THE BREATHING PATTERN FOR THE DETECTION AND CLASSIFICATION OF CHRONIC DISEASES
6.
REFERENCES
[1] Farah MadhaniLovely, MD Pulmonologist/Intensivist, WhydoSpirometry.ppt, Oct. 24 ^{t}^{h} 2007;
[2] Renzetti AD Jr. Standardization of spirometry. Am Rev Respir Dis 1979; 119: 831–838;
[3] American Thoracic Society. Standardization of spirometry: 1987 update. Am Rev Respir Dis 1987;
136:
[4] Ferrer M, Alonso J, Morera J, et al. Chronic obstructive pulmonary disease and health related quality of life. Ann Int Med 1997; 127: 1072–1079.
[5] Friedman M, Serby C, Menjoge S, Wilson J, Hilleman D, Witek T. Pharmacoeconomic evaluation of a combination of ipratropium plus albuterol compared with ipratropium alone and albuterol alone in COPD. Chest 1999; 115: 635–641.
[6] P. Quanjer, J. Tammeling, J. Cotes, “Long volumes and forced ventilatory flows: report of working party, standardization of lung function tests”, Eur. Respir. Journal, vol. 6, 1993, pp. 5
40. 

[7] 
P. 
Quanjer, 
M. 
Lebowitz, 
I. 
Gregg, 
“Peak 
expiratory 
flow: conclusions 
and 

recommendations of 
a 
Working Party 
of the European 
Respiratory 
Society. 
Official 
ERS 
Statement”, Eur. Respir. J., vol. 10, 1997, pp. 28.
5 GTEL, 20122013
Page 33
Mult mai mult decât documente.
Descoperiți tot ce are Scribd de oferit, inclusiv cărți și cărți audio de la editori majori.
Anulați oricând.