Title: EKG Sampling Script
1EKG Sampling Script
- John Thornton
- Brian Walden
2What does it do?
- The psych lab in the science center runs
experiments that sample the amplitude of brain
waves of subjects in the experiments - Our program utilizes pre-existing code to allow
the user to write a script which allows them to
run multiple samples consecutively on the EKG
detection device in the psych lab
3Scripting Language
Sample Script
Template test1 sec 150 hz 100 chan 0-14 write
test1a.txt Template test2 sec 30 hz 200
chan 15-29 write test2a.txt Template test3
min 1 hz 50 chan 0-29 write test3a.txt
Run test1 Run test2
Run test1 min 2 write test1b.txt
Run test2 min 1 write test2b.txt
Run test1 sec 90 write test1c.txt
Run test2 sec 90 write test2c txt Run
test3 Run test3 hz 100 chan 0-14
append test3a.txt Run test 3 sec 45 hz 150
chan 0-14 append test3a.txt
4Scripting Language
Making a Template
Template ltnamegt minsec lttimegt hzperMin
ltfrequencygt chan ltlist of channelsgt i
writeappend ltfile namegt i is an element of
1,2,3,4,5,6,7,8,9,10
ltnamegt and ltfile namegt are strings of
characters lttimegt
and ltfrequencygt are integers
ltlist of channelsgt is a
list of ints separated by , or
ex 3,8,11-17,21-15,29
5Scripting Language
Running a Sample
Run ltnamegt j minsec lttimegt j hzperMin
frequency j chan ltlist of channelsgt
(iUj) writeappend ltfile namegt
i is an element of
1,2,3,4,5,6,7,8,9,10 j is an
element of 0,1 (iUj) is an
element of 0,1,2,3,4,5,6,7,8,9,10
6Program Flow Chart
Sample Reader
Final Output Files
Post Processor
Sample Container
Temp Output Files
Sample runner
7Technical Challenges
- Making sure rate of writing output keeps up with
reading the input - Keeping the time between samples as small as
possible - Developing a powerful scripting language thats
easy to use - Developing in a fairly limited environment
- Understanding poorly documented code when the
programmer is unavailable
8What We Learned
- Smart data structures make integrating different
parts of the program easy - Working with non-professional code is hard
- Keeping documentation really helps
9Future Improvements/Bugs
- Improvements
- Allowing for the user to administer a stimulus
- Additional post processing capabilities
- Bugs
- Right now you cant insert the frequency in
samples per minute - Improve script reader so that errors dont
cascade