 [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);

extra1(1:3000,1)=0;
extra10(1:3000,1)=0;
wave57_64=[extra1 data(:,64) data(:,63) data(:,62) data(:,61) data(:,60) data(:,59) data(:,58) data(:,57) extra10 ];
wave49_56=[extra1 data(:,56) data(:,55) data(:,54) data(:,53) data(:,52) data(:,51) data(:,50) data(:,49) extra10 ];
wave41_48=[extra1 data(:,48) data(:,47) data(:,46) data(:,45) data(:,44) data(:,43) data(:,42) data(:,41) extra10 ];
wave33_40=[extra1 data(:,40) data(:,39) data(:,38) data(:,37) data(:,36) data(:,35) data(:,34) data(:,33) extra10 ];
wave25_32=[extra1 data(:,32) data(:,31) data(:,30) data(:,29) data(:,28) data(:,27) data(:,26) data(:,25) extra10 ];
wave17_24=[extra1 data(:,17) data(:,18) data(:,19) data(:,20) data(:,21) data(:,22) data(:,23) data(:,24) extra10 ];
wave9_16=[extra1 data(:,9) data(:,10) data(:,11) data(:,12) data(:,13) data(:,14) data(:,15) data(:,16) extra10 ];
wave1_8=[extra1 data(:,1) data(:,2) data(:,3) data(:,4) data(:,5) data(:,6) data(:,7) data(:,8) extra10 ];

x=wave57_64(1:3000,1:10);
nCh=size(x,2);
step=2; %step size
csdch=[step+1:nCh-step];
csd57_64=-(x(:,csdch+step)-2*x(:,csdch)+x(:,csdch-step));
interp_csd57_64=interp2(csd57_64,2,'linear');
x=[0 130]; y=[0 9];
subplot (1,9,8); colorbar
imagesc(x,y,interp_csd57_64');
hold on;
t=(130/3000:130/3000:130);
plot(t,-(wave57_64(:,5))*50000+3,'k');


x=wave49_56(1:3000,1:10);
nCh=size(x,2);
step=2; %step size
csdch=[step+1:nCh-step];
csd49_56=-(x(:,csdch+step)-2*x(:,csdch)+x(:,csdch-step));
interp_csd49_56=interp2(csd49_56,2,'linear');
x=[0 130]; y=[0 9];
subplot (1,9,7)
imagesc(x,y,interp_csd49_56');
hold on;
t=(130/3000:130/3000:130);
plot(t,-(wave49_56(:,5))*50000+3,'k');


x=wave41_48(1:3000,1:10);
nCh=size(x,2);
step=2; %step size
csdch=[step+1:nCh-step];
csd41_48=-(x(:,csdch+step)-2*x(:,csdch)+x(:,csdch-step));
interp_csd41_48=interp2(csd41_48,2,'linear');
x=[0 130]; y=[0 9];
subplot (1,9,6)
imagesc(x,y,interp_csd41_48');
hold on;
t=(130/3000:130/3000:130);
plot(t,-(wave41_48(:,5))*50000+3,'k');

x=wave33_40(1:3000,1:10);
nCh=size(x,2);
step=2; %step size
csdch=[step+1:nCh-step];
csd33_40=-(x(:,csdch+step)-2*x(:,csdch)+x(:,csdch-step));
interp_csd33_40=interp2(csd33_40,2,'linear');
x=[0 130]; y=[0 9];
subplot (1,9,5)
imagesc(x,y,interp_csd33_40');
hold on;
t=(130/3000:130/3000:130);
plot(t,-(wave33_40(:,5))*50000+3,'k');


x=wave25_32(1:3000,1:10);
nCh=size(x,2);
step=2; %step size
csdch=[step+1:nCh-step];
csd25_32=-(x(:,csdch+step)-2*x(:,csdch)+x(:,csdch-step));
interp_csd25_32=interp2(csd25_32,2,'linear');
x=[0 130]; y=[0 9];
subplot (1,9,4)
imagesc(x,y,interp_csd25_32');
hold on;
t=(130/3000:130/3000:130);
plot(t,-(wave25_32(:,5))*50000+3,'k');



x=wave17_24(1:3000,1:10);
nCh=size(x,2);
step=2; %step size
csdch=[step+1:nCh-step];
csd17_24=-(x(:,csdch+step)-2*x(:,csdch)+x(:,csdch-step));
interp_csd17_24=interp2(csd17_24,2,'linear');
x=[0 130]; y=[0 9];
subplot (1,9,3)
imagesc(x,y,interp_csd17_24');
hold on;
t=(130/3000:130/3000:130);
plot(t,-(wave17_24(:,5))*50000+3,'k');


x=wave9_16(1:3000,1:10);
nCh=size(x,2);
step=2; %step size
csdch=[step+1:nCh-step];
csd9_16=-(x(:,csdch+step)-2*x(:,csdch)+x(:,csdch-step));
interp_csd9_16=interp2(csd9_16,2,'linear');
x=[0 130]; y=[0 9];
subplot (1,9,2)
imagesc(x,y,interp_csd9_16');
hold on;
t=(130/3000:130/3000:130);
plot(t,-(wave9_16(:,5))*50000+3,'k');


x=wave1_8(1:3000,1:10);
nCh=size(x,2);
step=2; %step size
csdch=[step+1:nCh-step];
csd1_8=-(x(:,csdch+step)-2*x(:,csdch)+x(:,csdch-step));
interp_csd1_8=interp2(csd1_8,2,'linear');
x=[0 130]; y=[0 9];
subplot (1,9,1)
imagesc(x,y,interp_csd1_8');
hold on;
t=(130/3000:130/3000:130);
plot(t,-(wave1_8(:,5))*50000+3,'k');
