Neural oscillations enable communication between brain regions. Closed-loop brain stimulation attempts to modify this activity by stimulation locked to the phase of concurrent neural oscillations. If successful, this may be a major step forward for clinical brain stimulation therapies. The challenge for effective phase-locked systems is accurately calculating the phase of a source oscillation in real time. The basic operations of filtering the source signal to a frequency band of interest and extracting its phase cannot be performed in real time without distortion. We present a method for continuously estimating phase that reduces this distortion by using an autoregressive model to predict the future of a filtered signal before passing it though the Hilbert transform. This method outperforms published approaches on real data and is available as a reusable open-source module. We also examine the challenge of compensating for the filter phase response and outline promising directions of future study.