From d3946d1bc558854811213817f718a603fe62b088 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 3 Aug 2018 16:00:12 +0200 Subject: subzykel-Verschiebung sollte nicht in absShift landen --- romunit.pas | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) (limited to 'romunit.pas') diff --git a/romunit.pas b/romunit.pas index 7782814..a3289c5 100644 --- a/romunit.pas +++ b/romunit.pas @@ -594,29 +594,18 @@ end; procedure gesamtverschiebung(var inPuls,outPuls: tExtPointArray; var absShift: extended); var - iMax,oMax,i: longint; + oMin,i: longint; begin - iMax:=0; - for i:=1 to length(inPuls)-1 do - if inPuls[i]['y']>inPuls[iMax]['y'] then - iMax:=i; - oMax:=0; - for i:=1 to length(outPuls)-1 do - if outPuls[i]['y']>outPuls[oMax]['y'] then - oMax:=i; - if absShift<-0.9e9 then - absShift:=outPuls[oMax]['x']-inPuls[iMax]['x'] - else - absShift:=(outPuls[oMax]['x']-inPuls[iMax]['x'])-round((outPuls[oMax]['x']-inPuls[iMax]['x'])-absShift); - for i:=0 to length(outPuls)-1 do outPuls[i]['x']:=outPuls[i]['x']-absShift; - oMax:=0; - while (oMax0 then + dec(oMin); + for i:=oMin to length(outPuls)-1 do + outPuls[i-oMin]:=outPuls[i]; + setlength(outPuls,length(outPuls)-oMin); cut(inPuls,outPuls[length(outPuls)-1]['x']); writeln(stderr,'Die konstante Verschiebung wurde auf '+floattostr(absShift)+' T optimiert.'); end; -- cgit v1.2.3-70-g09d2