%% Script to create four 2D signals as Cartesian products (that is,
%% separable signals) from 1D discrete cosines.
%% 
%% D.H. Broooks
%% Rev 1.0, Feb, 2004

%% First we create 3 1D cosines at different discrete frequencies.

x = cos(2*pi/32*[0:127]);
y = cos(2*pi/16*[0:127]);
z = cos(2*pi/4*[0:127]);

%% Now we create the four 2D signals from these three and a constant-valued
%% (all ones) 1D signal, using the vector outer product to get the four
%% matrices. The names of the variable indicate that the non-constant
%% cosines are in the horizontal and/or vertical direction, with the 'f' in
%% the middle of the last name indicating that the 'faster' (that is,
%% higher frequency) cosine is used in one direction in that case.

horcos = ones(128,1)*(x(:).');
vercos = y(:)*ones(1,128);
horver = y(:) * (x(:).');
horfver = z(:) * (x(:).');
