EKG Sampling Script John Thornton Brian Walden What
EKG Sampling Script John Thornton Brian Walden
What does it do? l l 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 Sample Script Template test 1 sec 150 hz 100 chan 0 -14 write test 1 a. txt ; Template test 2 sec 30 hz 200 chan 15 -29 write test 2 a. txt ; Template test 3 min 1 hz 50 chan 0 -29 write test 3 a. txt ; Run test 1 ; Run test 2 ; Run test 1 min 2 write test 1 b. txt ; Run test 2 min 1 write test 2 b. txt ; Run test 1 sec 90 write test 1 c. txt ; Run test 2 sec 90 write test 2 c txt ; Run test 3 hz 100 chan 0 -14 append test 3 a. txt ; Run test 3 sec 45 hz 150 chan 0 -14 append test 3 a. txt ;
Scripting Language Making a Template <name> min||sec <time#> hz||per. Min <frequency#> chan <list of channels> i*[ write||append <file name> ] ; i is an element of {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} <name> and <file name> are strings of characters <time#> and <frequency#> are integers <list of channels> is a list of ints separated by , or – ex: 3, 8, 11 -17, 21 -15, 29
Scripting Language Running a Sample Run <name> j*[ min||sec <time#> ] j*[ hz||per. Min frequency# ] j*[ chan <list of channels> ] (i. Uj)*[ write||append <file name> ] ; i is an element of {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} j is an element of {0, 1} (i. Uj) is an element of {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
Program Flow Chart Sample Reader Sample Container Sample runner Post Processor Temp Output Files Final Output Files
Technical Challenges l l l 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 l l l 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 l Improvements – – l 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
- Slides: 9