%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);
f = (0:length(wavefft)-1)'*S/length(wavefft);

for n=1:64
subplot(8,8,n); plot(f(1:100), wavemag(1:100, n+1)); axis([0 100 0 100]); 
P = ones(16)+1;
P(1,:)=1; P(16,:)=1;
P(:,1)=1; P(:,16)=1;
P(1:4,8:9)=1; P(13:16,8:9)=1;
P(8:9,1:4)=1; P(8:9,13:16)=1;
P(5:12,5:12)=NaN;
set(gcf,'pointer','custom', 'pointershapecdata',P,...
    'Pointershapehotspot',[9,9])
end