differentiation of time series data

조회 수: 185 (최근 30일)
Samson
Samson 2021년 2월 15일
댓글: Walter Roberson 2021년 2월 21일
I have a time series data 'X 'of size 20000 X 50. My step size dt= 0.05
how do I find the velocity of these data
  댓글 수: 2
Walter Roberson
Walter Roberson 2021년 2월 15일
Extract the data and use gradient() ?
Samson
Samson 2021년 2월 15일
편집: Samson 2021년 2월 15일
how do I extract, please? I had something like this but not correct as it is not taken the difference across time:
phdiff=diff(X');
temp=(phdiff./dt);

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

채택된 답변

Walter Roberson
Walter Roberson 2021년 2월 15일
If ts is the timeseries() variable then
X = ts.Data;
extracts the data.
With your data being 20000 x 50 my guess is that you have 20000 measurements for each of 50 entities, rather than 50 measurements for each of 20000 entities. If I am correct, then you would want the y gradient:
xstep = 1; %doesn't really matter, we are going to ignore
tstep = 0.5; %does matter
[~, ygrad] = gradient(X, xstep, tstep); %horizontal step first, vertical step second
  댓글 수: 18
Samson
Samson 2021년 2월 21일
It is the row that correspond to time. I am taking the velocity across the row which is a dimensionless time uniit. The values are phase values of oscillator distribeted in the interval (0,2pi]. I would finally need the mean of the phase velocity as there all independent rows
Walter Roberson
Walter Roberson 2021년 2월 21일
xstep = 1; %doesn't really matter, we are going to ignore
tstep = 0.5; %does matter
Xunwrapped = unwrap(X, [], 2);
[~, velocity_gradient] = gradient(Xunwrapped, xstep, tstep); %horizontal step first, vertical step second

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by