function [signal_matrix] = segment_signal(signal,frame_length,frame_shift);
%segment imput vector signal into frames and return matrix of those vectors
%input should be a row vestor

[raw,culomn]=size(signal);
if raw>1 & culomn>1
   disp('working anly with vectors!');
   signa_matrix='';
   return;
end

if raw>1
   signal=signal.';
   signal_length=raw;
else
   signal_length=culomn;
end


num_blocks = floor((signal_length-frame_length)/frame_shift)+1;
signal_matrix=zeros(num_blocks,frame_length);

for n = 1:num_blocks,
   pozition = (n-1)*frame_shift;	
   signal_matrix(n,:) = signal(pozition+1:pozition+frame_length);
end
