[ top | up ]
Splining Through Glitches
Syntax
[ntimes,newvals,newlabels] = hrspline(times,vals,labs,goodlabel);
Arguments
times
| A column vector giving the
time at which each of the vals was recorded.
|
vals
|
A column vector of the recorded data.
|
labels
|
A column vector indicating which of the vals are valid.
|
goodlabel
|
A number indicating what label corresponds to valid. Default: 1.
|
Returned Values
ntimes
|
Just a copy of times
|
nvals
|
A copy of vals, but with the invalid points
replaced by a linear spline between the adjacent valid points.
|
newlabels
|
A copy of labels, with 1s whereever labels
indicated a valid point, and 0s elsewhere.
|
Description
It is often necessary to remove invalid data from a data set.
In some cases, e.g., power spectrum analysis, one must at the
same time maintain the original timing of the valid data points.
Splining is one technique for doing this; it replaces each invalid
data point with a value derived from the nearest valid data points
on each side by computing the value that a linear spline connecting
those valid data points would have at the time of the invalid point
under consideration. Invalid data points at the extreme ends of the
time series are replaced with the value of the nearest valid point.
References
Albrecht's paper in Computers in Cardiology
See Also
ardeglch
Examples