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

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

waveFilt = BudapestbandPass(wave,1000,5,200);

%figure
%[waveXSD,f] = csd(waveFilt(4000:4999,24),waveFilt(4000:4999,36),256,1000);
%plot(f, waveXSD); axis([0 100 0 0.05]); 
figure
for n=1:64
[waveXSD,f] = csd(waveFilt(4000:4999,n+1),waveFilt(4000:4999,27),256,1000);
subplot(8,8,n); plot(f, waveXSD); axis([0 50 0 0.005]); set(gca,'ytick',[0 0.001 0.002 0.003 0.004 0.005]); grid on; %axis off;
end