diff --git a/matlab/peak_detect.m b/matlab/peak_detect.m index ad8961c..b4a10ea 100644 --- a/matlab/peak_detect.m +++ b/matlab/peak_detect.m @@ -131,13 +131,13 @@ for k=1:numFrames % Sort peaks [v, n] = sort((X-Xm)(peak_pos), 'descend'); - peak_cand_sorted = peak_pos(n); + peak_pos_sorted = peak_pos(n); % Construct peak boxes peak_pos = []; peak_boxes_rel = zeros(1, Nh); peak_boxes_abs = zeros(1, Nh); - for x = peak_cand_sorted, + for x = peak_pos_sorted, % Find peak widths left = x; @@ -209,7 +209,7 @@ for k=1:numFrames Xm(n) = last; end end - + % Create peak boxes with correct absolute height peak_box_values = Xm; peak_box_values((peak_boxes_rel > 0)) = peak_boxes_abs(peak_boxes_rel > 0);