Does it make sense to Resample and interpolate?

조회 수: 3 (최근 30일)
Me Me
Me Me 2021년 2월 7일
댓글: Mathieu NOE 2021년 2월 9일
I am working with two different datasets that I need to compare
Data 1: 399x2 array with a sampling rate of Fs=4 Hz
Data 2: 9237x19 array with a sampling rate of Fs=10 Hz
  • Firstly I would like to downsample Data 2, so I have an Fs=4 Hz for both signals.
  • I would like to compare some properties and plot the two datasets together - I need the same length of points in the x-axis and need to interpolate.
My question is whether the order is important?
Is it faulty to use both? I suppose I am downsampling twice?
% Downsampling
T1 = 0.1; Fs = 1/T1;
y1 = resample(b, 4, 10);
Ty1 = T1 / (4/ 10); %sampling frequency of 2.5
ty1 = (0:length(y1)-1)*Ty1; % new vector with 4Hz (= 0.250s samplingsrate)
% Interpolate
Tx1 = 1:1:399
A31=interp1( ty1 , y1,Tx1)
Thanks!
  댓글 수: 1
Mathieu NOE
Mathieu NOE 2021년 2월 9일
hello
even if both data sets would have the same sampling frequency (why is it so important BTW ? )
their time duration are differents , so how do you want to plot the two in the same graph ? of course it's doable but each dataset will have a different time vector, so why bother with resampling ?

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

답변 (0개)

카테고리

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