Real-time brain oscillation detection and phase-locked stimulation using autoregressive spectral estimation and time-series forward prediction