1. Introduction
Neuronal signals are inherently noisy due to a variety of intrinsic and extrinsic factors. This largely unpredictable noise introduces uncertainty into the parameters that characterize neuronal signals [1]. The noisy nature of brain recordings is evident across different levels, from single-cell recordings, which can show spontaneous fluctuations, to system-level recordings such as electroencephalograms (EEG), which aggregate the activity of millions of neurons [2], [3]. The types of noise affecting these different signals vary, necessitating different processing techniques depending on the specific type of brain signal being analyzed [2], [3]. Signal processing is, therefore, an integral part of neuroscience studies. Due to high levels of noise in experiments, they are often repeated across many trials to mitigate noise effects [4]. Therefore, careful attention is needed to balance noise suppression with signal distortion [5]. For instance, in EEG studies, the choice of smoothing methods significantly affects the accuracy of signal classification and medical diagnoses [6], [7]. Additionally, noise can contaminate both intracellular and extracellular neuronal recordings, further complicating data analysis and interpretation [4].
Action potential (AP) is the fundamental unit of neuronal communication. Different neuron types exhibit distinctive AP shape features, enabling classification based on these characteristics. For example, regular-spiking (RS) cortical pyramidal neurons generate larger, wider, and slower APs compared to fast-spiking (FS) cortical interneurons [8],[9],[10]. We previously found that AP parameters in RS neurons, but not FS neurons, vary significantly with stimulus type [11]. AP waveform alterations have been linked to pathological conditions, including seizures, epileptic events [12], [13], and different stages of Alzheimer's disease [14],[15],[16].
Changes in amplitude and phase are well-known effects of filters [17]. However, filtering can also influence other AP properties [17]. Many AP features are categorized by the derivative used in their calculation. AP amplitude and width are measured directly from the recorded membrane potential. In contrast, rapidity, threshold, rate of rise, and rate of fall are derived from its first, second, or third time derivatives [8], [18],[19],[20],[21], domains where noise becomes more prominent. To mitigate noise and improve feature extraction, digital filtering and smoothing techniques are commonly applied. Methods such as moving mean (MM), Gaussian filters, Savitzky–Golay (SG) filtering, and linear or quadratic regression are widely used in neuronal recordings, often with varying window sizes [22],[23],[24],[25],[26],[27].
While the effects of filtering on noisy data have been extensively studied across different fields, their specific impact on neuronal activity, particularly on AP shape parameters, remains underexplored. For instance, the SG filter has been reported to exhibit limited high-frequency noise suppression and to introduce boundary artifacts [28]. In contrast, SG filtering and, to a lesser extent, MM filtering have been shown to improve EEG signal segmentation and yield higher accuracy [29]. These combined effects of smoothing methods and window size on AP properties have not been systematically investigated, to the best of our knowledge. As initiatives to make electrophysiological datasets publicly available continue to expand, it becomes increasingly important to understand how digital signal processing influences both the data and its interpretation. Nevertheless, the impact of smoothing on intracellular recordings remains largely underexplored.
This study aims to address this gap by comparing the effects of three smoothing methods and varying window sizes on intracellular recordings from L5 visual cortex inhibitory aspiny interneurons and spiny excitatory neurons, obtained from the Allen Brain Atlas database [30]. AP waveforms were smoothed using the MM, locally weighted scatterplot smoothing (LWS), and SG methods. The results showed that AP shape parameters changed significantly, with the extent of change depending on the smoothing method and window size. Among the methods, the SG filter had the lowest impact on AP waveforms, even with the smallest window size, while providing clear traces for calculating AP parameters.
2. Subject & methods
A. The neural recordings and selection criteria
Neuronal recordings were obtained from layer 5 spiny (excitatory) and aspiny (inhibitory) neurons in the primary visual cortex (VISp) of adult mice, obtained from the Allen Brain Atlas database [30]. All analyzed aspiny neurons originated from the same transgenic line, Vip-IRES-Cre, a full description of which can be found in [31]. At the time of this study, 11 recordings from this line were available. To ensure consistency, only neurons displaying similar firing patterns, as quantified by their f-I curves, where spike frequency increases with current, were included. Thus, six neurons were included in the study.
For spiny neurons, all recordings were drawn from the Rbp4-Cre_KL100 transgenic line, which labels a subset of layer 5 excitatory projection neurons in VISp. A total of 41 recordings from this line were available in the database. However, only five neurons had been recorded at the same sampling frequency (50 kHz) as the aspiny neurons. To maintain comparability between cell classes, analyses were therefore restricted to these five spiny neurons. The specifics of these recordings are detailed in Table 1. Full experimental procedures can be found in [30], and data are available in the Allen Cell Types Database (http://celltypes.brain-map.org/data).
Table 1.
Intracellular recording information.
| N | ID | Mouse Line | Layer | Type | Hemisphere | fs (KHz) |
|---|---|---|---|---|---|---|
| 1 | 593054951 | Vip-IRES-Cre | 5 | Aspiny | Right | 50 |
| 2 | 591627904 | Vip-IRES-Cre | 5 | Aspiny | Right | 50 |
| 3 | 575919223 | Vip-IRES-Cre | 5 | Aspiny | Right | 50 |
| 4 | 568767467 | Vip-IRES-Cre | 5 | Aspiny | left | 50 |
| 5 | 562527850 | Vip-IRES-Cre | 5 | Aspiny | left | 50 |
| 6 | 523478821 | Vip-IRES-Cre | 5 | Aspiny | left | 50 |
| 7 | 569710450 | Rbp4-Cre_KL100 | 5 | Spiny | Right | 50 |
| 8 | 515524026 | Rbp4-Cre_KL100 | 5 | Spiny | Right | 50 |
| 9 | 507996688 | Rbp4-Cre_KL100 | 5 | Spiny | Right | 50 |
| 10 | 569706189 | Rbp4-Cre_KL100 | 5 | Spiny | left | 50 |
| 11 | 515249852 | Rbp4-Cre_KL100 | 5 | Spiny | left | 50 |
B. Filters
The intracellular recordings were smoothed using three methods: the MM, LWS, and the SG filter. The MM calculates the average of a specified number of data points at each dataset position, continuously adjusting the window to generate a series of averages. LWS employs locally weighted linear regression within a defined window, weighting data points to reduce outlier effects. The SG method fits a second-order quadratic polynomial to data within each window of adjacent points.
To establish a reasonable window size, we examined the sampling frequencies typically used in intracellular recording studies. Sampling frequencies usually range from 10 to 50 kHz, and in some cases, as low as 5 kHz [32],[33],[34]. However, a sampling frequency of 10 kHz or higher is generally required to capture the main features of APs [35]. Intracellular recordings are typically digitized at one data point every 0.1 ms [33]. Therefore, interpolation between raw data points is necessary for accurate quantification of some AP parameters, such as threshold and rapidity, as in previous studies [18], [36]. Therefore, the recordings were interpolated to a resolution of Δt = 1 μs using MATLAB's spline function. The spline function was previously shown to have minimal effects on rapidity and threshold and was therefore selected here [8]. Subsequently, all three smoothing techniques were applied using MATLAB 2025b's smooth data function, with five window sizes incrementing from 0 (representing the original signal) to 1000 points with a 200-point increment.
To smooth the membrane potential between at least two raw data points, a window of 200 μs is required, corresponding to a minimum sampling frequency of 10 kHz [33]. In this study, the sampling frequency for cortical neurons was 50 kHz (one data point every 20 μs), and the data were interpolated with a 1 μs resolution, so 200 data points correspond to 200 μs. Thus, we used a 200-point window as the smallest size. On the other hand, a window size of 1000 points was chosen as the upper limit, representing the other end of over-smoothing. A 1000-point window corresponds to 1 ms, which is approximately the entire AP duration of excitatory RS neurons and more than double the reported width of inhibitory FS neurons [8], [10], [21], including the neuron types analyzed in this study. Therefore, the chosen window sizes span the range from a few raw data points to more than the entire AP duration.
C. Action potential parameters quantification
The AP selection and parameters are the same as those described in a previous study [8]. In short, for each neuron, the first 50 APs evoked by step-and-hold current injections and 150 APs elicited by noisy current stimulation were pooled to compute AP parameters. For spiny neurons, one cell generated only 65 APs in response to the noisy current, and all of these were included in the analysis. For each spike, five AP parameters were computed, with AP rapidity assessed through two approaches: the inverse of the full width at half maximum (IFWd2) of the peak of the membrane potential second-time derivative [8], and the phase slope method [18].
The AP threshold is defined as the point at which the membrane potential first-time derivative exceeds 25 mV/ms. AP amplitude was determined by the difference between the peak and threshold potentials, and AP width was the full width at half amplitude. Five parameters were calculated for each spike. It should be noted that the AP rapidity refers to the rapidity calculated using the IFWd2 method throughout this paper, unless stated otherwise. The phase-slope rapidity is reported here only as a reference for readers interested in comparing these values with those from other studies, since it is the most common method for AP rapidity quantification [18].
D. Statistical analyses
Statistical analyses were performed using IBM SPSS Statistics (Version 30). The distributions of the extracted AP features were first assessed using the Shapiro – Wilk normality test. Because the data did not meet the assumption of normality, non-parametric statistical tests were used for all subsequent analyses. To evaluate the effect of filtering across the five window sizes, a Friedman χ2 test was performed separately for each smoothing method (MM, SG, and LWS) under both stimulation paradigms. When a significant main effect was detected, post hoc pairwise comparisons were conducted using the Wilcoxon signed-rank test to compare each filtered condition with the unfiltered baseline (NF). Mann – Whitney U tests were used to compare AP waveform parameters between excitatory spiny and inhibitory aspiny neurons. The z-statistics reported in the Results are derived from these tests. To control for multiple comparisons, the false discovery rate (FDR) was adjusted using the Benjamini – Hochberg procedure within each feature–filter set. Data are presented as mean ± standard deviation (SD). Statistical significance was defined as FDR-adjusted p<0.05.
3. Results
Recordings from six aspiny (inhibitory) neurons and five spiny (excitatory) neurons extracted from layer 5 of the mice's primary visual cortex were analyzed. The APs were analyzed after applying three smoothing methods and compared to the unfiltered data. The comparison was based on changes in AP shape features (amplitude, width, threshold, and rapidity). AP shape features can be categorized by the derivative used to calculate them. For example, amplitude and width are measured directly from the recorded membrane potential. In contrast, rapidity and threshold are derived from its time derivatives, with phase slope and threshold calculated from the first derivative and IFWd2 from the second. Noise is more pronounced in derivatives, causing their shapes to change more drastically after filtration. Fig. 1 illustrates the differences in membrane potential (Vm) and its first- and second-time derivatives. Therefore, comparisons of changes in AP shape in response to noisy stimulus current and step-and-hold current are presented based on this classification. Step-and-hold current is used to determine AP properties for each neuron type and to distinguish between them. In contrast, the noisy current stimulus was used here to assess whether filter-induced distortion changes in the presence of additional stimulus-driven noise.

Fig. 1.
Visualization of the membrane potential (V) and its time derivatives in response to step-and-hold current and noisy current stimulation. The first row displays the membrane potential (V), the second row shows the first-time derivative (dV/dt), and the third row shows the second-time derivative (d2V/dt2). The black trace represents the first AP in a spike train, whereas the red trace represents the last AP in the same spike train.
A. Step-and-hold stimulation
In excitatory spiny neurons, window size significantly influenced all AP waveform parameters for MM, SG, and LWS filtering (Friedman tests, p<0.05; see Table 2). Post hoc tests with FDR correction showed that MM and LWS filtering produced significant reductions in AP amplitude and rapidity measures, as well as significant increases in AP width across all tested window sizes. SG filtering produced comparatively smaller effects; however, significant differences relative to the unfiltered condition were still observed for amplitude, width, threshold, and IFWd2 rapidity across all window sizes, whereas phase slope rapidity was significantly affected at all window sizes except 600 μs.
Table 2.
Changes in AP waveform parameters after applying MM, SG, and LWS smoothing filters with different window sizes during step-and-hold stimulation.
| Filter | Window size | Amplitude (mV) | Width (ms) | Threshold (mV) | IFWd2 rapidity (ms–1) | Phase slope rapidity (ms–1) ) |
|---|---|---|---|---|---|---|
| Spiny Excitatory Neurons | ||||||
| No filter | - | 71.3 ± 5.6 | 0.75 ± 0.13 | −34.2 ± 4.5 | 9.4 ± 9.9 | 36.3 ± 14.3 |
| MM | 200 | 70.2 ± 5.6 * | 0.76 ± 0.13* | −34.4 ± 3.9* | 5.9 ± 0.7* | 22.0 ± 2.8* |
| 400 | 66.9 ± 5.7* | 0.80 ± 0.12* | −34.6 ± 3.9* | 4.8 ± 0.7* | 16.2 ± 1.9* | |
| 600 | 61.8 ± 5.9* | 0.87 ± 0.11* | −34.7 ± 3.8* | 4.8 ± 0.7* | 13.0 ± 1.7* | |
| 800 | 55.9 ± 6.2* | 0.96 ± 0.10* | −34.7 ± 3.8* | 4.8 ± 0.7* | 11.4 ± 1.7* | |
| 1000 | 49.9 ± 6.5* | 1.08 ±0.09* | −34.8 ± 3.8* | 4.8 ± 0.7* | 10.6 ± 1.7* | |
| SG | 200 | 71.5 ± 5.6* | 0.75 ± 0.13* | −34.4 ± 4.0* | 5.8 ± 0.9* | 32.2 ± 5.4* |
| 400 | 72.3 ± 5.7* | 0.75 ± 0.13* | −35.9 ± 4.0* | 6.0 ± 0.6* | 25.6 ± 5.0* | |
| 600 | 73.3 ± 6.1* | 0.76 ± 0.12* | −36.1 ± 4.2* | 4.7 ± 0.3* | 29.3 ± 7.2 | |
| 800 | 73.5 ± 6.4* | 0.79 ± 0.12* | −37.3 ± 4.2* | 4.0 ± 0.3* | 27.0 ± 4.9* | |
| 1000 | 72.2 ± 6.5* | 0.82 ± 0.11* | −38.2 ± 4.2* | 3.8 ± 1.1* | 22.4 ± 3.3* | |
| LWS | 200 | 70.8 ± 5.6* | 0.75 ± 0.13* | −34.3 ± 4.0* | 5.6 ± 0.8* | 23.7 ± 3.4* |
| 400 | 69.3 ± 5.6* | 0.77 ± 0.13* | −34.4 ± 3.9* | 5.1 ± 0.4* | 17.6 ± 1.9* | |
| 600 | 66.8 ± 5.6* | 0.80 ± 0.12* | −34.4 ± 3.9* | 4.2 ± 0.3* | 14.3 ± 1.9* | |
| 800 | 63.5 ± 5.7* | 0.83 ± 0.12* | −34.4 ± 3.8* | 3.8 ± 0.3* | 12.1 ± 1.4* | |
| 1000 | 59.8 ± 5.8* | 0.88 ± 0.11* | −34.4 ± 3.8* | 4.0 ± 1.4* | 10.3 ± 1.2* | |
| Aspiny Inhibitory Neurons | ||||||
| No filter | - | 67.8 ± 8.6 | 0.62 ± 0.15 | −37.5 ± 3.5 | 8.4 ± 8.1 | 35.6 ± 15.8 |
| MM | 200 | 66.0 ± 7.9* | 0.64 ± 0.15* | −37.6 ± 3.4* | 6.7 ± 1.7 | 19.7 ± 4.7* |
| 400 | 60.93 ± 6.3* | 0.68 ± 0.14* | −37.7 ± 3.4* | 6.0 ± 1.4* | 14.5 ± 3.6* | |
| 600 | 54.1 ± 4.8* | 0.76 ± 0.12* | −37.8 ± 3.4* | 5.9 ± 1.5* | 12.27 ± 3.1* | |
| 800 | 47.0 ± 4.0* | 0.87 ± 0.09* | −37.8 ± 3.4* | 5.9 ± 1.5* | 11.54 ± 2.9* | |
| 1000 | 40.4 ± 3.9* | 1.00 ± 0.07* | −37.9 ± 3.4* | 5.9 ± 1.5* | 11.21 ± 2.9* | |
| SG | 200 | 68.0 ± 8.7* | 0.62 ± 0.15* | −37.7 ± 3.5* | 7.1 ± 2.4 | 28.4 ± 7.7* |
| 400 | 68.7 ± 8.9* | 0.62 ± 0.15* | −38.2 ± 3.6* | 6.2 ± 1.1 | 25.8 ± 14.1* | |
| 600 | 68.8 ± 8.8* | 0.64 ± 0.14* | −39.4 ± 4.0* | 4.9 ± 0.4* | 34.0 ± 15.0 | |
| 800 | 67.4 ± 7.8* | 0.68 ± 0.13* | −40.6 ± 4.1* | 4.0 ± 0.3* | 29.5 ± 9.7* | |
| 1000 | 65.5 ± 7.5* | 0.72 ± 0.12* | −41.3 ± 3.9* | 3.6 ± 0.4* | 25.0 ± 8.2* | |
| LWS | 200 | 67.0 ± 8.3* | 0.63 ± 0.15* | −37.6 ± 3.4* | 6.0 ± 1.6* | 21.7 ± 4.5* |
| 400 | 64.6 ± 7.5* | 0.65 ± 0.14* | −37.6 ± 3.4* | 5.4 ± 1.0* | 16.3 ± 3.2* | |
| 600 | 60.9 ± 6.3* | 0.68 ± 0.14* | −37.6 ± 3.4* | 4.5 ± 0.6* | 13.6 ± 2.8* | |
| 800 | 56.6 ± 5.2* | 0.72 ± 0.13* | −37.6 ± 3.4* | 3.9 ± 0.5* | 12.0 ± 2.3* | |
| 1000 | 52.1 ± 4.4* | 0.77 ± 0.12* | −37.6 ± 3.4* | 3.4 ± 0.4* | 10.4 ± 1.8* | |
Similarly, in inhibitory aspiny neurons, window size significantly influenced all AP waveform parameters across the three smoothing methods (Friedman tests, p<0.05; see Table 2). Post hoc analysis revealed that MM and LWS filtering produced significant reductions in AP amplitude, phase slope rapidity, and AP width across all window sizes. Significant reductions in IFWd2 rapidity were observed for MM filtering at window sizes ≥ 400 μs and for LWS filtering across all window sizes. SG filtering produced comparatively smaller effects, with significant differences observed for amplitude, width, and threshold across all window sizes, whereas IFWd2 rapidity and phase slope rapidity were significantly affected primarily at larger window sizes.
B. Noise stimulation
In excitatory spiny neurons, smoothing also significantly influenced all AP waveform parameters across filtering methods and window sizes (Friedman tests, p<0.05; Table 3). MM and LWS filtering progressively reduced AP amplitude and rapidity measures while increasing AP width across most tested windows. In contrast, SG filtering preserved AP morphology more effectively, although significant deviations from the unfiltered condition were still observed for several parameters, particularly at larger window sizes. Phase slope rapidity remained unchanged at the 400 μs window following LWS filtering, whereas IFWd2 rapidity was not significantly altered at the 400 μs window following SG filtering.
Table 3.
Changes in AP waveform parameters after applying MM, SG, and LWS smoothing filters with different window sizes during noise stimulation.
| Filter | Window size | Amplitude (mV) | Width (ms) | Threshold (mV) | IFWd2 rapidity (ms–1) | Phase slope rapidity (ms–1) |
|---|---|---|---|---|---|---|
| Spiny Excitatory Neurons | ||||||
| No filter | - | 70.53 ± 6.01 | 0.76 ± 0.13 | −34.77 ± 3.08 | 8.29 ± 9.89 | 35.79 ± 15.07 |
| MM | 200 | 69.50 ± 5.99* | 0.77 ± 0.13* | −34.94 ± 3.03* | 5.45 ± 0.99 | 20.70±2.93* |
| 400 | 66.27 ± 6.10* | 0.81 ± 0.12* | −35.09 ±2.98 * | 4.58 ± 0.80* | 14.94 ± 2.04* | |
| 600 | 61.34 ± 6.33* | 0.88 ± 0.12* | −35.15 ± 2.95* | 4.55 ± 0.82* | 11.87 ± 1.98* | |
| 800 | 55.58 ± 6.57* | 0.98 ± 0.11* | −35.17 ± 2.95* | 4.54 ± 0.82* | 10.29 ± 1.97* | |
| 1000 | 49.74 ± 6.82* | 1.10 ± 0.10* | −35.20 ± 2.95* | 4.53 ± 0.82* | 9.53 ± 1.93* | |
| SG | 200 | 70.73 ± 6.03* | 0.76 ± 0.13* | −34.97 ± 3.11* | 6.10 ± 1.44* | 30.19 ± 5.52* |
| 400 | 71.49 ± 6.10* | 0.77 ± 0.13* | −35.54 ± 3.13* | 5.72 ± 1.01 | 23.19 ± 4.50* | |
| 600 | 72.35 ± 6.55* | 0.77 ± 0.13* | −36.40 ± 3.30* | 4.69 ± 0.43* | 25.37 ± 7.90* | |
| 800 | 72.40 ± 6.90* | 0.80 ± 0.12* | −37.50 ± 3.37* | 4.05 ± 0.27* | 24.94 ± 6.08* | |
| 1000 | 71.27 ± 7.04* | 0.83 ± 0.12* | −38.46 ± 3.36* | 3.85 ± 1.05* | 21.30 ± 3.96* | |
| LWS | 200 | 70.08 ± 5.99* | 0.76 ± 0.13* | −34.85± 3.05* | 5.51 ± 0.94* | 22.53 ± 3.55* |
| 400 | 68.61 ± 6.00* | 0.78 ± 0.13* | −34.92 ± 3.00* | 4.88 ± 0.64* | 16.69 ± 2.04 | |
| 600 | 66.16 ± 6.07* | 0.81 ± 0.12* | −34.93 ± 2.97* | 4.08 ± 0.43* | 13.36 ± 1.77* | |
| 800 | 62.97 ± 6.16* | 0.85 ± 0.12* | −34.90 ± 2.95* | 3.66 ± 0.42* | 11.33 ± 1.58* | |
| 1000 | 59.36 ± 6.24* | 0.90 ± 0.12* | –34.86 ± 2.93 | 3.92 ± 1.54* | 9.74 ± 1.38* | |
| Aspiny Inhibitory Neurons | ||||||
| No filter | - | 68.10 ± 9.26 | 0.66 ± 0.16 | −38.85 ± 3.74 | 8.02 ± 8.19 | 34.34 ± 15.31 |
| MM | 200 | 66.47 ± 8.69* | 0.67 ± 0.16* | –38.94 ± 3.74 | 6.50 ± 1.84* | 19.26 ± 4.87* |
| 400 | 61.81 ± 7.08* | 0.72 ± 0.15* | –38.98 ± 3.78 | 5.88 ± 1.37* | 13.72 ± 3.81* | |
| 600 | 55.47 ± 5.24* | 0.79 ± 0.13* | –38.98 ± 3.82 | 5.77 ± 1.50* | 11.37 ± 3.18 * | |
| 800 | 48.71 ± 3.91* | 0.90 ± 0.11* | –39.01 ± 3.85 | 5.76 ± 1.51* | 10.60 ± 2.91* | |
| 1000 | 42.33 ± 3.36* | 1.03 ± 0.08* | –39.08 ± 3.84 | 5.75 ± 1.51* | 10.40 ± 2.87* | |
| SG | 200 | 68.31 ± 9.35* | 0.66 ± 0.16* | −39.04 ± 3.77* | 7.30 ± 2.59* | 28.08 ± 8.10* |
| 400 | 68.93 ± 9.67* | 0.66 ± 0.16* | −39.45 ± 3.92* | 6.15 ± 1.29 | 22.10 ± 11.57* | |
| 600 | 69.11 ± 9.71* | 0.68 ± 0.15* | −40.44 ± 4.40* | 4.82 ± 0.47* | 30.97 ± 15.16* | |
| 800 | 68.04 ± 8.81 | 0.71 ± 0.14* | −41.65 ± 4.58* | 3.95 ± 0.32* | 28.25 ± 10.12* | |
| 1000 | 65.88 ± 7.56* | 0.76 ± 0.13* | −42.59 ± 4.63* | 3.43 ± 0.28* | 22.97 ± 6.82* | |
| LWS | 200 | 67.39 ± 9.02* | 0.67 ± 0.16* | −38.90 ± 3.73* | 5.82 ± 1.64* | 21.40 ± 4.76* |
| 400 | 65.18 ± 8.24* | 0.68 ± 0.15* | −38.89 ± 3.74* | 5.23 ± 1.04* | 15.69 ± 3.43* | |
| 600 | 61.77 ± 7.09* | 0.72 ± 0.15* | −38.85 ± 3.77* | 4.35 ± 0.58* | 12.97 ± 2.94* | |
| 800 | 57.71 ± 5.86* | 0.76 ± 0.14* | –38.83 ± 3.79 | 3.76 ± 0.46* | 11.45 ± 2.50* | |
| 1000 | 53.45 ± 4.78* | 0.81 ± 0.13* | –38.79 ± 3.80 | 3.35 ± 0.41* | 10.01 ± 1.99* | |
For inhibitory aspiny neurons, smoothing also produced significant window-dependent effects on all AP waveform parameters (Friedman tests, p<0.05; Table 3). MM filte-ring caused marked reductions in AP amplitude and rapidity with significant increases in AP width. In contrast, LWS filtering produced progressive reductions in AP amplitude and rapidity, along with increased AP width, as the window size increased. SG filtering produced comparatively smaller changes, although significant alterations remained evident for several AP features at larger window sizes. AP threshold was not significantly affected by MM filtering and remained stable at larger LWS windows, whereas IFWd2 rapidity was preserved at smaller SG filtering windows.
C. Impact of smoothing methods on neuron types classification
Differences in AP waveform across neuronal classes are well established and are widely used for cell-type classification [8],[9],[10]. Excitatory spiny neurons typically exhibit slower and broader APs than inhibitory aspiny neurons [8],[9],[10]. Here, we examined how smoothing methods and window size influence neuron type classification. As shown in Table 4, using unfiltered recordings, excitatory spiny neurons exhibited slightly faster AP rapidity than inhibitory aspiny neurons when quantified using both IFWd2 and phase slope methods. However, these differences were not statistically significant (Mann–Whitney U test: IFWd2: p=0.88,z=0.15; phase slope: p=0.28,z=1.08). This lack of significance appears to be driven by substantial baseline variability under raw conditions, as reflected in the coefficient of variation. Specifically, rapidity measurements showed approximately 100 % variability for both neuron types using the IFWd2 method and approximately 40 % using the phase slope method. Framed technically, this raw baseline variance functions as a severe limitation for derivative-based metrics before experimental noise is bounded.
Table 4.
AP properties for excitatory spiny and inhibitory aspiny neurons extracted from raw data before applying smoothing methods.
| No filter | Spiny (n = 5) | Aspiny (n = 6) |
|---|---|---|
| Amplitude (mV) | 71.3 ± 5.6 | 67.8 ± 8.6* |
| Width (ms) | 0.75 ± 0.13 | 0.62 ± 0.15* |
| Threshold (mV) | −34.2 ± 4.5 | −37.5 ± 3.5* |
| IFWd2 rapidity (ms–1) | 9.4 ± 9.9 | 8.4 ± 8.1 |
| Phase slope rapidity (ms–1) | 36.3 ± 14.3 | 35.6 ± 15.8 |
In contrast, the spike threshold was significantly more hyperpolarized in inhibitory aspiny neurons than in excitatory spiny neurons (p<0.001,z=9.6). Additionally, excitatory spiny neurons exhibited significantly greater AP amplitude and broader spike width than inhibitory aspiny neurons (p<0.0001,z=5.4 for amplitude; p<0.0001,z=11.1 for width). Thus, these results indicate the need to use appropriate smoothing techniques, particularly for parameters derived from membrane potential derivatives.
Applying all three smoothing methods altered the separation between excitatory spiny and inhibitory aspiny neurons across multiple parameters. However, the extent and direction of these effects depended on the window size. IFWd2 rapidity became significantly different between excitatory and inhibitory neurons, and the relationship shifted toward the commonly reported pattern in which inhibitory neurons exhibit faster rapidity [8]. For example, with a 200 μs window, mean IFWd2 rapidity was 5.9 ± 0.72 ms−1 (spiny) versus 6.7 ± 1.7 ms−1 (aspiny) using the MM method (p<0.0001,z=9.4), 5.6 ± 0.75 ms−1 (spiny) versus 6.0 ± 1.6 ms−1 (aspiny) using LWS (p<0.0001,z=4.8), and 5.8 ± 0.9 ms−1 (spiny) versus 7.1 ± 2.4 ms−1 (aspiny) using SG (p<0.0001,z=7.5). Although the difference in AP rapidity remained statistically significant, the absolute difference in mean rapidity between cell types decreased, and at larger window sizes the relationship even reversed.
As shown in Fig. 2, mean IFWd2 rapidity was nearly identical for the two cell types using LWS and SG over a 600 μs window. With larger windows, the mean rapidity was greater in excitatory spiny neurons. For instance, with a 1000 μs window, mean IFWd2 rapidity was 3.8 ± 1.1 ms−1 in excitatory spiny neurons and 3.6 ± 0.4 ms−1 in inhibitory neurons using the SG method (p<0.0001,z=5.4). Phase-slope rapidity values also differed significantly between excitatory and inhibitory neurons, and within-type variation decreased under all three smoothing methods. However, the average phase-slope rapidity remained higher in excitatory than inhibitory neurons across most window sizes. This relationship was inverted only for SG at 400 μs, where inhibitory neurons exhibited a slightly greater phase-slope rapidity (p<0.0001,z=4.7). For the MM method, phase-slope rapidity was higher in inhibitory neurons at 800 μs, but this difference was not significant (p=0.4,z=0.84). Nonetheless, all three methods restricted the noise envelope at small window sizes, whereas differences in mean rapidity progressively diminished as the window size increased.

