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

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

waveFilt = bandFilter(wave,3,60,S/1000);
wavefft = fft(waveFilt);
wavemag = abs(wavefft);
wavemag(1,:)=0;
f = (0:length(wavefft)-1)'*S/length(wavefft);

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

figure
plot(f(1:100), wavemag(1:100,28)); axis([0 50 0 25]);

figure
for n=1:64
subplot(8,8,transverse(n)); plot(f(1:100), wavemag(1:100, n+1)); axis([0 50 0 25]); axis off;
end