hello
everything is explained if you type help resample
resample Resample uniform or nonuniform data to a new fixed rate.
Y = resample(X,P,Q) resamples the values, X, of a uniformly sampled
signal at P/Q times the original sample rate using a polyphase
antialiasing filter. If X is a matrix, then resample treats each
column as an independent channel.
have you tried the examples ?
% Example 1:
% Resample a sinusoid at 3/2 the original rate.
tx = 0:3:300-3; % Time vector for original signal
x = sin(2*pi*tx/300); % Define a sinusoid
ty = 0:2:300-2; % Time vector for resampled signal
y = resample(x,3,2); % Change sampling rate
plot(tx,x,'+-',ty,y,'o:')
legend('Original','Resampled');
xlabel('Time')
% Example 2:
% Resample a non-uniformly sampled sinusoid to a uniform 50 Hz rate.
Fs = 50;
tx = linspace(0,1,21) + .012*rand(1,21);
x = sin(2*pi*tx);
[y, ty] = resample(x, tx, Fs);
plot(tx,x,'+-',ty,y,'o:')
legend('Original','Resampled');
xlabel('Time')