Professional Documents
Culture Documents
ADITYA
ADITYA
Bachelor of Technology
in
by
October, 2022
DepartmentofComputerScienceandEngineering
National Institute of Technology Rourkela
Supervisor’s Certificate
This is to certify that the work presented in the project report entitled Design
Cardiac Pacemaker submitted by N. ADITYA CHAND BEHERA, Roll
Number 119CS0110, is a record of original research carried out by him under
my supervision and guidance in partial fulfillment of the requirements of the
degree of Bachelor of Technology in Computer Science and Engineering.
Neither this project report nor any part of it has been submitted earlier for any
degree or diploma to any institute or university in India or abroad.
Introduction
Pacemaker monitors rate of heart and rhythm If heart does not beat
or beats too slowly, pacemaker provides electrical stimulation.
Pacemakers are classified depending on number of heart chambers
monitored and stimulated. Two types are- Single-chamber and dual-
chamber pacemakers. Dual-chamber pacemaker performs better
than single-chamber pacemaker, in terms of atria fibrillation,
pacemaker syndrome and heart failure. But at the cost of higher
energy consumption. Dual-chamber pacemakers require frequent
battery change. Surgeries are neither easy nor safe as well as
expensive.
Literature Review
Else
i. If AVI expired is true
a) Pace Ventricle
b) Repeat step 1.ii
Else
Repeat step 1.ii
Else
i. If VAI expired is true
a. Pace Atrium
b. Repeat step 1
Else
Repeat step 1
Chapter 3 Proposed Algorithm
3.1 IMPLEMENTATION
• FIRST.c
#include "pacemaker.h"
int main(int argc, char *argv[])
{
FILE *fp = fopen("cardiac_signal_trace.txt", "r");
unsigned int c=0,pace_atrium_counter=0,pace_ventricle_counter=0;
while (c<max_cycles)
{
wait_PVARP();
switch(sense_atrium(fp))//sense atrium
{
case 0: pace_atrium(); // pacing atrium if atrium not sensed
pace_atrium_counter++;
break;
case 1: // no pacing atrium if atrium sensed
break;
case 2: printf("EOF reached.\n");// Stop if EOF reached
c=max_cycles;
}
switch(sense_ventricle(fp))//sense ventricle
{
case 0: pace_ventricle(); // pacing ventricle if ventricle not sensed
pace_ventricle_counter++;
break;
case 1: // no pacing ventricle if ventricle sensed
break;
case 2: printf("EOF reached.\n");// Stop if EOF reached
c=max_cycles;
}
if(is_change_rate())//check rate change
update_VAI();
c++;
}
fclose(fp);
return 0;
}
• SECOND.c
#include<stdio.h>
#include<stdlib.h>
#include"pacemaker.h"
int main()
{
FILE*fp=fopen("cardiac_signal_trace.txt","w");
unsigned int
c,v,p,pvarp_counter,pflag,qflag,atrial_signal,ventricle_signal,a,pace_atriu
m_counter=0,pace_ventricle_counter=0;
for(c=0;c<max_cycles;c++)
{
for(pvarp_counter=0;pvarp_counter<PVARP_length;pvarp_counter++
)
fputc('-',fp);
for(v=PVARP_length;v<=(VAI_length-p_wavelength);v++)
fputc('-',fp);
pflag=0;
for(p=0;p<p_wavelength;p++)
{
atrial_signal=rand()%100;
if((!atrial_signal)&&(!pflag))
{
fputc('P',fp);
pflag=1;
}
else
fputc('-',fp);
}
if(!pflag)
{
// printf("Pace atrium");
pace_atrium_counter++;
}
qflag=0;
for(a=0;a<AVI_length;a++)
{
ventricle_signal=rand()%100;
if((!ventricle_signal)&&(!qflag))
{
fputc('Q',fp);
qflag=1;
}
else
fputc('-',fp);
}
if(!qflag)
{
// printf("Pace ventrium");
pace_ventricle_counter++;
}
}
printf("#pace_atrium=%u
#pace_ventrium=%u",pace_atrium_counter,pace_ventricle_counter);
fclose(fp);
return 0;
}
References
[1] Journal of Pharmacology and Experimental Therapeutics November 1955, 115 (3)
283-290;
[4] Haeberlin, A. et al. The first batteryless, solar-powered cardiac pacemaker. Heart
Rhythm 12, 1317–1323
References