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

function [data] = ComparePowerSpec( wave1, wave2, S );

wave1Filt = bandFilter(wave1,1,50,S/1000);
wave2Filt = bandFilter(wave2,1,50,S/1000);

for n = 2:65
wave1(:,n) = wave1(:,n)-mean(wave1(:,n));
end

for n = 2:65
wave2(:,n) = wave2(:,n)-mean(wave2(:,n));
end


wave1fft = fft(wave1Filt);
wave1mag = abs(wave1fft);


wave2fft = fft(wave2Filt);
wave2mag = abs(wave2fft);

f = (0:length(wave1fft)-1)'*S/length(wave1fft);

for n=1:64
subplot(8,8,n); plot(f(5:0.2*S), wave1mag(5:0.2*S, n+1), f(5:0.2*S), wave2mag(5:0.2*S, n+1))
end