function [csd7_63] = onedimCSDout(data, time);

% [csd1_8, interp_csd1_8, csd9_16, interp_csd9_16, csd17_24, interp_csd17_24, ...
     %   csd25_32, interp_csd25_32, csd33_40, interp_csd33_40, csd41_48, interp_csd41_48, ...
     %   csd49_56, interp_csd49_56, csd57_64, interp_csd57_64, varagout] = onedimCSD(data);
%waveFilt = BudapestbandPass(lfp(:,1:64),3000,10,25);
wave = BudapestbandPass(data(:,2:65),1000,5,50,1000);
%data=waveFilt;
%time=lfp(1:end,65);

rev=fliplr(time);
t=cat(2,-rev,time);
t=t';
extra1(1:1000,1)=0;
extra2(1:1000,1)=0;
extra9(1:1000,1)=0;
extra10(1:1000,1)=0;
wave8_64=[extra1 extra2 data(:,8) data(:,16) data(:,24) data(:,32) data(:,40) data(:,48) data(:,56) data(:,64) extra9 extra10 ];
wave7_63=[extra1 extra2 data(:,7) data(:,15) data(:,23) data(:,31) data(:,39) data(:,47) data(:,55) data(:,63) extra9 extra10 ];
wave6_62=[extra1 extra2 data(:,6) data(:,14) data(:,22) data(:,30) data(:,38) data(:,46) data(:,54) data(:,62) extra9 extra10 ];
wave5_61=[extra1 extra2 data(:,5) data(:,13) data(:,21) data(:,29) data(:,37) data(:,45) data(:,53) data(:,61) extra9 extra10 ];
wave4_60=[extra1 extra2 data(:,4) data(:,12) data(:,20)  data(:,28) data(:,36) data(:,44) data(:,52) data(:,60) extra9 extra10 ];
wave3_59=[extra1 extra2 data(:,3) data(:,11) data(:,19) data(:,27) data(:,35) data(:,43) data(:,51) data(:,59) extra9 extra10 ];
wave2_58=[extra1 extra2 data(:,2) data(:,10) data(:,18) data(:,26) data(:,34) data(:,42) data(:,50) data(:,58) extra9 extra10 ];
wave1_57=[extra1 extra2 data(:,1) data(:,9) data(:,17) data(:,25) data(:,33) data(:,41) data(:,49) data(:,57) extra9 extra10 ];

%x=wave8_64(1:1000,1:12);
%nCh=size(x,2);
%step=2; %step size
%csdch=[step+1:nCh-step];
%csd8_64=-(x(:,csdch+step)-2*x(:,csdch)+x(:,csdch-step));
%interp_csd8_64=interp2(csd8_64,2,'linear');
%x=[0 130]; y=[0 11];
%figure
%subplot (1,9,8); colorbar
%imagesc(x,y,interp_csd8_64'); ylabel ('Channel'); xlabel ('Time (ms)');
%hold on;
%t=(130/3000:130/3000:130);
%plot(t,-(wave8_64(:,5))*50000+3,'k');


x=wave7_63(1:1000,1:12);
nCh=size(x,2);
step=2; %step size
csdch=[step+1:nCh-step];
csd7_63=-(x(:,csdch+step)-2*x(:,csdch)+x(:,csdch-step));
interp_csd7_63=interp2(csd7_63,2,'linear');
lessinterp_csd7_63=interp_csd7_63(500:700,:);
x=[0 200]; y=[0 11];
%subplot (1,9,7)
figure
imagesc(x,y,lessinterp_csd7_63');axis off;
%hold on;
%t=(130/3000:130/3000:130);
%plot(t,-(wave7_63(:,5))*50000+3,'k');


%x=wave6_62(1:5000,1:12);
%nCh=size(x,2);
%step=2; %step size
%csdch=[step+1:nCh-step];
%csd6_62=-(x(:,csdch+step)-2*x(:,csdch)+x(:,csdch-step));
%interp_csd6_62=interp2(csd6_62,2,'linear');
%x=[0 130]; y=[0 11];
%subplot (1,9,6)
%imagesc(x,y,interp_csd6_62'); axis off;
%hold on;
%t=(130/3000:130/3000:130);
%plot(t,-(wave6_62(:,5))*50000+3,'k');

%x=wave5_61(1:10000,1:12);
%nCh=size(x,2);
%step=2; %step size
%csdch=[step+1:nCh-step];
%csd5_61=-(x(:,csdch+step)-2*x(:,csdch)+x(:,csdch-step));
%interp_csd5_61=interp2(csd5_61,2,'linear');
%x=[0 130]; y=[0 11];
%subplot (1,9,5)
%imagesc(x,y,interp_csd5_61'); axis off;
%hold on;
%t=(130/3000:130/3000:130);
%plot(t,-(wave5_61(:,5))*50000+3,'k');


%x=wave4_60(1:10000,1:12);
%nCh=size(x,2);
%step=2; %step size
%csd4_60=-(x(:,csdch+step)-2*x(:,csdch)+x(:,csdch-step));
%interp_csd4_60=interp2(csd4_60,2,'linear');
%x=[0 130]; y=[0 11];
%subplot (1,9,4)
%imagesc(x,y,interp_csd4_60'); axis off;
%hold on;
%t=(130/3000:130/3000:130);
%plot(t,-(wave4_60(:,5))*50000+3,'k');



%x=wave3_59(1:10000,1:12);
%nCh=size(x,2);
%step=2; %step size
%csdch=[step+1:nCh-step];
%csd3_59=-(x(:,csdch+step)-2*x(:,csdch)+x(:,csdch-step));
%interp_csd3_59=interp2(csd3_59,2,'linear');
%x=[0 130]; y=[0 11];
%subplot (1,9,3)
%imagesc(x,y,interp_csd3_59'); axis off;
%hold on;
%t=(130/3000:130/3000:130);
%plot(t,-(wave3_59(:,5))*50000+3,'k');


%x=wave2_58(1:10000,1:12);
%nCh=size(x,2);
%step=2; %step size
%csdch=[step+1:nCh-step];
%csd2_58=-(x(:,csdch+step)-2*x(:,csdch)+x(:,csdch-step));
%interp_csd2_58=interp2(csd2_58,2,'linear');
%x=[0 130]; y=[0 11];
%subplot (1,9,2)
%imagesc(x,y,interp_csd2_58'); axis off;
%hold on;
%t=(130/3000:130/3000:130);
%plot(t,-(wave2_58(:,5))*50000+3,'k');


%x=wave1_57(1:9216,1:12);
%nCh=size(x,2);
%step=2; %step size
%csdch=[step+1:nCh-step];
%csd1_57=-(x(:,csdch+step)-2*x(:,csdch)+x(:,csdch-step));
%interp_csd1_57=interp2(csd1_57,2,'linear');
%x=[0 130]; y=[0 11];
%subplot (1,9,1)
%imagesc(x,y,interp_csd1_57'); axis off;
%hold on;
%t=(130/3000:130/3000:130);
%plot(t,-(wave1_57(:,5))*50000+3,'k');

%vertcsd=cat(2,csd1_57,csd2_58,csd3_59,csd4_60,csd5_61,csd6_62,csd7_63,csd8_64);

%figure; 
%for n=1:64
%subplot (8,8,n); plot (time(800:1000),vertcsd(800:1000,n)); title ('vert'); axis ([800 1000 -0.1 0.1]);
%end