User`s guide

2 Importing, Viewing, and Preprocessing Data
2-12
- Click Delete to delete one or more data sets. To select multiple data sets,
you can use the
Ctrl key and the mouse to select data sets one by one, or
you can use the
Shift key and the mouse to select a range of data sets.
- Click
Save to workspace to save a single data set to a structure.
Moving Average Filtering
A moving average filter smooths data by replacing each data point with the
average of the neighboring data points defined within the span. This process is
equivalent to lowpass filtering with the response of the smoothing given by the
difference equation
where y
s
(i) is the smoothed value for the ith data point, N is the number of
neighboring data points on either side of y
s
(i), and 2N+1 is the span.
The moving average smoothing method used by the Curve Fitting Toolbox
follows these rules:
The span must be odd.
The data point to be smoothed must be at the center of the span.
The span is adjusted for data points that cannot accommodate the specified
number of neighbors on either side.
The end points are not smoothed because a span cannot be defined.
Note that you can use MATLABs
filter function to implement difference
equations such as the one shown above. However, because of the way that the
end points are treated, the toolbox moving average result will differ from the
result returned by
filter. Refer to Difference Equations and Filtering in the
MATLAB documentation for more information.
For example, suppose you smooth data using a moving average filter with a
span of 5. Using the rules described above, the first four elements of
y
s
are
given by
y
s
(1) = y(1)
y
s
(2) = (y(1)+y(2)+y(3))/3
y
s
(3) = (y(1)+y(2)+y(3)+y(4)+y(5))/5
y
s
(4) = (y(2)+y(3)+y(4)+y(5)+y(6))/5
y
s
i()
1
2N 1+
------------------
yi N+()yi N 1+()yi N()+++()=