eliminating noise/spikes

Posted by tgv on Stack Overflow See other posts from Stack Overflow or by tgv
Published on 2011-11-27T08:14:52Z Indexed on 2011/11/27 9:50 UTC
Read the original article Hit count: 117

Filed under:

I have a measurement data with similar positive and negative values which should be like:

ReqData=[0 0 -2 -2 -2 -2 -2 -2 0 0 0 -2 -2 -2 -2 0 0 2 2 2 2 2 2 0 0 2 2 2 2 2 0 0 2 2 2 2 2 0 0 2 2 2 0 0]'

However, there are some measurement noises in the data - so the real data is like this:

RealData=[0 0 -2 -2 -2 -2 -2 -2 0 0 0 -2 -2 -2 -2 0 0 2 2 2 2 -4 -1 0 0 2 2 2 2 -7 0 0 2 2 2 2 -1 0 0 2 2 2 0 0]'
  1. How do I remove the end noise from the RealData and convert it into ReqData using Matlab?
  2. How do I find the start and stop indexes of each set of positive or negative data and split them using Matlab? For instance, ansPositive = [3,8, 12, 15]' and ansNegative = [18, 23, 26, 30, 33, 37, 40, 42]'.

© Stack Overflow or respective owner

Related posts about matlab