Classification Algorithm

Preliminary algorithm, as of 03/25/2026.

% Cough Comm Classification
clc;
clear;
close all;
% initialize cough counts
severecough = 0;
moderatecough = 0;
mildcough = 0;
% thresholds for the coughs
abd_thresh1 = 12;
chest_thresh1 = 12;
abd_thresh2 = 20;
chest_thresh2 = 20;
tilt_thresh = 20;
mic_thresh = 50;
% read data from file – will change
% [chest abd tilt mic] – in order

data = [25 15 0 0]; % dummy data for now
% place to hold categorized data
% [cough/noncough coughtype wet/dry]

categories = zeros(size(data,1),3);
% classification algorithm
for i = 1:size(data,1)
   if data(i,1) > chest_thresh2 & data(i,2) > abd_thresh2
       severecough = severecough + 1;
       % mark as cough
       categories(i,1) = 1;
       % 3 = severe
       categories(i,2) = 3;
       if data(i,3) > mic_thresh
           % 1 = wet cough
           categories(i,3) = 1;
       end
   elseif data(i,1) > chest_thresh1 & data(i,2) > abd_thresh1
       moderatecough = moderatecough + 1;
       % mark as cough
       categories(i,1) = 1;
       % 2 = moderate
       categories(i,2) = 2;
   else
       % 0 = noncough
       categories(i,1) = 0;
   end
end
coughcount = mildcough + moderatecough + severecough;