A system including a mask to detect an EEG signal and to deliver a gas, the mask having a forehead support extending from the body and adapted to contact a forehead surface of the patient during use, the forehead support having a plurality of sensors located thereon for detecting electrophysiological signals of the patient, with the plurality of sensors including EEG sensors positioned proximate to FP1/FP2 standard electrode placement positions of the patient, a gas delivery device in fluid communication with the mask and having an adjustable gas output, and a control system for determining a sleep stage from EEG signals detected by the mask and adjusting a gas delivery device based on the sleep stage.