Does it make sense to Resample and interpolate?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Mathieu NOE
le 9 Fév 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 ?
Réponses (0)
Voir également
Catégories
En savoir plus sur Multirate Signal Processing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!