Fig. 2.
Effect of smoothing methods and window size on neuron-type classification. Comparison between excitatory spiny neurons (blue) and inhibitory aspiny neurons (red), in the same spike train.
For AP amplitude, width, and threshold, smoothing did not alter the qualitative separation between the two neuron types, even at large window sizes, but it reduced the absolute values. At a 200 μs window, changes in AP amplitude and width were modest (<3 % deviation from the raw values shown in Table 4), and excitatory spiny neurons continued to exhibit significantly larger and broader APs than inhibitory aspiny neurons. As the window size increased, AP amplitude decreased, and AP width increased for both neuron types with all three methods, with SG exerting the smallest effect. For example, at 1000 μs, AP amplitude and width were 49.9 ± 6.5 mV and 1.08 ± 0.09 ms for excitatory spiny neurons and 40.4 ± 3.9 mV and 1.00 ± 0.07 ms for inhibitory aspiny neurons using MM; 59.8 ± 5.8 mV and 0.88 ± 0.11 ms for excitatory and 52.1 ± 4.4 mV and 0.77 ± 0.12 ms for inhibitory neurons using LWS; and 72.2 ± 6.5 mV and 0.82 ± 0.11 ms for excitatory and 65.5 ± 7.5 mV and 0.72 ± 0.12 ms for inhibitory neurons using SG. In contrast, threshold values were largely stable across window sizes for all methods, except for SG at the largest window sizes, where the mean threshold decreased by at most 4 mV at 1000 μs.
D. The AP waveform double components
The double peaks in d2V/dt2, or double humps in the phase-space plot, usually indicate two components of somatic APs: the somatic AP and the backpropagated AP from the spike initiation site in the axon [17]. In the dataset analyzed here, this feature was present in nearly all APs evoked by the noisy stimulus: when no filtering was applied, 92 % of spikes exhibited more than one peak in the d2V/dt2 trace. As noted above, noise becomes more prominent in derivative calculations than in the AP waveform itself, which can accentuate these features. Fig. 3 illustrates this effect using two example spikes, where multiple d2V/dt2 peaks and humps in the phase-space trajectories are present. Although smoothing can clarify the traces, overly aggressive smoothing may also eliminate the second component of the AP waveform.

