% NONE OF THESE SEEM TO WORK:
% red = dat2mat('/radio/steve/perspectivepics/red"[110+1 ]"')

% NOT EVEN
% !dat2mat /radio/steve/perspectivepics/red"[0+1 0+1]" deleteme.mat
% !dat2mat /radio/steve/perspectivepics/red[0+1 0+1] deleteme.mat

load /radio/steve/perspectivepics/red.txt
red = red - mean(red);
clg
hold off
axis('normal')
subplot(211)
g = dechirp(red,1000,.5+.27);
g = g - mean(g);
% plot(red)
G = fftshift(abs(fft(g)));
% G = 20*log(G+eps)/log(10);

q = (conv(red,rev(red)));
axis([0 length(q) sign(min(q))*abs(min(q))*1.05 max(q)*1.05])
plot(q)
xlabel('horizontal pixel index, ``x''''')
ylabel('autocorrelation')
% no grid because it would go through non-center          grid

Q = fftshift(abs(fft(dechirp(red,1000)))); % make it 1000 samples first
Q = Q/max(Q);   % normalize to unity
axis([-.5 .5 sign(min(Q))*abs(min(Q))*1.05 max(Q)*1.05])
plot(linspace(-.5,.5,length(Q)),Q)
grid
xlabel('fractional frequency')
ylabel('normalized Fourier magnitude')

% axis([-.25 .25 0 max(G)*1.05])
% plot(linspace(-.5,.5,length(G)),G)

