function [Y2]=window(Y1,w1,frm)
% simplest smoothing function 
 % Y2= integrate Y1 across window width w=2*w1+1
% Y1 and Y2 have same row dimension as frm
  stp=size(Y1,1);
  for i=1:stp
    f=find(abs(frm(:)-frm(i))<w1+1);
    Y2(i,:)=mean(Y1(f,:));
  end
  
