function M = linear_interpolate(image);
% "optimal linear" method interpolation filter

[row,col] = size(image);

M = zeros(2*row,2*col);
avg1 = [0.5 0.5];
avg2 = [1 1; 1 1]/4;

M(1:2:2*row,1:2:2*col) = image;
M(1:2:2*row,2:2:2*col) = replicateConv(image, avg1);
M(2:2:2*row,1:2:2*col) = replicateConv(image, avg1');
M(2:2:2*row,2:2:2*col) = replicateConv(image, avg2);
