% b = load('CAT.dat');

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


carre = reshape(b(:,1:68*floor(length(b)/68)),68,68,floor(length(b)/68));              
crossF = std(carre(2:end,:,:),0,1)./mean(carre(2:end,:,:),1) ;
crossT = std(carre(2:end,:,:),0,2)./mean(carre(2:end,:,:),2) ;

mF = median(squeeze(crossF));                           
mT = median(squeeze(crossT));                           
R =  mF ./ mT ;

R( median(squeeze(carre(1,:,:)))<0) =inf;                                           

[ v iq ]= sort(R);                                      
iq(1:2)


for i = 1:20 ; subplot(5,4,i) ; imagesc(squeeze(carre(2:end,:,iq(i)))); title([num2str(median(squeeze(carre(1,:,iq(i))))) ,' ' , num2str(iq(i))]) ; end ; 
eval(['print best' num2str(i) '.png -dpng']);

iq(1:10)

