Optical simulation system for brain waves detection & measurements Mid-term presentation Performed...
-
date post
22-Dec-2015 -
Category
Documents
-
view
217 -
download
0
Transcript of Optical simulation system for brain waves detection & measurements Mid-term presentation Performed...
Optical simulation system Optical simulation system for brain waves detection for brain waves detection
& measurements & measurements
Mid-term presentationMid-term presentation
Performed by:Performed by: Yevgeny Yevgeny SafovichSafovich
Pilnick NadavPilnick NadavSupervised by:Supervised by: Hen Hen BroodneyBroodney
Problem DefinitionProblem Definition
Measure eye vision quality Measure eye vision quality objectivelyobjectively
The vision should be measured (almost) The vision should be measured (almost) without cooperation of the person being without cooperation of the person being examinedexamined
SolutionSolution
Use PC to transmit series of images Use PC to transmit series of images of different colors at certain of different colors at certain frequencies in front of the patient frequencies in front of the patient (as a stimulation) (as a stimulation)
Use Electronic device to measure Use Electronic device to measure brain waves caused by change of brain waves caused by change of visionvision
Conclude regarding to the patient’s Conclude regarding to the patient’s vision abilities vision abilities
RequirementsRequirements
ImagesImages 3 pairs of colors:3 pairs of colors:
Blue, YellowBlue, Yellow Green, RedGreen, Red Black, WhiteBlack, White
Each pair has its own “blank” color: the Each pair has its own “blank” color: the average of the colors in the pairaverage of the colors in the pair
Steps frequency: 0.5Hz – 10Hz, resolution 1HzSteps frequency: 0.5Hz – 10Hz, resolution 1Hz dx = The delta between the Monitor dx = The delta between the Monitor
output and the electrical pulse output. output and the electrical pulse output. 0.5ms < dx < 1.5ms0.5ms < dx < 1.5ms
DefinitionsDefinitions Screen Refresh RateScreen Refresh Rate Vertical Blank Interval (VBI)Vertical Blank Interval (VBI)
DirectDrawDirectDraw Primary SurfacePrimary Surface Front BufferFront Buffer Back BuffersBack Buffers FlipFlip
Performance counterPerformance counter
Begin
End
Solution AlgorithmSolution Algorithm
Computer
Monitor
Video Card
Human
Brain Wavesmeter
Operator
* The red interfaces should be synchronized
TimingTiming
Computer
MonitorVideoCard
HumanBrain Waves
meter
Operator
t
t1b t3 t4t2 t5
• 0.5ms < |t5 – t3| < 1.5ms
• |t4 – t3|- We suppose this time does not matter and is taken care of by the “Brain Waves meter”
• |t3 – t2|- We suppose this interval is negligible
• |t2 – t1b| - The major problem of the project, discussed below
• |t5 – t1a| - A problem discussed below
t1a
Timing: focusTiming: focus
Ta = VBI beginTa = VBI begin Tb = FlipTb = Flip Tc = Flip Critical timeTc = Flip Critical time Td = Flip EndTd = Flip End Te =t1a = Out pulse sentTe =t1a = Out pulse sent Tf = t5 = Out pulse received (~ t1d)Tf = t5 = Out pulse received (~ t1d) Tg = t2 = VBI endTg = t2 = VBI end
Ta TgTb TfTc Te
Time
Screen
FrontBuffer
Td
Feasibility TestingFeasibility Testing
Testing Screen Sync.:Testing Screen Sync.: The goal is to ensure that the new The goal is to ensure that the new
image is shown at the screen ‘at the image is shown at the screen ‘at the moment’ the Pulse is sent to the parallel moment’ the Pulse is sent to the parallel port.port.
Testing Pulse delay:Testing Pulse delay: The goal is to ensure that the time The goal is to ensure that the time
between sending the pulse and between sending the pulse and receiving (Tf – Te), is negligible receiving (Tf – Te), is negligible Roundtrip delay
testing
Synchronization SolutionSynchronization Solution Build two Surfaces in DirectDrawBuild two Surfaces in DirectDraw
Front (Primary Surface)Front (Primary Surface) Back (Attached Surface)Back (Attached Surface)
Use windows priority mechanism to give Use windows priority mechanism to give maximum priority to the process (Real-Time) maximum priority to the process (Real-Time) and worker thread (Critical)and worker thread (Critical)
Use DirectDraw to determine VBI begin(t1b)Use DirectDraw to determine VBI begin(t1b) Use DirectDraw to Flip the SurfacesUse DirectDraw to Flip the Surfaces Use Parallel port in order to send output Use Parallel port in order to send output
PulsePulse Use performance counter to ensure we did Use performance counter to ensure we did
not miss the Flip critical time (t1f)not miss the Flip critical time (t1f)
Project Blocks DiagramProject Blocks Diagram
Parallel port InterfaceVideo
Interface
Run-time Module
Parallel port Wrapper (DLPortIO)
VideoInterface Wrapper
(DirectDraw)
DatabaseModule
Configuration module
Main applicationModule
StatisticsStatistics
Min Max Min Max Min Max Min Max Min Max6.15E-05 0.003998 1.84E-05 2.46E-05 3.63E-05 3.63E-05 0.00506 0.005082 0.105072 0.1050940.000389 0.004321 1.9E-05 2.32E-05 3.66E-05 3.66E-05 0.00505 0.005069 0.105062 0.1050830.00276 0.00669 1.79E-05 2.51E-05 3.58E-05 3.58E-05 0.005062 0.005081 0.105075 0.105094
0.002691 0.006626 1.9E-05 2.4E-05 3.63E-05 3.63E-05 0.00506 0.005083 0.105072 0.105095
Pulse EndVBI Start Flip End VBI End Pulse Start
The next run assumed pulse delay is 5 ms.The next run assumed pulse delay is 5 ms.The application collects maximum and The application collects maximum and minimum timesminimum times
Implicitly neglected the time it takes for the pulse to Implicitly neglected the time it takes for the pulse to be received (Tf-Te). Experiments showed Maximum be received (Tf-Te). Experiments showed Maximum time of ~0.04 ms time of ~0.04 ms RoundTripRoundTrip. .
Conclusions:Conclusions: We did not miss a single sync.We did not miss a single sync. Most Extreme results show 32.7 microsecond Most Extreme results show 32.7 microsecond
difference (~5.05 ms , ~5.08 ms). Way below difference (~5.05 ms , ~5.08 ms). Way below requirementsrequirements
Application screensApplication screens Menu optionsMenu options
Colors pairsColors pairs
Element type Element type
Page layoutPage layout