Skip to main content
Chemistry LibreTexts

Boxcar Averaging

  • Page ID
    77550
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Boxcar averaging is a data treatment method that enhances the signal-to-noise of an analytical signal by replacing a group of consecutive data points with its average. This treatment, which is called smoothing, filters out rapidly changing signals by averaging over a relatively long time but has a negligible effect on slowly changing signals. Therefore, boxcar averaging mimics a software- based low-pass filter. Boxcar averaging can be done both in real time and after data acquisition is complete.

    How Boxcar Averaging Works

    During Data Acquisition:

    • The signal is sampled several times. Theoretically, any number of points may be used.
    • The samples are summed together and an average is calculated.
    • The average signal (dependent variable) is stored in the smoothed data set as the y-coordinate, and the average value of the independent variable (e.g. time, wavelength) is used as the x-coordinate.

    After Data Acquisition (see figure below):

    • Sum the data points within the boxcar
    • Divide by the number of points in the boxcar
    • Plot the average y-value at the central x-value of the boxcar
    • Repeat with Boxcar 2, etc until the last full boxcar is smoothed

    after_data_acquisition.png

    Main Points about Boxcar Averaging

    • Boxcar averaging is equivalent to software-based low-pass filtering.
    • Boxcar averaging is straightforward to implement.
    • Improvement in S/N is proportional to:

    \[\sqrt{\textrm{# of data points in boxcar}}\]

    • (N-1) points are lost from each boxcar in the smoothed data set, where N is the boxcar length. The data density of the smoothed data set will be reduced by (N-1)/N
    • Significant loss of information can occur if the length of the boxcar is comparable to the data acquisition rate. It is best to implement boxcar averaging with a sufficient data acquisition rate.

    Example of Boxcar Averaging

    • There are two 5 μV signals below
      • Peak at 1.00 minutes with a width of 0.04 minutes
      • Peak at 2.00 minutes with a width of 0.40 minutes
    • Levels of boxcar averaging are as follows
      • Bottom dataset: Theoretical S/N of 13 (no smoothing)
      • Middle dataset: Theoretical S/N of 29 (Five-point boxcar, 0.05 min long)
      • Top dataset: Theoretical S/N of 39 (Nine-point boxcar, 0.09 min long)
    • Notice that little distortion occurs if the peak width is much larger than the boxcar and significant S/N enhancement is possible.
    • Signals with frequencies similar to the rate of data acquisition are quickly attenuated, analogous to a low-pass RC filter.
    • Click here to work on a boxcar averaging exercise.

    boxcar_averaging_example.png


    This page titled Boxcar Averaging is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Contributor.

    • Was this article helpful?