From 674fa0edf8db245d0bb78f95b87b06dbd72ef645 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 30 Jul 2018 16:04:48 +0200 Subject: romunit.pas: Fenstermitte zum Fenstern wird nun nicht am Maximum, sonder am Halbwert des Peak-to-Peak festgelegt --- romunit.pas | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/romunit.pas b/romunit.pas index 28e0df5..bfd4ca9 100644 --- a/romunit.pas +++ b/romunit.pas @@ -1063,7 +1063,8 @@ procedure fenstern(var dat: tExtPointArray; breite: extended; alteMitte: boolean var i,j,len: longint; extrema: tLongintArray; - pp,mpp: extended; + pps: tExtendedArray; + mpp: extended; begin if not alteMitte then begin setlength(extrema,0); @@ -1077,19 +1078,31 @@ begin inc(len); end; setlength(extrema,len); - fensterMitte:=-1; - mpp:=-1; + setlength(pps,len); for i:=0 to length(extrema)-1 do begin - pp:=-1; + pps[i]:=-1; for j:=0 to length(extrema)-1 do if (abs(dat[extrema[j]]['x']-dat[extrema[i]]['x'])<2) and - (abs(dat[extrema[j]]['y']-dat[extrema[i]]['y'])>pp) then - pp:=abs(dat[extrema[j]]['y']-dat[extrema[i]]['y']); - if pp>mpp then begin - mpp:=pp; - fensterMitte:=extrema[i]; - end; + (abs(dat[extrema[j]]['y']-dat[extrema[i]]['y'])>pps[i]) then + pps[i]:=abs(dat[extrema[j]]['y']-dat[extrema[i]]['y']); end; + mpp:=pps[0]; + for i:=0 to length(pps)-1 do + if pps[i]>mpp then + mpp:=pps[i]; + i:=0; + while (i=0) and + (pps[j]