%% wave2dDCT2
%usage: wave2dDCT2(m)
% show linear bands of 2D DCT wave forms for a square image
% m: number of rows and columns of the image matrices

% S. Allen Broughton

function Z = wave2dDCT2(m) 

dt = 8^2/m^2;

for k = 1:(2*m-1);
    r = min(k,m);
    s = k+1-r;
    while (r >= 1)&(s <= m)
      X = zeros(m,m);
      X(r,s) =1;
      Y = idct2(X);
      subplot(2,1,1)
      imagesc(X,[0,1])
      colormap(gray)
      axis tight
      axis square
      title('coefficient');
      subplot(2,1,2)
      imagesc(Y)
      colormap(gray)
      axis tight
      axis square
      title('waveform');
      pause(dt)
      r = r-1;
      s = s+1;  
    end;
end;


