%% mannybyfreqs.m
% show the block components of a single frequency
% cycling through all frequencies
% using the mandrill pic

% S. Allen Broughton - 31 Oct 2010

%% load pic and set up parameters
load mandrill
dX =blkdct2(X,8,8);
dt = 1;

%% iterate
figure(1)
for s =0:14
    if s <= 7 start = 0; stop =s; else start = s-7; stop = 7; end;        
    for l=start:stop
        k=s-l;
        disp([s,k,l])
        X = zeros(8,8);
        X(k+1,l+1)=1;
        subplot(1,2,1)
        imagesc(X,[0,1])
        axis square
        Y = blkfreqcomp(dX,8,8,k,l);
        subplot(1,2,2)
        imagesc(Y)
        colormap(gray)
        axis square
        pause(dt)
    end
end
