%filters data and plots power spectrum for 64 electrode array
%requires raw data and sampling frequency

function [data] = PlotAutoCorr4( wave, S );

waveFilt = BudapestbandPass(wave,1000,5,200);
[waveCorr,lags] = xcov(waveFilt(1:100,2:65),200,'coeff');
%[waveCorr,lags] = xcorr(waveFilt(1:100,2:65),200,'coeff');

transverse=1:64;
reshape(transverse,8,8);
transverse=reshape(transverse',1,64);

figure
plot(lags,waveCorr(:,64.*26+27)); axis([-100 100 -1 1]);
figure
for n=1:64
subplot(8,8,transverse(n)); plot(lags, waveCorr(:,64*(n-1)+n)); axis([-100 100 -1 1]); axis off;
end
