-
Notifications
You must be signed in to change notification settings - Fork 1
/
NoveltyPeaks.asv
61 lines (46 loc) · 1.83 KB
/
NoveltyPeaks.asv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
function [NewTimeStamp,LblFeatVI,FileNamelblMLP_Pks,FileNamelblMLP_SimMat,FileNamelblMLP_Nov]=NoveltyPeaks(FileNameTimeStamp,FileNamelblMLP,FileNamelblMLP_oneCol,Kw,med_len,movav_len,vicin,thresh)
% NewTimeStamp=cell(szdata,1);
% LblFeatVI=cell(szdata,1);
%
% RptFeat=cell(szdata,1);
% ZrFeatVI=cell(szdata,1);
%
% FileNamelblMLP_Pks=cell(szdata,1);
% FileNamelblMLP_SimMat=cell(szdata,1);
% FileNamelblMLP_Nov=cell(szdata,1);
%
TimeE=FileNameTimeStamp(1):FileNameTimeStamp(end);
locatn_nz=ismember(TimeE,FileNameTimeStamp);
% ER_conc(:,2)=nonzeros(ER_mn(:,2)); %store only the non-zero values (non silences)
% locatn_nz_ER_mn=ER_mn(:,2)~=0; %we can get back original tpe from this by audioinfo_tpe(locatn_nz_audioinfo==1) = info_tpe;
nz_l= locatn_nz~=0;
FtrInstRpt=zeros(length(TimeE),2);
FtrInstRpt(nz_l,:)=(FileNamelblMLP);
FtrZrVI=FtrInstRpt;
LblInstRpt=zeros(length(TimeE),1);
LblInstRpt(nz_l)=(FileNamelblMLP_oneCol);
for i=2:length(FtrInstRpt)
if FtrInstRpt(i,1)==0
FtrInstRpt(i,:)=FtrInstRpt(i-1,:);
end
end
lctn_stillzr=FtrInstRpt(:,2)==0;
nz_stlzr=find(lctn_stillzr~=0);
if isempty(nz_stlzr)~=1
FtrInstRpt(nz_stlzr,2)=FtrInstRpt(nz_stlzr(end),2);
end
NewTimeStamp=TimeE;
RptFeat=FtrInstRpt;
ZrFeatVI=FtrZrVI;
LblFeatVI=LblInstRpt;
clear LblInstRpt FtrZrVI FtrInstRpt TimeE;
for i=1:szdata
[SimMat,novScr]=SDM_nov(Kw,'Euclidean',RptFeat{i});
novScr=novScr/max(novScr);
peak_feat=peak_pick(NewTimeStamp{i},novScr,med_len,movav_len,vicin,thresh);
FileNamelblMLP_SimMat{i}=SimMat;
peak_feat=[min(NewTimeStamp{i}) max(novScr) ;peak_feat; NewTimeStamp{i}(end) max(novScr)];
FileNamelblMLP_Pks{i}=peak_feat;
FileNamelblMLP_Nov{i}=novScr;
clear peak_feat;
end