How do you change the time step and decrease number of data points for a nonlinear data series?

I have a data set of approximately 500 points taken at a 0.01s time step. I need to decrease the number of data points to 100 while making the time step 0.03s. (sorry, I can't post the data set) The data set is essentially a nonlinear ramping function that has a long period of nothing, the ramp-up, and then levels off.
Any suggestions on how to do this? Short of taking out data points manually one at a time making sure the data represented cumulatively looks the same.
My job regularly takes in data like this, and I need to find a way to automate this reduction in steps. Been using MATLAB for a few years, but I'm not even sure where to start on this one. I was considering "downsample", but dropping every nth number won't work. "Resample" works to reduce the data points, but I can't control how far apart it takes the data points.
Note also that the data that is before and after the ramp can take larger steps to downsample since the data is the same, but the ramp portion needs to be at 0.03s timesteps.
Any suggestions on this?
Thanks.

답변 (1개)

I would use the Signal Processing Toolbox resample function. It will interpolate your signal to the new time vector, and incorporates an anti-aliasing filter.

댓글 수: 4

I tried this, and I should have clarified that I need the data points to stay the same value. I guess I don't want it to resample, but I need it to pair down the current data points from 100 to 500. Is there a way to do this without using downsampling?
Not to my knowledge.
I see no way to decrease it 1/5 (from 500 to 100 elements), and decrease the sampling frequency by 1/3, without interpolating. (The resample function is best for this.)
Ok, fair enough. I get a lot of noise towards the end of the data though, the decimate and downsample don't seem to cause this.
I don’t see a solution that doesn’t involve resample.
I’ll delete my Answer in a few minutes.

댓글을 달려면 로그인하십시오.

카테고리

질문:

2017년 12월 10일

댓글:

2017년 12월 11일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by