Does it make sense to Resample and interpolate?
5 views (last 30 days)
Show older comments
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 Comment
Mathieu NOE
on 9 Feb 2021
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 ?
Answers (0)
See Also
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!