function [a] =sample(a,N)
%samplaa
n=length(a);
k=ceil(log(N/n)/log(2));
for j=1:k
    a=[a,a];
end
a=a(1:N);
end

