% In these supplementary materials, we present the Octave code used to extract the % clicks parameters in the data set. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % clickS PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Computation of the parameters of the clicks from the data set % inputs : - file ’list interesting files.txt’ with the list of all files with detections % - sound files from the list % outputs : - vectors of the parameters for each detected clicks %%%%%%%%%%%%%%%%%%% % GLOBAL PARAMETERS %%%%%%%%%%%%%%%%%%% % high pass filter fcut=100000; %cutting freq order=5; % butterworth filter order % duration of a chunk of the file opened around a click detection deltatmicros=500; deltat=deltatmicros/1000000; % initialisation clicks count totalclicks=0; % Importation of file list [NameFile] = textread(’list_interesting_files.txt’, ’%s’) ; N= length(NameFile) % vectors of parameters frequencypeak_total=[]; frequencycentr_total=[]; DeltaF_3dB_total=[]; Deltat_10dB_total=[]; DeltaF_10dB_total=[]; Deltat_20dB_total=[]; DeltaF_rms_total=[]; Deltat_rms_total=[]; ICI_total=[]; w=1; % counter of the number of events %%%%%%%%%%%%%%%%%%%% % PRINCIPAL LOOP %%%%%%%%%%%%%%%%%%%% for i=1:length(NameFile) % opening of the sound file + extraction parameters namefilewav=NameFile{i} Path = 'folder of the sound files'; filewav = [Path namefilewav]; [totalsize, CHANNELS] = wavread (filewav, ”size”); [s,fm,dyn] = wavread(filewav,[1 10]); clear s; Tm=1/fm; % opening of the detection file associated to the sound file date_and_hour=namefilewav(1:15); NameFiledetect=[’Res ’,date_and_hour,’.txt’]; Path = ’% folder of the detection files ’; filedetect = [Path NameFiledetect]; [date_detection_click] = textread(filedetect, ’%f’) ; M=length(date_detection_click) % test to know if the files are in the same event (less than 20 min of separation) if i==1 msg=’change of event’ frequencypeak=[]; frequencycentr=[]; DeltaF_3dB=[]; Deltat_10dB=[]; DeltaF_10dB=[]; Deltat_20dB=[]; DeltaF_rms=[]; Deltat_rms=[]; ICI=[]; test=1; else hour_raw=str2num(NameFile{i}(10:11)); min_raw=str2num(NameFile{i}(12:13)); hour_m1_raw=str2num(NameFile{i-1}(10:11)); min_m1_raw=str2num(NameFile{i-1}(12:13)); datemin=hour_raw*60+min_raw; datemin_m1=hour_m1_raw*60+min_m1_raw; if abs(datemin-datemin m1)>20 msg=’change of event’ w=w+1; test=1; else test=0; endif endif %%%%%%%%%%%%%%%%%%%% % second loop on each detected click of the file %%%%%%%%%%%%%%%%%%%% for j=1:M % ICI computation if j>1 ICI=[ICI date_detection_click(j)-date_detection_click(j-1)]; endif % opening of the chunk of sound around the click detection t_detect=date_detection_click(j); t_entree=t_detect-deltat; t_sortie=t_detect+deltat; tfinal=t sortie-t entree; t=[0:Tm:Tm*floor(tfinal/Tm)]’; beginningN = floor(t_entree * fm); endingN = beginningN + length(t) - 1; extract=wavread(filewav,[beginningN endingN]); signal = extract(:,1); % high pass filter [butter1,butter2]=butter(order,fcut/(fm/2),’high’); sfiltre=filter(butter1,butter2,signal); [val_max imax]=max(sfiltre); t0=imax*Tm; L=length(sfiltre); % computation Delta t -10dB envelope=abs(hilbert(sfiltre)); [valmax,indexmax]=max(envelope(200:300)); indexmax=indexmax+199; valplus=valmax; incrplus=0; while valplus>valmax/sqrt(10)incrplus=incrplus+1; valplus=envelope(indexmax+incrplus); endwhile valmoins=valmax; incrmoins=0; while valmoins>valmax/sqrt(10) incrmoins=incrmoins-1; valmoins=envelope(indexmax+incrmoins); endwhile delta_t_10dB=(incrplus-incrmoins)*Tm; % computation Delta t -20dB envelope=abs(hilbert(sfiltre)); [valmax,indexmax]=max(envelope(200:300)); indexmax=indexmax+199; valplus=valmax; incrplus=0; while (valplus>valmax/10) && (incrplus<255) incrplus=incrplus+1; valplus=envelope(indexmax+incrplus); endwhile valmoins=valmax; incrmoins=0; while (valmoins>valmax/10) && (incrmoins>-255) incrmoins=incrmoins-1; valmoins=envelope(indexmax+incrmoins); endwhile delta_t_20dB=(incrplus-incrmoins)*Tm; % delta t rms energyt=std(sfiltre); MOM2t=sum((t-t0).^2 . ∗ (sfiltre.^2 )); delta_t_rms=sqrt(MOM2t/energyt); % All Delta t Deltat_10dB=[Deltat_10dB delta_t_10dB]; Deltat_20dB=[Deltat_20dB delta_t_20dB]; Deltat_rms=[Deltat_rms delta t_rms]; %%%%%%%%%%%%%%%%%%%% % Estimation peak frequency and centroid frequency by FFT % eventual window hamming=0.54-0.46*cos([0:L-1]*2*pi/(L-1)); window=hamming; % Fourier transform % sfiltre window=sfiltre.*window; sfiltre_window=sfiltre; Tfourier=fft(sfiltre_window); % zoom in frequency coefzoom=2; zoom_Tfourier=Tfourier(1:floor(L/coefzoom)); f=[1:floor(L/coefzoom)]*fm/L; duree=Tm*L; % Peak frequency energy=abs(zoom_Tfourier(90:200)); [valmax,indexmax]=max(energy); fpeak=89000+indexmax*fm/L; % Centroid frequency E=sum(energy.^2); extractf=f(90:200); MOM1=sum(extractf.*energy’.^2); fcentr=MOM1/E; % Delta f -3bB energyplus=valmax; incrplus=0; while energyplus>valmax/sqrt(2) incrplus=incrplus+1; energyplus=abs(zoom Tfourier(indexmax+100+incrplus)); endwhile energymoins=valmax; incrmoins=0; while energymoins>valmax/sqrt(2) incrmoins=incrmoins-1; energymoins=abs(zoom Tfourier(indexmax+100+incrmoins)); endwhile deltaf 3dB=incrplus-incrmoins; % Delta f -10bB energyplus=valmax; incrplus=0; while energyplus>valmax/sqrt(10) incrplus=incrplus+1; energyplus=abs(zoom Tfourier(indexmax+100+incrplus)); endwhile energymoins=valmax; incrmoins=0; while energymoins>valmax/sqrt(10) incrmoins=incrmoins-1; energymoins=abs(zoom Tfourier(indexmax+100+incrmoins)); endwhile deltaf 10dB=incrplus-incrmoins; % Delta f rms E=sum(energy.^2); MOM2f=sum((extractf-fcentr).^2.*energy’.^2); deltaf rms=sqrt(MOM2f/E); % All frequency and bandwidth frequencypeak=[frequencypeak fpeak]; frequencycentr=[frequencycentr fcentr]; DeltaF_3dB=[DeltaF_3dB deltaf_3dB]; DeltaF_10dB=[DeltaF_10dB deltaf_10dB]; DeltaF_rms=[DeltaF_rms deltaf_rms]; endfor if (test==1) | (i == N ) frequencypeak_total=[frequencypeak_total frequencypeak]; frequencycentr_total=[frequencycentr_total frequencycentr]; DeltaF_3dB_total=[DeltaF_3dB_total DeltaF_3dB]; Deltat_10dB_total=[Deltat_10dB_total Deltat_10dB]; DeltaF_10dB_total=[DeltaF_10dB_total DeltaF_10dB]; Deltat_20dB_total=[Deltat_20dB_total Deltat_20dB]; DeltaF_rms_total=[DeltaF_rms_total DeltaF_rms]; Deltat_rms_total=[Deltat_rms_total Deltat_rms]; ICI_total=[ICI total_ICI]; frequencypeak=[]; frequencycentr=[]; DeltaF_3dB=[]; Deltat_10dB=[]; DeltaF_10dB=[]; Deltat_20dB=[]; DeltaF_rms=[]; Deltat_rms=[]; ICI=[]; endif % computation of the total number of clicks totalclicks=totalclicks+M; endfor