Figure 1. Quantification of the real-time phase detection algorithm performance.
(A) LFP signal recorded from the hippocampus is amplified and processed in Real-Time eXperimental Interface (RTXI) (https://github.com/ndlBU/phase_specific_stim). The signal is first filtered using an FIR filter in the theta range (4–12 Hz) and then a real-time phase detection algorithm predicts the next extrema. At the predicted time, a TTL pulse is sent to the laser which delivers light through fiber optics to the dentate gyrus (DG) region of the hippocampus to activate tagged neurons. (B) Sample stimulation shows the superior performance of the predictive algorithm in comparison to the 6 Hz periodic stimulation. (C) (Ci) Normalized polar histogram shows the phases of stimulation in the cases of peak, trough, and periodic 20 Hz and 6 Hz stimulation. Dotted lines indicate the accepted peak (pink) and trough (blue) stimulation phase (within quarter cycle). Note that 20 Hz stimulation overlaps completely with 6 Hz stimulation because both are fixed frequencies. (Cii) Confusion matrices indicate that peak and trough stimulation are specific to the desired phase of the stimulation. Stimulations are considered true if they take place within –π/4 to π/4 of the desired phase. The false entry for the No Stim case represents the true negative rate (TNR) or specificity. The true entry for the Stim case represents the true positive rate (TPR) or sensitivity.


