function [Y]=rpsTDembed(x,dim,tau)

N = length(x);

% Total points on phase space 
num = N - (dim-1)*tau;

% The phase space will be stored in Y
Y=zeros(num,dim);

% Phase space reconstructed from time-delay embedding
for i = 1 : num
   Y(i,:)=x(i+(0:dim-1)*tau)';
end
