Azzera filtri
Azzera filtri

Uniform Interpolation/resample Question

1 visualizzazione (ultimi 30 giorni)
Tsuwei Tan
Tsuwei Tan il 21 Ago 2018
Commentato: Rik il 22 Ago 2018
Please find the attachment data.mat
figure(1)
plot(exp_f2,exp_t2,'ro')
ylabel('Unifrom Time Step 2.5ms');xlabel('Hz');title('Mode 2 Exp data,fs=400Hz')
Here I have uniform time step 2.5ms on my y axis. But I need an uniform frequency step on my x axis like
f2_interp=linspace(exp_f2(1),exp_f2(end),400);
How can I interpolate or resample it? Thanks!

Risposta accettata

KSSV
KSSV il 21 Ago 2018
% interpolation
ti=linspace(min(exp_t2),max(exp_t2),400);
yi = interp1(exp_t2,exp_f2,ti) ;
plot(yi,ti)
  7 Commenti
Tsuwei Tan
Tsuwei Tan il 22 Ago 2018
In your code, you make the exp_t2 which is already uniform step to be uniform again:
ti=linspace(min(exp_t2),max(exp_t2),400);
What I need is to make exp_f2 to be uniform:
f2=linspace(min(exp_f2),max(exp_f2),numel(exp_t2));
The output of "interp1" command doesn't have to be uniform, thanks!
Rik
Rik il 22 Ago 2018
Now I'm really confused. You want to make a variable uniform that is already uniform? And if you already have the code to do that, what is your question? And to what code are you referring to as "your code"? I haven't posted any code in this thread, only you and KSSV have.

Accedi per commentare.

Più risposte (0)

Prodotti


Release

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by