% demonstration that the "mirror" operation g[n,m] = f[-n,-m]
% is a separable operation that one can implement using matrix operations

n = [-3:3]; N = numel(n);
m = [-2:2]; M = numel(m);
%N = 6;
%M = 4;
A = reshape([1:(N*M)], N, M); % [N M]

Sn = flipdim(eye(N), 1);
Sm = flipdim(eye(M), 1);

B = Sn * A * Sm;

im plc 2 2
im(1, n, m, A, 'A'), cbar
xlabel n, ylabel m
im(2, Sm', 'Sm'), cbar
im(3, Sn', 'Sn'), cbar
im(4, n, m, B, 'B = Sn * A * Sm'), cbar
xlabel n, ylabel m
