Commit 842ee754 authored by Ling Sun's avatar Ling Sun
Browse files

minor refinement

parent b380dd5f
......@@ -50,14 +50,14 @@ for m=1:21
end
% Get the optimal path for all asini searched
[sc,m]=max(sc)
path=path0(m,:)
[maxsc,a0ind]=max(sc)
path=path0(a0ind,:)
% Save output file for each 1-Hz sub-band
fid=fopen(outfile,'wt');
fprintf(fid,'StartFreq\t%g\n',startFreq);
fprintf(fid,'Score\t%g\n',sc);
fprintf(fid,'Bin_a0\t%g\n',m);
fprintf(fid,'Score\t%g\n',maxsc);
fprintf(fid,'Bin_a0\t%g\n',a0ind);
fprintf(fid,'Path');
fprintf(fid,'\n%d',path);
fclose(fid);
......
......@@ -41,19 +41,11 @@ end
% Sort the paths
disp('backward')
% Comment out the code sorting the best n paths
% D=10;
% maxtab=peakdet(delta(:,T),D);
% [s,n]=sort(maxtab(:,2),'descend');
% ind=round(maxtab(n,1));
% Nind=length(ind);
Nind=1; % Only identify the optimal path
[s,ind]=max(delta(:,T));
score=(s-mean(delta(:,T)))/std(delta(:,T));
for n=1:Nind
[path(n,T)] = ind(n);
for t=T-1:-1:1
path(n,t) = psi(path(n,t+1),t+1);
end
% Only identify the optimal path
[sc,path(T)]=max(delta(:,T));
score=(sc-mean(delta(:,T)))/std(delta(:,T));
for t=T-1:-1:1
path(t) = psi(path(t+1),t+1);
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment