load('Kylie_alone.mat'); % 419 load('all_clicks_together.mat'); % 1717 % Get only ones with db > 140 PotClicks = all_clicks_together([all_clicks_together.Amp]>140); save('PotClicks.mat', 'PotClicks'); %% VALUES NEEDED Fs = 500000; ButtOrd = 6; FFT = 512; %% KYLIE clicks % Alone % 01 Nov 2017 = 72 (8 clicks per min) % 19 Jul 2018 = 347 (16 clicks per min) % Close % 02 Nov 2016 = 367 (244 clicks per min) % 03 Nov 2016 = 525 % 04 Sep 2017 = 348 % Together % 02 Nov 2016 = 75 % 03 Nov 2016 = 39 % 04 Sep 2017 = 326 %% BOOTSTRAP HF %% Proportion of HF % FR = 0 ; low frequency clicks % When alone LF_KY = bootstrp(5000, @nnz, [Kylie_alone.FR]); CF_KYCIa = bootci(5000, @nnz, [Kylie_alone.FR]); meanKFR = mean(LF_KY)/length(Kylie_alone); % 0.2144 sdKFR = std(LF_KY)/length(Kylie_alone); % 0.0202 % When in close proximity LF_Prox = bootstrp(5000, @nnz, [KylieProx.FR]); LF_ProxCI = bootci(5000, @nnz, [KylieProx.FR]); meanProxFR = mean(LF_Prox)/length(KylieProx); % 0.4493 sdProxFR = std(LF_Prox)/length(KylieProx); % 0.0139 %% TUKEY's TEST KylieProx = all_clicks_together([all_clicks_together.Porps] == 0); HFAlone = sum([Kylie_alone.FR] == 1); % 90 out of 419 HFClose = sum([KylieProx.FR] == 1); % 557 out of 1240 X = [90 419; % alone 557 1240]; % close alpha = 0.05; tmcomptest(X, alpha); % Group proportions of the interested events are: % ------------------------------------------- % Group Proportions % ------------------------------------------- % 1 0.2148 % 2 0.4492 % ------------------------------------------- % % Tukey's multiple comparisions test among proportions, k = 2 % ------------------------------------------------------------------------- % Comparision Difference* SE q qc Decision % ------------------------------------------------------------------------- % 2 1 14.4283 1.144 12.611 2.772 S % ------------------------------------------------------------------------- % With a given significance level of: 0.05 % The multiple comparisions can be significant (S) or not significant (NS). % * After asin transformation of proportions. %% ENERGY RATIO BETWEEN > AND < 100 KHZ % Filter out LF CutOffLLF = 100000; CutOffRLF = (Fs/2)*0.99; wnLF = [CutOffLLF CutOffRLF]/(Fs/2); %design bandpass [bLF, aLF] = butter(ButtOrd, wnLF); ClickHF = filter(bLF, aLF, click); % filter the signal % Filter out HF CutOffLHF = 2000; CutOffRHF = 100000; wnHF = [CutOffLHF CutOffRHF]/(Fs/2); %design bandpass [bHF, aHF] = butter(ButtOrd, wnHF); ClickLF = filter(bHF, aHF, click); % filter the signal [PSDHF,~] = periodogram(ClickHF,[],FFT,Fs,'power'); [PSDLF,~] = periodogram(ClickLF,[],FFT,Fs,'power'); pwrLF = sum(PSDLF.^2); pwrHF = sum(PSDHF.^2); %% MEAN, MEDIAN, and SD (clicks with dB > 140) Selected = readtable('SelectedClicks.csv'); MeanRatioPorps = mean(Selected.energyratio([Selected.Porps] == 1)); % 22937 MedianRatioPorps = median(Selected.energyratio([Selected.Porps] == 1)); % 4892.3 SDRatioPorps = std(Selected.energyratio([Selected.Porps] == 1)); % 45400 MeanRatioKylieHF = mean(Selected.energyratio(([Selected.Porps] == 0) & ([Selected.fr] == 1),1)); % 22.43 MedianRatioKylieHF = median(Selected.energyratio(([Selected.Porps] == 0) & ([Selected.fr] == 1),1)); % 11.04 SDRatioKylieHF = std(Selected.energyratio(([Selected.Porps] == 0) & ([Selected.fr] == 1),1)); % 35.63 MeanRatioKylieLF = mean(Selected.energyratio(([Selected.Porps] == 0) & ([Selected.fr] == 0),1)); % 0.438 MedianRatioKylieLF = median(Selected.energyratio(([Selected.Porps] == 0) & ([Selected.fr] == 0),1)); % 0.29 SDRatioKylieLF = std(Selected.energyratio(([Selected.Porps] == 0) & ([Selected.fr] == 0),1)); % 0.432 %% SIMILARITY ANOVA KYLF = Selected.energyratio(([Selected.Porps] == 0) & ([Selected.fr] == 0),1)'; KYHF = Selected.energyratio(([Selected.Porps] == 0) & ([Selected.fr] == 1),1)'; Porps = Selected.energyratio([Selected.Porps] == 1,1)'; X1(1:85) = 1; % Kylie alone X2(1:124) = 2; % Kylie with porpoise X3(1:48) = 3; % Porpoise [p,tbl, stats] = anova1([KYLF, KYHF, Porps], [X1, X2, X3]); % Source SS df MS F Prob>F % -------------------------------------------------------------- % Groups 2.05117e+10 2 1.02558e+10 26.89 2.55325e-11 % Error 9.68729e+10 254 3.81389e+08 % Total 1.17385e+11 256 [c,~,~,gnames] = multcompare(stats); % [1,2,-6467.24,-21.99,6423.24,0.99; % 1,3,-31199.98,-22936.13,-14672.29,1.18e-09; % 2,3,-30694.84,-22914.14,-15133.43,9.71e-10]