October 25, 2006
The analytical Fourier transform of a series of layers is computed using the addition and shift theorems. This is done without creating a sampled trace, since the Fourier transform of a layer centred at time zero is a sinc function in the frequency domain. The amplitude of the sinc at zero frequency is the area of the respective layer in time. The transform of each individual layer is then phase shifted according to its centre time. Summing the real and imaginary parts of the phase shifted transforms of each individual layer yields the transform of the series of layers as a whole. Filtering is then carried out by multiplication of the spectrum by the filter coefficients. Subsequently, a filtered trace at any desired sample interval can be generated using a conventional Discrete Fourier transform (DFT).
To determine the effects of sampling and analysis window size, it is instructive to compare the DFT spectrum of the filtered trace over a small time window with the original analytical spectrum that is not dependent upon sampling.
The accompanying Excel spreadsheet and Perl script both allow one to create a layering profile, and display that layering profile in four ways:
The author recommends that Unix/Linux users use the Perl script. Whilst there have been no reported problems using a Microsoft Windows based machine and opening the spreadsheet in Excel, when trying to open the spreadsheet from Open Office 2.0 under Linux, the graphs do not display correctly and executing the macro gives an internal scripting framework error.
For Microsft Excel users running Windows, the spreadsheet can be downloaded as either a compressed (56Kb) filter_layers.zip or uncompressed (134Kb) filter_layers.xls file from this website.
The spreadsheet workbook contains a worksheet, "Introduction", which describes the background of the computation and gives guidance to using the worksheet, "Layering and Reflectivity", which is shown below. The layer series and filter parameters are entered on this worksheet and the results are written back to it.
Layering is defined in columns "A" and "B". The end time of each layer is entered in milliseconds in column "A". The amplitude (impedance) of each layer is defined in the corresponding row of column "B". The first amplitude value represents the background impedance outside the layer-stack.
The user inputs into Cells(C2:F2) the corner points f1-f2-f3-f4 of the trapezoidal (Ormsby) filter that is to be applied to the layering.
The desired output time sample interval is entered into Cell(G2). Entering a 0 into this cell, enables the macro to determine an appropriate sample interval that will not cause aliasing. The sample interval actually applied is returned by the macro into Cell(H2).
In order to compare the analytical spectra with spectra obtained from filtered, windowed and sampled traces, the user specifies the start and end of the analysis window into Cells(I2) and Cells(J2) respectively. In order to maintain compatability with the FreeUsp program "spec" a cosine taper can be applied to the samples in the window. The taper percentage is entered in Cell(K2). For example the default taper value value for FreeUSP program "spec" is 10%.
The macro is executed by clicking on the button called "Apply Filter".
The Perl script has been tested on Linux, Unix, and Microsft Windows machines without any reported problems.
The compressed tar file layer_filter.tar.gz contains the executable Perl script, an associated Perl module file and an example input data file, "layers2.dat". After uncompressing and extracting the files from the tar file, the script is run using the command "filter_layers.pl".
The layer model is defined by inputing value pairs corresponding to the end time (ms) and impedance for each block into the lower text window. The first amplitude value represents the background impedance outside the layer-stack. Comments start with the # character. Alternatively the model can be loaded from a text file (space, tab, or comma delimited) containing a list of time/impedance pairs.
The corner frequencies of a trapezoidal (Ormsby) filter are input into the appropriate boxes.
The desired sample interval (milliseconds) for the output filtered traces is entered. Putting a 0 here enables the program to determine an appropriate sample interval that does not cause aliasing at the highest frequency selected.
To allow the analytical spectra to be compared with the DFT spectra of the filtered layering and reflectivity, the start and end time (ms) of the analysis window must be defined. In addition the analysis window can be tapered using a cosine taper, which is compatible with the FreeUSP program "spec".
The OK button displays the filtered traces and spectra in a separate window as shown below.
The input layer model, the filtered layering, filtered reflectivity and associated spectra can all be saved as files.
Perl scripts will run on all modern operating systems without major changes. Perl is highly likely to have been installed on most Unix/Linux environments as part of the standard routines. However, it is possible that the Perl/Tk module was not installed, but your sysem administrator should be able to advise you in this regard. If the Tk module is not present you can install it by logging in as root and executing the command " Perl -MCPAN -e ' install "Tk" ' ".
A free version of Perl that runs under Microsoft Windows is available from http://www.activestate.com.
Copyright 2003, 2004, 2005, 2006 Michael David Bush All rights reserved
This program and associated macros, functions and subroutines are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY. The author does not accept responsibility to anyone for the consequences of using them or for whether they serve any particular purpose or work at all, unless he says so in writing. Everyone is granted permission to copy, modify and redistribute the program, macros, functions and subroutines, but only under the condition that this notice and the above copyright notice remain intact.
Any comments/suggestions for improvement should be made to mdbush@clara.co.uk