function [out]=downsample(in,noSamples)
    stepSize=size(in,2)/noSamples;
    out=in(fix((0:noSamples-1)*stepSize)+1);
end