Background With the continuous development of computer technology,online experimental methods based on the Internet have become increasingly popular in brain science.Some libraries such as js Psych and lab.js have been developed and applied to experimental design.Among them,js Psych uses a timeline-based experimental design approach and provides feature-rich plugins,and the temporal accuracy can reach 4ms.In our previous research,we found that r AF(request Animation Frame)technology can achieve sub-millisecond temporal accuracy in the browser.Currently,some experimental function libraries are gradually adopting similar methods for library design.However,there is still a lack of high-quality brain science experimental function libraries available for use in China.At the same time,the stimulus-response experimental paradigm is often used in brain research.By presenting sensory stimuli(such as visual or auditory stimuli)to induce brain wave changes or having subjects respond to stimuli,and collecting the subject’s electrophysiological signals or response-related data through response collection devices to explore relevant brain functions.However,the synchronization problem between the display input lag,experimental instruments,and computers will affect the collection accuracy of such experiments.For example,when a visual stimulus is presented on a computer,the response collection device is often connected to the computer host and receives a trigger signal generated by the computer.However,since the time when the visual stimulus actually appears on the monitor and can be observed by the subject is affected by factors such as interface type and computer type,it is not synchronized with the time when the response collection device receives the trigger signal.Objective To develop a high-precision brain science experimental system,which includes a high-precision online experimental function library and a high-precision collection device,to improve the accuracy of brain science experiments from the aspects of stimulus presentation temporal accuracy and experimental data collection accuracy,and to eliminate the dependence of traditional collection devices on serial ports,so that traditional hardware devices can be applied to online experiments.1.Develop a brain science experimental function library based on r AF technology,which allows experimenters to design high-performance brain science experiments in a simpler way.2.Develop a brain science experimental synchronizer,which can synchronize the actual stimuli perceived by the subject to the response collection device,reduce the measurement error caused by input lag,ensure time synchronization between various devices,and replace the traditional method of directly connecting the response collection device to the computer serial port,enabling traditional collection devices to be applied to online experiments.Methods 1.Using Java Script’s superset Type Script language,Canvas drawing technology,and Rollup packer,along with excellent external plugins such as Sweet Alert2 to develop a brain science experimental function library that can be applied to online experiments.Reduce the difficulty of brain science experiments design by encapsulating interactive components,static graphics,animation functions,high-precision timers,and data export methods.At the same time,by optimizing file size and supporting ESM,IIFE two ways of exporting,it is more convenient for users to use in different development modes.2.Using a phototransistor and an electret condenser microphone to synchronize the visual and auditory stimulation signals and converted them to TTL and RS232 levels,and send the synchronized signals to the response acquisition device to reduce time errors caused by input lag.As the intensity of the light and sound signals varies in different environments,the synchronization device’s acquisition threshold also changes accordingly.Therefore,the system provides an automatic threshold confirmation algorithm to facilitate the synchronization device in automatically confirming the threshold in different environments.Results 1.Design flashing stimulus of black and white blocks with a period of 16 frames with the function library and the timing precision was measured and analyzed using a photoelectric transistor and a logic analyzer,with a total of 11,200 measurements taken.The t-test showed that the 95% confidence interval for the period was between 266.8ms and 266.9ms,with a frame loss rate of 0.02%.2.A Stroop experiment was designed using the brain science experiment function library,which includes the complete process of experimental design,online experimentation,and experimental data collection and export.3.The time delay between the actual appearance of the stimulus signal on the display and the serial port signal generated by the host computer was measured,resulting in an input lag time of 4.1 ms.The mean time differences between the TTL signal rising and falling edges,the RS232 level,and the actual appearance of the stimulus signal on the display were all approximately 0.2ms.4.The synchronization device was applied to the actual brain electroencephalography(EEG)measurement,and the EEG acquisition device was directly connected to the synchronization device instead of the computer serial port.After preprocessing and baseline correction,time-frequency analysis revealed that both the experimental group and the control group appeared ERS(Event-Related Synchronization)phenomena around 0.2s,with the experimental group experiencing ERS at 164 ms and the control group experiencing ERS at 198 ms.5.Automatic dual threshold was measured in different environments,and the threshold fluctuation was minimal across different environments.The range of 95% confidence interval for both high and low thresholds was less than 0.01 v.Conclusion This study developed a high-precision brain science experimental system,consisting of two parts: an online experiment function library with high time-series accuracy and a high-precision acquisition device.The online experiment function library,based on r AF technology,provides researchers with a simpler way to design highperformance brain science experiments through the encapsulation of interactive components,static graphics,animation functions,high-precision timers,and data export methods.Additionally,a synchronization device based on audio-visual stimuli was developed to synchronize actual stimuli perceived by the subject to the response acquisition equipment,reducing measurement errors caused by input lag,and replacing the traditional method of directly connecting the response acquisition equipment to the computer’s serial port,making traditional acquisition equipment applicable to online experiments.This study improved the accuracy of brain science experiments from both software and hardware perspectives,and has significant application and promotion value. |