summaryrefslogtreecommitdiff
path: root/romunit.pas
diff options
context:
space:
mode:
Diffstat (limited to 'romunit.pas')
-rw-r--r--romunit.pas43
1 files changed, 42 insertions, 1 deletions
diff --git a/romunit.pas b/romunit.pas
index aaab446..9437006 100644
--- a/romunit.pas
+++ b/romunit.pas
@@ -20,7 +20,8 @@ function findeExtrema(const dat: tExtPointArray; maxima: boolean): tLongintArra
procedure filtereExtrema(const dat: tExtPointArray; var extrema: tLongintArray; sollAbst, toleranz: extended);
procedure monotonieHerstellen(const dat: tExtPointArray; var minima,maxima: tLongintArray);
procedure gesamtverschiebung(var inPuls,outPuls: tExtPointArray; var absShift: extended);
-procedure integrate(var dat: tExtPointArray);
+procedure integrate(var dat: tExtPointArray); overload;
+procedure integrate(indat: tExtPointArray; out outdat: tExtPointArray); overload;
procedure removeLinearOffset(var dat: tExtPointArray);
procedure flip(var dat: tExtPointArray);
procedure vereineExtrema(const dat1,dat2: tExtPointArray; var el1,el2: tLongintArray; toleranz: extended);
@@ -28,6 +29,7 @@ procedure uniq(var dat: tExtPointArray; streng: boolean);
procedure fft(var dat: tExtPointArray);
procedure interpoliere(var dat: tExtPointArray);
procedure normiere(var dat: tExtPointArray);
+procedure berechneRefPuls(inPuls,surTraj: tExtPointArray; out cRefPuls: tExtPointArray);
type
tSortThread = class(tThread)
@@ -715,6 +717,17 @@ begin
dat[i].y:=dat[i].y * (dat[i].x-dat[i-1].x)+dat[i-1].y;
end;
+procedure integrate(indat: tExtPointArray; out outdat: tExtPointArray);
+var i: longint;
+begin
+ setlength(outdat,length(indat));
+ outdat[0]:=indat[0];
+ for i:=1 to length(indat)-1 do begin
+ outdat[i].x:=indat[i].x;
+ outdat[i].y:=indat[i].y * (indat[i].x-indat[i-1].x)+outdat[i-1].y;
+ end;
+end;
+
procedure removeLinearOffset(var dat: tExtPointArray);
var i: longint;
dx,dy: extended;
@@ -971,6 +984,34 @@ begin
dat[i].y:=dat[i].y/m;
end;
+procedure berechneRefPuls(inPuls,surTraj: tExtPointArray; out cRefPuls: tExtPointArray);
+var i,anz: longint;
+ beta: extended;
+const step=107;
+begin
+ i:=0;
+ setlength(cRefPuls,0);
+ anz:=0;
+ while (i<length(surTraj)-step) and (surTraj[i].x-surTraj[i].y<inPuls[length(inPuls)-1].x) do begin
+ while (i<length(surTraj)-step) and (inPuls[0].x>surTraj[i].x-surTraj[i].y) do
+ inc(i);
+ if i>=length(surTraj)-step then break;
+
+ if anz>=length(cRefPuls) then
+ setlength(cRefPuls,anz+32768);
+ beta:=max((surTraj[i+step].y-surTraj[i].y)/(surTraj[i+step].x-surTraj[i].x),-0.5);
+ cRefPuls[anz].x:=surTraj[i].x+surTraj[i].y;
+ cRefPuls[anz].y:=
+ (inPuls[anz].y * (inPuls[anz+step].x - surTraj[i].x+surTraj[i].y) +
+ inPuls[anz+step].y * (- inPuls[anz].x + surTraj[i].x-surTraj[i].y)) /
+ (inPuls[anz+step].x - inPuls[anz].x) *
+ (1-beta)/(1+beta);
+ inc(anz);
+ inc(i);
+ end;
+ setlength(cRefPuls,anz);
+end;
+
// tSortThread *****************************************************************
constructor tSortThread.create(pd: pTExtPointArray; sta, sto: longint);