diff options
-rw-r--r-- | Physikunit.pas | 18 |
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 |