Tuesday, 10 December 2019

How to downsample a signal preserving spikes?

I'm analyzing a signal sampled at 200Hz for 6-8 seconds, and the important part are the spikes, that lasts 1 second at max. Think for example to an earthquake...

I have to downsample the signal by a factor 2. I tried:

from scipy import signal

signal.decimate(mysignal, 2, ftype="fir")
signal.resample_poly(mysignal, 1, 2)

I get the same result with both the functions: the signal is resampled, but the spikes, positive and negative ones, are diminished.

I wrong the function, or I have to pass a custom FIR filter?



from How to downsample a signal preserving spikes?

No comments:

Post a Comment