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!
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)
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.