top of page

Our Results

Algorithm 
        &

Graphs

raw_data.png
freq_domain.png

1 / Data Analysis Using Fourier Transform

Fourier transform decomposes a waveform signal into combinations of various frequencies. In other words, it can convert a signal between the time and frequency domain. We use fft() MATLAB function to take the fast Fourier transform of the time-domain user data, and use fftshift() to rearrange the data such that the zero-frequency component is at the center of the vector the fft outputs. 

 

A vector representing the frequency domain is created of the data’s sampling size using the data’s signaling frequency so that a plot of magnitude of each frequency can be produced. From here, we extract the ‘dominant’, non-zero frequency and return it along with the corresponding ‘dominant’ amplitude and an acceleration offset which is the amplitude of the 0Hz frequency in the signal.

2 / Scoring

SCORING FREQUENCY ACCURACY 

According to the American Heart Association, the optimal frequency at which one should perform CPR is between 100-120 bpm. Should the user’s detected bpm be in that range, they are given a score of 100. However, having a performed bpm above or below that range will cause the algorithm to inform the user they were performing too fast or slow, respectively. The score for someone who is performing at an non ideal bpm is determined by how far off their bpm was from the minimum or maximum ideal threshold. 

 

SCORING PERFORMANCE CONSISTENCY

The method we used to check for a user’s consistency in CPR starts by splicing the data into 5 second-long sections. Starting from the beginning of the data, we shift the “window” of data we analyze such that there is an overlap of data from the previous section. By taking the Fourier transform of each data section, we can compare each section’s main frequency and amplitude using the standard deviation MATLAB function (std()).

If the user’s performance frequency was consistent throughout, a message on the user interface will indicate that the consistency was good. If not, the total score is being multiplied by a coefficient less than 1.

​

SCORING PERFORMANCE DEPTH

The depth of a user’s compression is scored based off of how close it is to the ideal depth one should compress to when performing CPR. The ideal depth should be between 1-2 in. By taking the amplitude that the fft function outputs, we shift the values slightly using the offset amplitude value to get an approximation of the actual acceleration of the CPR. Then, using the kinematic formula for displacement, Δx = v0(t) + at^2 (where v0 is 0 in our case), we calculate the change in position and compare it to the ideal depth to give feedback to the user on their depth.

​

--

​

UI in MATLAB

Here are screenshots of our Matlab user interface. In the interface, we display the user's speed, consistency, depth, and overall score based on standards set by Red Cross. 

Screenshot (36)_edited.jpg

Should the user underperform their CPR by Red Cross standards, an option to play and listen to the song "Stayin' Alive' by the band Bee Gees will appear to aid them. 

Screenshot (37)_edited.jpg

Future 
Goal

01 Real Time Feedback

Currently CPRactice does not support real-time feedback. In the future, live data analysis can be added as a feature to help people know if they are too fast or too slow while practicing.

02 Phone Holder

When collecting data, we attached the phone on the back of the rescuer's hand. In the future we could design a proper phone holder that does not hinder the CPR performance and also keep the phone more stable to reduce noise in the data.

bottom of page