Fig. 3.
Impact of smoothing methods and window size on the phase-space plot and the shape of the second-time derivative. Phase-space plots are shown on the left. Inset boxes provide a magnified view of the initial portion of the phase-space trajectory (dotted circle), where AP threshold and phase-slope rapidity are measured. The normalized second-time derivative (d2V/dt2) traces are shown on the right, with the y-axis normalized to its maximum value. Each row corresponds to one smoothing method: MM, LWS, and SG. The black dotted trace represents the unfiltered data (W = 0), the blue trace corresponds to a 200-point window, and the red trace corresponds to a 1000-point window.
All three smoothing methods altered the apparent two-component AP waveform. For aspiny inhibitory neurons, using the MM filter with a 200 μs window reduced the fraction of APs exhibiting double d2V/dt2 peaks to roughly half of that seen in the raw data, and increasing the MM window up to 800 μs produced little additional change, with the fraction of APs showing double peaks remaining relatively stable across that range. In contrast, the SG filter produced smaller but window-dependent effects. With a 200 μs window, 77 % of APs still showed double d2V/dt2 peaks, but the percentage progressively declined with increasing window size, reaching around 30 % at the largest window size tested here.
The LWS filter produced the strongest attenuation of the two-component waveform. Even with a 200 μs window, only 34 % of APs retained more than one d2V/dt2 peak, and for larger window sizes, the second component was eliminated in essentially all APs. Fig. 4 summarizes these results by showing the percentage of APs with more than one d2V/dt2 peak across different window sizes for the three smoothing methods applied to APs from aspiny inhibitory neurons. For spiny excitatory neurons, all smoothing methods qualitatively altered the apparent two-component AP waveform. However, double peaks were still detected in all recordings because of the high noise level. Although clear double humps were not evident in the phase-space plots, numerous peaks were detected in d2V/dt2, reflecting greater fluctuations in this signal than in spiny neurons.

