%filters data and plots cross spectral density for 64 electrode array
%requires raw data and sampling frequency

function [f] = PlotCrossSpecDens( wave, S );

waveFilt = BudapestbandPass(wave,1000,10,40,1000);


figure
for n=1:5
[waveXSD,f] = csd(waveFilt(:,n),waveFilt(:,5),256,1000);
subplot(5,1,n); plot(f, abs(waveXSD)); axis([0 50 0 0.02]); axis off;
[C(n),I(n)]=max(abs(waveXSD));
end
amp=(C)
freq=(I)