2

I have some time course data which I would like obtain the first derivative of. As it seems quite difficult to model, I do not intend to fit a function to it, but rather compute the first derivative numerically (taking the difference of each measure from the one before via the numpy.diff function).

Now, I also want to down-sample my data to get rid of some noise. I have tried to calculate whether it makes a difference if I derive first and downscale that or downscale first and derive that. But however I try to look at it I can't seem to put the same variables on both sides of my equation (first side - how I believe differentiation and subsequent down-sampling work, and on the second side the converse).

$ \frac{(b-a)+(c-b)}{2} = \frac{c+d}{2}-\frac{b+a}{2} $

Could you help me out determine whether it matters in what order I perform my operations?

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
TheChymera
  • 754
  • 2
  • 10
  • 24
  • 1
    Why do you think that downsampling would necessarily *reduce* noise? You might be interested in the small, delightful book R. W. Hamming (1989), *Digital Filters*, 3rd. ed., Prentice-Hall. It is a bit unconventional of a book on the topic, but has sections on the design and evaluation of differentiation filters that incorporate smoothing more directly and naturally. – cardinal Dec 01 '13 at 15:21
  • I can graphically see on the time course that high-frequency, low-ampitude components which are irrelevant to my measurement disappear after I downsample. In any case, *assuming* that what I do makes sense, is there any "better" order in which to derive and downsample? and if so where's the difference? – TheChymera Dec 01 '13 at 15:59

0 Answers0