% wave2dtrigcc
% usage: wave2dtrigcc(m,n,k,l);
% show real and imaginary parts of a pure 2d waveform
%
% m,n: number of rows and columns of the image matrix
% k,l: vertical and horizontal frequencies 

function wave2dtrigcc(m,n,k,l);

tm = (0:1:(m-1))/m;  % vertical sampletimes
tn = (0:1:(n-1))/n;  % horizontal sampletimes

% define wave 
wave = cos(2*pi*k*tm')*cos(2*pi*l*tn);

% display results as images
subplot(1,2,1);
imagesc(wave)
title('cosxcos wave');
axis square
colormap(gray)

% display results as 3D plots
subplot(1,2,2);
mesh(wave);
axis([0,m-1,0,n-1,-1,1]);
title('cosxcos wave');
colormap(gray)