function [cx,cy]=ConditionData(x,y,N)

%Remove DC offset
y=y - mean(y);

%Zero pad Data
cy=zeros(N,1);
dx=x(2)-x(1);
[m,n]=size(x);
if m==N,
   cx=x;
   cy=y;
else,
   offsetind=floor((N-m)/2);
   startx=x(1)-offsetind*dx;
   cx=((0:(N-1))'*dx)+startx;
   cy(offsetind:(offsetind+m-1))=y;
end;
