This a very simple function that produces a condensed, approximate version of the time-series signal y, with each group of n adjacent points in y replaced by its average. You can use this to condense over-sampled signals so that subsequent processing will be easier and faster. Or you can use it to speed up preliminary and exploratory analysis of very large signals to locate the interesting bits, which can then be selected out of the original signal for more precise analysis. For x,y data sets, use this function on both independent variable x AND dependent variable y so that the features of y will appear at the same x values. It takes less than 0.5 second to condense a 10-million-point signal. There is also a version for matrices.
Tom O'Haver (2023). Condense time-series signals (https://www.mathworks.com/matlabcentral/fileexchange/12123-condense-time-series-signals), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!