function res=upsample(data,n)

c=2^n;

s=size(data);
b=ones(c,c);
for i=1:s(1)
   for j=1:s(2)
   	res((i-1)*c+1:i*c,   (j-1)*c+1:j*c)=data(i,j)*b;
   end
end
