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

조회 수: 17 (최근 30일)
EgeKara
EgeKara 2022년 5월 24일
댓글: EgeKara 2022년 5월 26일
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)

답변 (1개)

Allen
Allen 2022년 5월 24일
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
EgeKara
EgeKara 2022년 5월 26일
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.

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

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by