function B = f(A)

% makes matrix twice as high;
% puts input into even indices of output
% interpolates remainder from input, except top row which is just copied
% from input
%
% useful for deinterlacing:  B=upsam_field2frame(undsambot(A));
%                            is the same size as A but without top field

Af=conv2(A,[1/2;1/2],'valid');

[M,N]=size(A);
B=NaN*ones(2*M,N);
for m=1:M
  B(2*m,:)=A(m,:); % stuff back into lower portion where it was...
  if m ~=M    % don't overrun Af which is 1 smaller
    B(2*m+1,:)=Af(m,:);
  end%if
end%for
B(1,:)=A(1,:);  % just replicate the top row -- nothing to interp between.

