EKG Sampling Script John Thornton Brian Walden
What 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
Scripting Language Template test1 sec 150 hz 100 chan 0-14 write test1a.txt ; Template test2 sec 30 hz 200 chan 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 ; Sample Script
Scripting Language Template min||sec hz||perMin chan i*[ write||append ] ; i is an element of {1,2,3,4,5,6,7,8,9,10} and are strings of characters and are integers is a list of ints separated by, or – ex: 3,8,11-17,21-15,29 Making a Template
Scripting Language Run j*[ min||sec ] j*[ hz||perMin frequency# ] j*[ chan ] (iUj)*[ write||append ] ; 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} Running a Sample
Program Flow Chart Post Processor Sample runner Sample Container Sample Reader Temp Output Files Final Output Files
Technical 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 that’s easy to use Developing in a fairly limited environment Understanding poorly documented code when the programmer is unavailable
What We Learned Smart data structures make integrating different parts of the program easy Working with non-professional code is hard Keeping documentation really helps
Future Improvements/Bugs Improvements – Allowing for the user to administer a stimulus – Additional post processing capabilities Bugs – Right now you can’t insert the frequency in samples per minute – Improve script reader so that errors don’t cascade