%load('C:\Users\USER\Documents\mingfaifong\haruki17898\haruki17898_nowaveform.mat');

w(1,:) = [3 4 5 12 13 20 21 28 29];
w(2,:) = [7 14 15 16 22 23 24 30 31];
w(3,:) = [38 39 40 46 47 48 55 56 63];
w(4,:) = [36 37 44 45 52 53 60 61 62];
w(5,:) = [34 35 41 42 43 49 50 51 58];
w(6,:) = [2 9 10 17 18 19 25 26 27];

dt = 1;
bins = 0:dt:max(time);
asdr = zeros(6,length(bins));

for i = 1:6
    t{i} = time(clean==1 & ismember(channel,w(i,:))==1);
    %c{i} = channel(clean==1 & ismember(channel,w(i,:))==1);
    asdr(i,:) = hist(t{i},bins)/dt;
end

%% plot stuff
for i = 1:6
    subplot(6,1,i)
    plot(bins/3600,asdr(i,:),'-k');
    ylim([0 600]);
    set(gca,'XTick',0:4:max(time)/3600);
    ylabel('ASDR (Hz)');
end

xlabel('Time (hours)');