function [out]=downsample(in,noSamples)
    indices=randperm(size(in,1));
    out=in(indices(1:noSamples));
end