# Mathematical technique to find activity windows in a moving average plot

I have some raw data that comes from a simulation. I take the sample points, and produce a moving average variable, and plot it against time. So imagine a signal that has peaks and valleys. The peaks represent periods of high activity, and the valleys represent periods of low activity.

What filter can I apply to this data to report the windows of high activity? We can assume that the windows do not overlap.

EDIT: The words "what filter can I apply" are not used correctly. I am not looking for a "filter". I am looking for a technique to find the windows. I start with the data, and all I want to do is find where the interesting windows of high activity are, so I can analyze them. You could say "just look at them", but I'm dealing with many data sets so that doesn't scale.

-

## migrated from math.stackexchange.comFeb 26 '13 at 2:37

This question came from our site for people studying math at any level and professionals in related fields.

Segmenting the signal into windows can be done easily in Matlab for example, using the buffer function to segment the signal into windows. The function medfilt1 will median filter the signal if you would like to smooth it prior to windowing and calculating the mean per window (epoch).