Download
Boxcar Averaging.vi - LabVIEW Virtual Instrument (requires LabVIEW version 2010 or higher)
Boxcar Averaging.exe - Stand-alone executable (download folder and run setup.exe to install)
JavaScript version - runs directly in web browser
Description
Boxcar averaging is a signal smoothing technique that assumes the average of a small number of adjacent points to be a better measure of signal than any of the individual points. For example, in a 3-point boxcar, the first point is the average of points 1, 2, and 3. The second is the average of points 4, 5, and 6, and so on. Data becomes smoother as the size of the boxcar is increased; however, important details may be lost.
In this simulation, a "raw data" array of 2000 points is created consisting of four complete sine wave cycles on a background of Gaussian white noise. An array of "boxcar averaged data" is created with a user-selected boxcar size. Both the raw and averaged data are plotted (see below). The VI updates continuously, thereby simulating real-time data acquisition, and emphasizing the effect of a change in the boxcar size.
(Reference: Skoog, Holler, and Crouch, Principles of Instrumental Analysis, 6th Ed Thomson Brooks/Cole 2007)
Front panel
Guiding questions
Why is “boxcar averaging” a good name for this technique?
At what boxcar size does the averaged signal begin to lose the overall shape of the non-averaged signal?
What dangers, if any, could you anticipate arising from using boxcar averaging for data smoothing?