How can I resample a data with different frequency over the same period of time?

12 views (last 30 days)
I have three different datasets with different frequencies that has 20000 datapoints (see screenshot, this is just a fraction of the data set but it's repetitive). I'd like to have a function where I can resample these datasets in a way that it has a different frequency but over the same period of time. Like, being able to create a dataset with the frequency between the first and second dataset for example. You can see the pattern between all these datasets, I'd like to be able to create a NSR70 or NSR90 for example. I used the below code (which is for a different dataset with 10000 datapoints) but that just duplicates the signal over a longer period of time.
How can I achieve this, or can I? I'm open to suggestions and different solutions!
Thank you!
t1 = datetime(2022,2,15,4,15,46);
t2 = datetime(2022,2,15,4,16,6);
t = t1:milliseconds(2):t2
t = transpose(t)
t = t(1:10000)
TT1 = timetable(t,NSR60RS)
TT2 = retime(TT1,'regular','nearest','SampleRate',600)

Answers (1)

Allen
Allen on 24 May 2022
Their are a number of way to go about resampling. Here is a list of some useful functions to get the job done.
resample, decimate, downsample, interp, interp1, and upsample.
If you do not have the Signal Processing Toolbox, the interpolation functions are likely your best bet.
  1 Comment
EgeKara
EgeKara on 26 May 2022
Thank you, but all these functions seems to be for resampling the data without changing any of the values, just decreasing or increasing the number of data point or multiply them - or so I understand.
What I'm trying to achieve is, manipulating signal/data points in a way that I can change the first data set (see the first plot in the attached jpg) into second or third data set. I'm not sure what this approach is called exactly.
I hope it's clear what I mean.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by