## 1 Introduction  
Functional near-infrared spectroscopy (fNIRS) is an effective non-invasive neuroimaging technique that measures hemoglobin concentration changes as an indicator of activity in the cerebral cortex [1]. Those changes are due to the relative changes of oxygenated and deoxygenated hemoglobin (\(\Delta\)Oxy-Hb and \(\Delta\)Deoxy-Hb, respectively). The advantages of fNIRS include low cost, portability, safety, and fewer constraints for participants, which facilitates its application to a wide variety of fields such as neuro-rehabilitation and brain computer interfaces [2; 3; 4; 5; 6]. In such applications, real-time signal processing is necessary to simultaneously monitor true brain activation and exclude any negative effects of artifacts in order to give effective feedback stimuli or to control some devices.  
However, scalp blood flow (SBF), which exists on the near-infrared light signal path, contaminates task-related cerebral blood flow (CBF). Activation of the autonomic nervous system, which is easily affected by experimental tasks, leads to physiological changes (i.e., cardiac, respiratory, Mayer waves and low frequency) that affect the task-related evocation of SBF as a specific global artifact of fNIRS (scalp-hemodynamics artifact). Even though this negative-effect artifact shows task-related changes, it does not reflect brain activation [7; 8; 9; 10]. Furthermore, it is distributed over the whole head, thus masking true cerebral activity (for review, [1]). Because SBF has similar temporal profiles and is highly correlated with CBF, it is difficult to remove this effect with conventional methods such as filtering and block averaging. Therefore, the reduction of SBF global interference from fNIRS signals remains as a challenging task.  
To prevent this effect, previous studies have employed shorter-distance channels to only measure the temporal pattern of SBF [11; 12; 13]. Particularly, [PERSON] et al. proposed ShortPCA GLM (expressed as off-line ShortPCA GLM in this paper) to solve the problem with a few 15-mm wide multi-short channels [14]. They extracted a global temporal pattern of SBF from short-channels, which can be explained by the first principal component of principal component analysis (PCA), and removed SBF signals from long-channels using a general linear model (GLM). Even though their method did not need the same number of short-channels as long-channels, it performed better at rejecting the global SBF artifact with long-distance channels, which were possibly contaminated with SBF when compared with conventional techniques. However, their method is still impeded by an off-line restriction.  
Because the aims of real-time signal processing of fNIRS-based applications are to estimate true brain activation and reduce artifacts from raw signals, we proposed a real-time ShortPCA GLM (rt-ShortPCA GLM) with sliding-window analysis (SWA), which is sometimes used for parameter dynamics estimation in functional magnetic resonance imaging (fMRI) [15; 16] and fNIRS analysis [5] or removing motion artifact from fNIRS signals [17]. This simple technique may retain the advantages of off-line ShortPCA GLM, i.e., simplicity and low physical constraint. For the performance assessment, we executed a semi-real simulation with artificial fNIRS signals constructed with a mathematical model of CBF, measured real SBF and white noise, and then compared it with conventional GLM methods and off-line. We also investigated the effect of sliding-window length on estimation accuracy.