% 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
g = red - mean(red);
clg
hold off
axis('normal')
subplot(211)
h = dechirp(g,1000,.5+.23);  % as determined by Shawns keen eye
h = h - mean(h);
% plot(red)
H = fftshift(abs(fft(h)));
% H = 20*log(H+eps)/log(10);
H = H/max(H);

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

axis([-.5 .5 sign(min(H))*abs(min(H))*1.05 max(H)*1.05])
plot(linspace(-.5,.5,length(H)),H)
grid
xlabel('fractional frequency')
ylabel('normalized Fourier magnitude')
% title('Normalized magnitude spectrum')

