function segments = segment(vector, win)


% choses only one track from stereo if needed
[row column] = size(vector);
if column == 2, vector = vector(:,1) + vector(:,2); end
if row == 2, vector = vector(1,:) + vector(2,:); end 

vector = vector - mean(vector);

A = zeros(win - mod(length(vector), win), 1);

vector = [vector;A];

segments = reshape(vector, [win length(vector)/win]);
