What MNE method to use to process data for biofeedback game

Hi,

I was wondering which MNE method would be most suitable to calculate the alpha band power from an EEG signal in real time and use it as an input to a biofeedback game. Iā€™d want to use a 500 ms or 1000 ms window for the FFT calculation and update the game display every 500 ms based on the alpha band power value that is calculated. I keep coming across recommendations to use a ā€˜short termā€™ or ā€˜short timeā€™ FFT, but descriptions of this method suggest that is not suitable for processing data in real time, and the parameters of the MNE ā€˜time_frequency.stftā€™ method also seem to suggest this. As far as I can tell, the STFT is designed to generate a single spectrogram (plotting power x frequency x time) over an extended sampling period comprising many windows, rather than reporting a power value for each window as the data for that window are captured in real time. The MNE ā€˜time_frequency.stftā€™ method takes an ā€˜n_timesā€™ parameter that seems to refer to the number of samples in a data set larger than the FFT window, suggesting that it is also not intended for real time data processing. Moreover, the STFT seems to automatically select an array of small frequency bins, rather than allowing me to specify the alpha band. The most suitable MNE method Iā€™ve been able to find so far is ā€˜Epochs.compute_psdā€™, as this allows me to specify a frequency band. It ties me into using Welchā€™s method (or multitaper), which in principle is fine as some averaging across windows will reduce the variability of the power values, but there doesnā€™t seem to be much scope for averaging across windows, since the minimum recommended window for alpha is 250 ms and I need to report values every 500 ms. As you can see, Iā€™m not sure where to go with this and any advice would be welcome.

Many thanks,
Richard