Fig. 4.
Fraction of APs from aspiny inhibitory neurons evoked by the noisy stimulus that exhibit more than one d2V/dt2 peak after applying the three smoothing methods using window sizes ranging from 200 to 1000 points (0.2–1.0 ms). The dashed line marks the corresponding percentage in the unfiltered (raw) data (92 %).
4. Discussion
In this study, we compared the effects of three different smoothing methods and window sizes on intracellular recordings. We demonstrated that these methods vary in their impact on AP parameters, which influences the interpretation of results. While smoothing can remove unwanted noise and improve the quantification of AP parameters, it can also diminish existing differences. Consequently, over-smoothing by increasing the window size reduces variation between APs and eliminates normal differences between comparison groups, potentially leading to incorrect classifications. Therefore, selecting appropriate methods and window sizes is crucial for an accurate representation of the data.
The results of this study demonstrate the significant impact of selecting appropriate smoothing methods and window sizes on neuron-type classification. The MM method produced the most deviating results in terms of the shape of the time derivatives, introducing an artificial transition between the rising and falling phases of the second derivative that is absent in the raw data (Fig. 3). AP width is considered a reliable indicator of neuron type. It has been reported to be around 0.7 ms for inhibitory cortical neuron types, similar to the average value in the raw data (0.62 ± 0.2 ms) [8], [9]. However, the values reported here have higher variation than previously reported values [8], [9]. The MM method widened the AP significantly, to around 1 ms for inhibitory aspiny neurons, which is similar to values reported for RS pyramidal neurons [8]. Although AP width still differed significantly between inhibitory aspiny and excitatory spiny neurons, the widths of both neuron types increased as the window size increased, reaching averages of about 1 ms with the MM method. The SG and LWS methods also increased AP width in both groups by roughly 0.1 ms, with the SG method having the smaller effect, but their influence was still much less pronounced than that of the MM method. Overall, all smoothing methods preserved the difference in AP width between excitatory and inhibitory neurons, but that difference decreased as the window size increased.
Furthermore, smoothing caused a significant decrease in AP amplitude, with a 1–7 mV reduction at window lengths below 400 μs and around 27 mV at large window sizes for both neuron types. The LWS method showed slightly better results than MM for AP amplitude and width. However, it still produced significant changes relative to the raw data and was more computationally demanding than the other methods. The SG method, on the other hand, kept the amplitude and width values similar to the raw data for window lengths below 400 μs, where the average AP amplitude changed by less than 1 mV and the average width by 0.02 ms for both neuron types. These changes in AP amplitude and width could have serious implications for neuron-type classification or for determining whether neurons exhibit normal or dysfunctional behavior. For instance, RS pyramidal neurons have wider APs with larger amplitudes than FS interneurons [8], [9], [21], [37]. These parameters are also important when comparing different interneuron types [38]. For example, parvalbumin (PV)- and somatostatin (SST)-expressing interneurons were found to differ significantly in AP width, resting potential, threshold, and other electrophysiological parameters [38]. Furthermore, changes in AP features, such as amplitude, or in parameters extracted from phase-space plots, can indicate different stages during focal seizure discharges in cortical neurons [12]. Thus, the impact of smoothing methods and the choice of window size on AP width and amplitude can lead to misclassification of neurons based on the resulting AP parameters.
AP rapidity has been used to differentiate between fast and slow neuron types [36], classify neuron type [8], and assess neuronal responses to stimuli [11]. However, AP rapidity is quantified using membrane potential derivatives, making it more susceptible to noise. As a result, smoothing methods significantly alter the rapidity values. In this study, we found that the variation in both rapidity quantification methods (phase slope and IFWd2) was the highest, at around 45 % and 100 %, respectively. This high variation is due to IFWd2 being based on the rising phase of the second derivative of the membrane potential, which can be difficult to distinguish in the presence of high noise levels. In contrast, phase slope is measured above the noise in the phase-space plot. Nonetheless, the variation in both rapidity measures, especially IFWd2, was more strongly affected by the choice of smoothing method than any other AP feature. As expected, the variation decreased significantly across all methods, and both the average and the SD decreased with increasing window size.
For phase-slope rapidity, excitatory spiny neurons exhibited higher values than inhibitory neurons across most window sizes. This pattern reversed only with the SG method at a window size of 400 μs, in which inhibitory neurons showed a slightly greater phase-slope rapidity (p<0.0001,z=4.7). These inconsistencies in phase-slope rapidity are likely driven by the criterion level used to quantify the slope, which can bias the measurement and lead to misclassification, independent of the smoothing algorithm [8], [39]. In contrast, inhibitory aspiny neurons were consistently faster than excitatory spiny neurons when the smallest window size was used across all smoothing methods. Although the difference remained statistically significant at larger window sizes, it progressively diminished, with mean values becoming increasingly similar and, in some cases, reversing. For example, at a window size of 200 μs, IFWd2 rapidity in inhibitory aspiny neurons was 8 % to 22 % higher than in excitatory spiny neurons across all three methods, with SG producing the largest effect and LWS the smallest. However, with further increases in window size, this difference narrowed and reversed for some methods. Specifically, inhibitory aspiny neurons exhibited IFWd2 values that were 7.5 % and 13 % lower than those of excitatory spiny neurons with SG and LWS, respectively. In contrast, the MM method was the only approach that preserved the original relationship between neuronal groups.
Furthermore, careful attention must be given to the shape of the derivatives, not just the rapidity values. Smoothing methods can eliminate important features, such as the double humps in the phase-space plot or the double peaks in the second derivative, which are indicators of AP backpropagation from the spike initiation site [17]. Nevertheless, the raw data also require filtering, as many peaks appear in the rising phase of the second derivative and distinct humps are visible in the phase-space plot, likely due to noise (Fig. 3). Our results show that, with large window sizes, all methods eliminated the AP double components for inhibitory aspiny neurons, with LWS abolishing them at the smallest window size of the three filters (window size above 400 μs; Fig. 4). Additionally, at large window sizes, the MM method created a region of nearly zero rate of change between the rising and decaying phases of the second derivative (Fig. 3). In contrast, the SG method, and to a lesser extent the LWS method, preserved these features when smaller window sizes were used. However, for excitatory spiny neurons, the double peak was detected for all methods and window sizes because the recordings were noisier than those of inhibitory aspiny neurons, and double peaks were almost always detected using the automated double-peak detection algorithm. Hence, even when the double humps were visually abolished, automated detection still identified many peaks in the second-time derivative, and the presence of multiple components could not be ruled out.
This study has several limitations. First, the recordings were obtained from the open-source Allen Brain Atlas database; therefore, the small sample size in each group was fixed and could not be expanded [30]. The findings should therefore be regarded as preliminary and require confirmation in larger datasets. Second, the choice of filtering methods was based on common practices in the neuroscience literature, where readily available MATLAB functions are frequently used for their simplicity and effectiveness in routine applications. Nevertheless, alternative parameter settings may yield improved performance. For example, increasing the polynomial order in the SG filter may enhance filtering performance. In addition, modified SG approaches that incorporate fitting weights have been reported to outperform the conventional SG filter [28]. Third, the effects of filtering methods were evaluated using neuronal recordings, with filter-induced changes quantified as deviations from the raw data. However, raw electrophysiological recordings may contain noise from multiple sources, which could itself bias the analysis. To address this issue, we compared two neuronal classes known to differ in AP waveform properties, thereby providing a more informative assessment of filter-induced changes. Even so, future studies could benefit from examining filtering distortions in mathematically simulated APs, where model parameters and noise levels can be more precisely controlled.
5. Conclusion
This study demonstrates that the choice of smoothing method and window size substantially influences AP shape parameters extracted from intracellular recordings, with derivative-based parameters being the most susceptible. All three methods altered AP waveform features to varying degrees, with the MM producing the largest deviations from the raw data and the SG filter the smallest. Importantly, these distortions were sufficient to affect neuron-type classification and to attenuate the two-component AP waveform associated with backpropagation. Based on these findings, the SG filter with a window size below 400 μs, and ideally around 200 μs, appears to be the most suitable approach for smoothing intracellular recordings while preserving the key features of the AP waveform.
Acknowledgment
The authors extend their appreciation to the Ongoing Research Funding Program, King Saud University, Riyadh, Saudi Arabia, for funding this work through Research Project number ORF-2026-1316.