 Deep brain stimulation, DBS, is a promising therapeutic approach for treating various neurological diseases. To increase its effectiveness, researchers are developing closed-loop adaptive DBS systems that can sense biomarkers associated with certain symptoms and adjust DBS parameters accordingly. However, these systems face challenges due to the presence of stimulation artifacts caused by the device itself. Our proposed algorithm is designed to remove these artifacts in real time, allowing for more accurate detection of biomarkers and improved DBS performance. This article was authored by Paula Chen, Taewoo Kim, Evan Dastin Van Rijn and others.