%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
%[waveXSD,f] = csd(waveFilt(:,35),waveFilt(:,23),256,1000);
%plot(f, abs(waveXSD)); axis([0 50 0 0.02]); 
figure
for n=1:64
[waveXSD,f] = csd(waveFilt(:,n),waveFilt(:,19),256,1000);
subplot(8,8,n); plot(f, abs(waveXSD)); axis([0 50 0 0.02]); axis off;
[C(n),I(n)]=max(abs(waveXSD));
end
amp=reshape(C,8,8)'
freq=reshape(I,8,8)'