% b=load('LIFECLEF2014_BIRDAMAZON_XC_WAV_RN9224.wav_T4_Q20_J40.dat');


a=dir('/NAS3/SABIOD/public_data/TRAINING_SEB_BIRDS/TRAIN_DAT/');

% b=fopen('newdataset.csv','r');
% k=textscan(b,'%s','delimiter',',');
% fclose(b);

Tau =64;

c=[];

size(a)


%%%% BEUG ne passe pas les 10000 elements ??

for i=3:length(a)
i
clear carre

try
b = load(['/NAS3/SABIOD/public_data/TRAINING_SEB_BIRDS/TRAIN_DAT/',a(i).name]);
carre = reshape(b(:,1:Tau*floor(length(b)/Tau)),68,Tau,floor(length(b)/Tau));              
crossF = squeeze(sum(carre(2:end,:,:),2));
deltaact = squeeze(diff(crossF,1,2));

imagesc(deltaact)
axis off
eval(['print -dpng DELTA_ACT64/PNG/', a(i).name, 'Tau64.png'])
save(['DELTA_ACT64/TXT/',a(i).name(1:end-11),'Tau64.txt'],'deltaact','-ascii');
catch
end
end
