## 1 Introduction  
By shining light with specific wavelengths in the near-infrared range (approx. 650-950 nm) into tissue and measuring the diffusely back-reflected light, near-infrared spectroscopy (NIRS) is able to determine concentration changes of oxy- and deoxyhemoglobin ([O2 Hb], [HHb]), which are related to changes in tissue hemodynamics and oxygenation [1; 2; 3; 4]. For example, brain activity has been assessed using NIRS in adults [3; 5; 6; 7; 8; 9; 10; 11], infants and neonates [12; 13; 14; 15], or animals [16; 17; 18]. During long-lasting NIRS recordings in particular, for example during sleep [19; 20; 21; 22; 23; 24; 25], artifacts in the NIRS data due to movements of the subjects are a common problem.  
Several NIRS signal-processing methods have been developed so far to detect and remove movement artifacts (MAs). In general, these methods can be classified into (i) univariate methods, (ii) multivariate methods of type 1, and (iii) multivariate methods of type 2 [2].  
Univariate methods rely only on the NIRS signal itself. These methods remove MAs by examining the characteristics of the signal [26; 27; 28; 29; 30; 31; 32; 33]. One of these methods was developed by our group, the \"movement artifact reduction algorithm\" (MARA) [34]. It utilizes the moving standard deviation (MSD) to detect the MAs and subsequently remove them by spline interpolation. MARA has been successfully applied in several NIRS studies so far [5; 6; 7; 8; 9; 12; 13; 16; 35; 36; 37; 38; 39]. Its performance was recently evaluated positively in a study comparing different MA correction techniques for NIRS [40]. However, the limitations of MARA were highlighted in a comparison of five different MA reduction algorithms [41]. MARA uses a global threshold value, and two other parameters have to be selected manually. Due to the global threshold (_i.e._, a threshold value that is fixed for the entire time series) an adaption to changes in signal quality or conditions is not possible.  
Multivariate methods of type 1 rely on multiple NIRS signals, commonly acquired at different source-detector distances. Examples are the spatially resolved spectroscopy approach [42; 43], the self-calibrating algorithm [44], or a variety of other approaches [45; 46; 47; 48; 49; 50; 51; 52; 53; 54; 55; 56; 57; 58; 59; 60; 61; 62]. Type 1 methods were in general developed to remove the influence of the superficial layer (skin and skull) from the measured signals but help also to reduce MAs, as demonstrated recently by [PERSON] _et al._[11].  
Multivariate methods of type 2 rely on external signals in addition to the NIRS signal. Two methods have been published so far that used signals from acceleration sensors for MA removal [27; 63]. The method presented by [PERSON] _et al._[27] is based on a linear least square adaptive filter with an acceleration signal as a reference input signal. [PERSON] _et al._[63] published a method (\"accelerometer-based motion artifact removal\", ABAMAR) where the acceleration changes (_i.e._, movements) were detected based on a threshold. MAs were defined only on changes in acceleration. In addition, baseline shifts were corrected by subtracting the difference between the signal mean of a window of 15 s before and after the MA. But the baseline was only corrected if the difference exceeded 2.6 \(\times\) the standard deviation (SD) of the signal of the 15 s window preceding the MA. Although the method improved the signal quality of real NIRS signals considerably, a drawback is the applied global threshold.  
The aims of the present paper are (i) to present a newly developed method for MA detection and removal, termed \"acceleration-based movement artifact reduction algorithm\" (AMARA), which combines the advantages of ABAMAR and MARA, in particular by introducing an adaptive threshold and extensions in the reconstruction of the filtered signal to obtain stable long-term recordings; and (ii) to validate AMARA with long-term recordings of NIRS data.