Abstract: fNIRS may be used in real time or near-real time to detect the mental state of individuals. Phase measurement can be applied to drive an adaptive filter for the removal of motion artifacts in real time or near-real time. In this manner, the application of fNIRS may be extended to practical non-laboratory environments. For example, the mental state of an operator of a vehicle may be monitored, and alerts may be issued and/or an autopilot may be engaged when the mental state of the operator ind…