Mercurial > hg > camir-aes2014
comparison toolboxes/bioakustik_tools/conversion/extract_buchfink_xls.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 | |
2 | |
3 %seglengths | |
4 %vols | |
5 %periods | |
6 %name | |
7 | |
8 % | |
9 % datlen=size(data,1); | |
10 % maxseglen=10; | |
11 % clear segvol; | |
12 % clear seglengths; | |
13 % clear repetitions; | |
14 % clear name; | |
15 % | |
16 % filectr=0; | |
17 % lineptr=15; | |
18 % | |
19 % while lineptr <= size(textdata,1) | |
20 % if ~strcmp('',textdata{lineptr,1}) | |
21 % path = textdata{lineptr,1}; | |
22 % end | |
23 % if ~strcmp('',textdata{lineptr,2}) | |
24 % filectr=filectr+1; | |
25 % name{filectr} = strcat(path,'\',textdata{lineptr,2}); | |
26 % datapos=lineptr-14; | |
27 % | |
28 % segctr=0; | |
29 % while ~isnan(data(datapos,2))&& datapos < datlen | |
30 % segctr=segctr+1; | |
31 % seglengths(filectr,segctr)= data(datapos,2); | |
32 % if ~isnan(data(datapos,3)) | |
33 % repetitions(filectr,segctr)=data(datapos,3); | |
34 % end | |
35 % segvol(filectr,segctr)=data(datapos,4); | |
36 % datapos=datapos+1; | |
37 % lineptr = lineptr+1; | |
38 % end | |
39 % end | |
40 % lineptr = lineptr+1; | |
41 % end | |
42 | |
43 | |
44 compl_len=sum(seglengths,2);%ins secs | |
45 compl_std=std(compl_len); | |
46 compl_mean=mean(compl_len); | |
47 | |
48 numsegs=seglengths>0; | |
49 numsegs=sum(numsegs,2); | |
50 meannumsegs=mean(numsegs) | |
51 minnumsegs=min(numsegs) | |
52 maxnumsegs=max(numsegs) | |
53 | |
54 for i=1:maxnumsegs %segmentlänge, betrachtet werden jeweils alle segs | |
55 % mit ausreichender länge | |
56 valid_cols=find(numsegs>=i); | |
57 mean_seglen(i)=mean(seglengths(valid_cols,i)); | |
58 min_seglen(i)=min(seglengths(valid_cols,i)); | |
59 max_seglen(i)=max(seglengths(valid_cols,i)); | |
60 std_seglen(i)=std(seglengths(valid_cols,i));%in s | |
61 end | |
62 | |
63 % valid_cols=find(numsegs==floor(meannumsegs)); | |
64 % for i=1:floor(mean(numsegs)) %segmentlänge, betrachtet werden jeweils alle segs | |
65 % % mit genau floor(mittlerer) länge | |
66 % mean_seglen2(i)=mean(seglengths(valid_cols,i)); | |
67 % min_seglen2(i)=min(seglengths(valid_cols,i)); | |
68 % max_seglen2(i)=max(seglengths(valid_cols,i)); | |
69 % std_seglen2(i)=std(seglengths(valid_cols,i));%in s | |
70 % end | |
71 | |
72 %längen | |
73 seglen_all=reshape(seglengths,115*6,1); | |
74 goodlens=find(seglen_all>0); | |
75 mean_seglen_all=mean(seglen_all(goodlens)); | |
76 std_seglen_all=std(seglen_all(goodlens)); | |
77 for i=1:maxnumsegs | |
78 segs(i)=sum(numsegs==i); | |
79 end | |
80 | |
81 period_segs=sum(repetitions>0,2); | |
82 for i=1:maxnumsegs | |
83 havenumperiodsegs(i)=sum(period_segs==i); | |
84 end | |
85 segs_period=(repetitions>0); | |
86 sum((period_segs==3)&(numsegs==4)) | |
87 sum((period_segs==2)&(numsegs==4)) | |
88 sum(((period_segs==4)&(numsegs==5))) | |
89 sum(((period_segs==3)&(numsegs==5))) | |
90 | |
91 better_half_ind=find((period_segs==3)&(numsegs==4)); | |
92 better_half_len=seglengths(better_half_ind,:); | |
93 better_half_mean=mean(better_half_len,1); | |
94 better_half_std=std(better_half_len); | |
95 | |
96 %wiederholungen | |
97 period_all=reshape(repetitions,115*6,1); | |
98 goodreps=find(period_all>0); | |
99 period_all=period_all(goodreps); | |
100 peri_all_mean=mean(period_all); | |
101 peri_all_std=std(period_all); | |
102 | |
103 %frequenzen | |
104 freqs = repetitions./(seglengths./1000); | |
105 freqs_all=reshape(freqs,115*6,1); | |
106 freqs_all=freqs_all(find(~isnan(freqs_all) & (freqs_all>0))); | |
107 freqs_all_mean=mean(freqs_all); | |
108 freqs_all_std=std(freqs_all); | |
109 | |
110 | |
111 better_h_f=repetitions(better_half_ind,2:4)./(seglengths(better_half_ind,2:4)./1000); | |
112 better_h_f_mean=mean(better_h_f); | |
113 better_h_f_std=std(better_h_f); | |
114 better_h_f_min=min(better_h_f); | |
115 better_h_f_max=max(better_h_f); | |
116 | |
117 better_half2_ind=find((period_segs==4)&(numsegs==5)); | |
118 | |
119 better_h2_f=repetitions(better_half2_ind,2:5)./(seglengths(better_half2_ind,2:5)./1000); | |
120 better_h2_f_mean=mean(better_h2_f); | |
121 better_h2_f_std=std(better_h2_f); | |
122 better_h2_f_min=min(better_h2_f); | |
123 better_h2_f_max=max(better_h2_f); | |
124 | |
125 abweichung_f=better_h_f-repmat(better_h_f_mean,size(better_h_f,1),1); | |
126 corrcoef(abweichung_f) | |
127 abweichung2_f=better_h2_f-repmat(better_h2_f_mean,size(better_h2_f,1),1); | |
128 corrcoef(abweichung2_f) |