summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2015-12-08 16:28:22 +0100
committerErich Eckner <git@eckner.net>2015-12-08 16:28:22 +0100
commit39e39a351450a0c22ee3d6d81fb39e0c40714e78 (patch)
treeeaee7a29a74fa4d6d1b2ae5cc58fbf3a06c05308
parent6826a09f24d4012dcaa6afa3518164e8a6210387 (diff)
downloadPlasmapropagation-39e39a351450a0c22ee3d6d81fb39e0c40714e78.tar.xz
fourierWindow neu in Physikunit.pas
-rw-r--r--Physikunit.pas18
1 files changed, 12 insertions, 6 deletions
diff --git a/Physikunit.pas b/Physikunit.pas
index 456ac7d..0ba1418 100644
--- a/Physikunit.pas
+++ b/Physikunit.pas
@@ -205,6 +205,7 @@ type
end;
procedure SignalCapture(signal : longint); cdecl;
+function fourierWindow(x: extended): extended; inline;
implementation
@@ -1415,9 +1416,9 @@ begin
for k:=0 to aX div 2 do // Iteration über die Werte einer Transformation
for j:=0 to aP-1 do begin // Iteration über die Transformationen
- tmp:=(fftTmp+j+k*aP)^.re; // *-i*k*2*pi;
- (fftTmp+j+k*aP)^.re:= 2*pi/dX/aX * k * (fftTmp+j+k*aP)^.im/aX * byte(3*k<aX);
- (fftTmp+j+k*aP)^.im:=- 2*pi/dX/aX * k * tmp/aX * byte(3*k<aX);
+ tmp:=(fftTmp+j+k*aP)^.re; // *i*k*2*pi;
+ (fftTmp+j+k*aP)^.re:=- 2*pi/dX/aX * k * (fftTmp+j+k*aP)^.im/aX * fourierWindow(k/aX);
+ (fftTmp+j+k*aP)^.im:= 2*pi/dX/aX * k * tmp/aX * fourierWindow(k/aX);
end;
{$IFDEF exzessiveArrayBereichsTests}
@@ -1452,9 +1453,9 @@ begin
for k:=0 to aX-1 do // Iteration über die Transformationen
for j:=0 to aP div 2 do begin // Iteration über die Werte einer Transformation
- tmp:=(fftTmp+j+k*(aP div 2 + 1))^.re; // *-i*k*2*pi;
- (fftTmp+j+k*(aP div 2 + 1))^.re:= 2*pi/dP/aP * j * (fftTmp+j+k*(aP div 2 + 1))^.im/aP * byte(3*j < aP);
- (fftTmp+j+k*(aP div 2 + 1))^.im:=- 2*pi/dP/aP * j * tmp/aP * byte(3*j < aP);
+ tmp:=(fftTmp+j+k*(aP div 2 + 1))^.re; // *i*k*2*pi;
+ (fftTmp+j+k*(aP div 2 + 1))^.re:=- 2*pi/dP/aP * j * (fftTmp+j+k*(aP div 2 + 1))^.im/aP * fourierWindow(j/aP);
+ (fftTmp+j+k*(aP div 2 + 1))^.im:= 2*pi/dP/aP * j * tmp/aP * fourierWindow(j/aP);
end;
{$IFDEF exzessiveArrayBereichsTests}
@@ -2097,6 +2098,11 @@ begin
end{of case};
end;
+function fourierWindow(x: extended): extended;
+begin
+ result:=exp(-sqr(sqr(sqr(3*x))));
+end;
+
initialization
setlength(simulationen,0);
finalization