function [xtr,NB_TR]=frame(x,FRAME,R) % call: [xtr,NB_TR]=frame(x,FRAME,R) % framing of input signal into frames of length FRAME with overlap R. % matrix xtr contains frames in its columns. % NB_TR is the number of generated frames % (horizontal dimension of matrix xtr). % ------------------------------------------------------------------- % appel : [xtr,NB_TR]=frame(x,FRAME,R) % structuration de la zone selectionnee x en NB_TR (calculé) frames % de TRAME (choisi) points avec un recouvrement de R(choisi) points % entre trames successives % % modif Thu Mar 28 15:19:14 CET 2002 % adding ALLOCATION of the matrix a-priori ! NB_TR=fix((length(x)-FRAME)/(FRAME-R)+1); [l,c]=size(x); if(l>c) x=x'; end % jan adds: xtr = zeros(FRAME,NB_TR); if (NB_TR ~= 0) for tr=1:NB_TR xtr(:,tr)= x(1+(tr-1)*(FRAME-R):tr*(FRAME-R)+R)'; end else disp(' zone sélectionnée trop petite par rapport à la frame demandée') end