[SciPy-user] Sample and hold

Martin Spacek scipy at mspacek.mm.st
Sat Jun 3 14:06:49 CDT 2006


I've got an array of irregularly spaced data points, like this:

               *                             *
           *                                      *
*                      *

I'd like to resample them so that the signal between points is simply 
the value at the previous point, like this:

               ****                          *****
           ****                                   *
**********             *****************

I'd like the output to have regularly spaced data points. This means 
that the exact times of the original data points will be lost, but 
that's OK.

I've searched scipy.signal in vain (I'm not even sure what to call this 
procedure, though I probably should). What's the best way to do this in 


Martin Spacek
PhD student, Graduate Program in Neuroscience
Dept. of Ophthalmology and Visual Sciences
University of British Columbia, Vancouver, BC, Canada

More information about the SciPy-user mailing list