-
-
Notifications
You must be signed in to change notification settings - Fork 0
Developer2
The macro definitions and macro definition of the signal function documentation is available in Macro definition and Signal function sections.
This functions returns a float number between 0 and 1. It uses the function rand() that returns a random value from 0 to RAND_MAX constant defined in stdlib.h as follows:
/* The largest number rand will return (same as INT_MAX). */
#define RAND_MAX 2147483647To limit the range of the values we use the following:
rand()%1000That will limit the range of the interval from 0 to 1000. To keep the random number between 0 and 1 we divide the result by 1000 again. And because we need more precision we cast it to float before this division:
return (float) rand()%1000/1000;The function rand() uses a random seed generated by the function srand(). To allow this seed to be random too, we use the function time(NULL) that returns the number of seconds passed since 1970-01-01. This function is called in the main function in Mvfsacrsnh.c as follows:
srand(time(NULL));This function returns the temperature value for each iteration following the steps defined in VFSA algorithm (please refer to "What is VFSA" for details). The initial temperature the damping factor are control parameters to tune the algorithm for specific problems, and they are chosen arbitrarily.
The pow() function computes the power of a number where the first value is the base and the second is a power raised to the base value. Example, to compute 4 squared:
pow(4,2);And expf() is the exponential function. Example, to find e^x use:
expf(x);
This function follows the disturb parameters step of the VFSA algorithm (please refer to "What is VFSA: vfsa algorithm" for details). The disturbance is generated in each VFSA iteration. Because VFSA is a Simulated Annealing algorithm (please refer to "VFSA adaptation for geophysical problems" for details), each iterations has its own value of temperature simulating a slow cooling schedule. To ensure random disturbance we use getRandomNumberBetween0and1() function to generate a random number to be used in the disturbance function as follows:
u=getRandomNumberBetween0and1();
disturbance = signal(u - 0.5) * temperature * (pow( (1+temperature),fabs(2*u-1) )-1);So, this calculated disturbance is used to disturb 'parameter' vector inside the aperture of a search window defined with macro definition. We use an if to check and keep the disturbed parameter inside the search window. For instance, for RN parameter:
/* Disturb RN */
disturbedParameter[0] = parameter[0] + disturbance * (RN_APERTURE);
if (disturbedParameter[0] >= Rn_MAX || disturbedParameter[0] <= Rn_MIN) {
disturbedParameter[0] = (RN_APERTURE) * getRandomNumberBetween0and1() + Rn_MIN;
}This process is done for each parameter in the parameters vector.
This function returns the non-hyperbolic CRS surface to be used in the semblance function to compute the semblance between this non-hyperbolic approximation and the seismic reflection data. This time function is calculated for each half-offset x CMP coordinates in a loop. This time function is calculated in a window defined by hMAX and mMAX macros (image bellow).
The non-hyperbolic CRS function is defined in The non-hyperbolic CRS traveltime approximation section of this wiki as a function of the RN, RNIP and BETA parameters.
This function computes the semblance between the non-hyperbolic CRS surface approximation obtained with the function nonHyperbolicCRSapp() and the seismic reflection data. The non-hyperbolic CRS function is stored in the 'teta' vector updated as follows:
nonHyperbolicCRSapp(teta,m0,dm,om,dh,oh,t0,v0,RN,RNIP,BETA);This function loops over half-offset x CMP samples in the non-hyperbolic CRS surface in the window where this surface is defined. And it uses the time teta(h,m) to locate the correspondent sample in the seismic reflection data to stack the amplitudes A(h,m,teta(h,m)).
In the definition of the semblance function bellow, the variable x represents the amplitude sample in function of time t. The semblance function is the sum of the amplitudes in the window divided by sum of the amplitudes squared. This summation is divided by the number of samples in the window.
The stack window is the non-hyperbolic CRS surface in the rectangle where that surface is defined. So, the semblance is a value between 0 and 1 of amplitudes stacking of the seismic reflection data over a surface. And it will be closer to 1 if thes approximation surface fits the data (please refer to "What is VFSA?" to see an image of this stacking process).
Rodolfo Dirack - @dirack – [email protected]
All rights reserved - Distributed above GPL3 license. See LICENSE to more information.