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

function [f] = PlotPowerSpec1( wave, wave2 );

waveFilt = BudapestbandPass(wave,1000,5,40,1000);
waveFilt2 = BudapestbandPass(wave2,1000,5,40,1000);
%wavefft = fft(waveFilt);
wavemag = abs(fft(waveFilt,2048));
wavemag2 = abs(fft(waveFilt2,2048));
%wavemag(1,:)=0;
f = (1000*(0:1023)/2048);

figure
for n=1:4
subplot(4,1,n); plot(f, wavemag(1:1024,n)); axis([0 50 0 50]); %axis off;
[C(n),I(n)]=max(wavemag(:,n));
end
CA3amp=(C)
freq=(I)

figure
for n=1:3
subplot(3,1,n); plot(f, wavemag2(1:1024,n)); axis([0 50 0 50]); %axis off;
[D(n),J(n)]=max(wavemag2(:,n));
end
CA1amp=(D)
freq=(J)