[cig-commits] [commit] pluggable: Fixed a scaling error in convolution. (77d3ff8)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Apr 9 08:56:14 PDT 2014


Repository : ssh://geoshell/specfem3d_globe

On branch  : pluggable
Link       : https://github.com/geodynamics/specfem3d_globe/compare/64e1b38f0c5ebb4056cce0b15d41c0b9f94ab6e5...099a4d330d5b173b21e51ad441f9f429e5d37842

>---------------------------------------------------------------

commit 77d3ff8523b9dbb59d76fd29ada40b3c01fcd1a4
Author: Eh Tan <tan2 at earth.sinica.edu.tw>
Date:   Thu May 21 19:33:38 2009 +0000

    Fixed a scaling error in convolution.
    
    SAC's FFT routine normalizes the result in the forward transform already.


>---------------------------------------------------------------

77d3ff8523b9dbb59d76fd29ada40b3c01fcd1a4
 UTILS/seis_process/convolve_stf.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/UTILS/seis_process/convolve_stf.c b/UTILS/seis_process/convolve_stf.c
index 041c6c1..cd2e9c1 100644
--- a/UTILS/seis_process/convolve_stf.c
+++ b/UTILS/seis_process/convolve_stf.c
@@ -85,7 +85,7 @@ void convolve(float **pconv, sac_int_t *pnconv,
     
     fft(ccorr.xreal, ccorr.ximag, ncorr, -1);
     for (i = 0; i < nconv; ++i) {
-        conv[i] = ccorr.xreal[i] / (float)ncorr;
+        conv[i] = ccorr.xreal[i] * ncorr;
     }
     
     free(buffer);
@@ -134,7 +134,7 @@ main(int argc, char *argv[])
     data = NULL;
     for (j=3; j<argc; j++) {
         sac_int_t max, npts, nlen, nerr;
-        float beg, del, dt, origin, scale, tmp[1];
+        float beg, del, dt, origin, tmp[1];
         sac_int_t nstf, nconv, i;
         float hstf, *stf, *conv;
         char *outf;
@@ -180,7 +180,6 @@ main(int argc, char *argv[])
 
         /* get additional info */
         getfhv("delta", &dt, &nerr, strlen("delta"));
-        getfhv("scale", &scale, &nerr, strlen("scale"));
 
         getfhv("o", &origin, &nerr, strlen("o"));
         if(nerr) {
@@ -226,7 +225,7 @@ main(int argc, char *argv[])
         /* creat convolution time series */
         convolve(&conv,&nconv,data,npts,stf,nstf);
         for(i=0; i<nconv; i++)
-            conv[i] *= dt * scale;
+            conv[i] *= dt;
 
 
         /* update sac file header */



More information about the CIG-COMMITS mailing list