Basin Research at Penn State
College of Earth and Mineral Sciences and The Department of Geosciences
sp

 

Contact Information:
Prof. Peter Flemings
Dept. of Geosciences

Penn State University
307 Deike Building
University Park, PA 16802
814.865.2309

Match Filtering

Derive and Apply a Match Filter, One Trace at a Time


Steps:
1) Export two traces from ProMAX
2) Read traces into Matlab
3*) Cross-correlate traces to find amount of shift to apply
4*) Based on cross-correlation results, shift trace in ProMAX and re-export the shifted trace
5) Derive and apply the match filter using Matlab script


*Optional steps, but the match filter will achieve best results when these steps are applied.

Details:
Step 1
Export two traces for use in Match Filter program

Do this step for each trace that needs exported.  The flow to export each trace from ProMAX is:


  • Disk Data Input: Specify the trace that needs exported (Sort by 3D inline number and 3D crossline number)

  • Trace Header Math (Fixed equation mode, define the equation "temp = 0.0")
  • Header Statics: If the trace needs shifted any amount, such as after cross-correlation or if a shorter trace output is desired.  (Add the bulk static shift to the previous statics, and User Specify the First Header Word to be "temp", as the one created in the previous step)
  • Trace Length: Specify the length of the trace (in ms)
  • SEG-Y Output: Set the parameters of this module as shown below.  The DISK file path name needs to have a path, and the filename needs to end in ".sgy" (not shown below).  The text entered into the Output/override trace header entries need to be input exactly as:
CDP_X,4R,IEEE,181/CDP_Y,4R,IEEE,185/ILINE_NO,4I,,189/XLINE_NO,4I,,193/
Don't forget the double commas, or it won't work. Don't worry about spaces between terms.



Step 2

Read Traces into Matlab

First, copy these Matlab files into your Matlab home directory (right-click and save the file).  They take the data you output from ProMAX and structure it into a cube that is one-trace x one-trace x length-of-trace.
Use the following script in Matlab to read the two traces you exported into Mablab.  All the terms with numbers in them (everything that has an 84 or a 97 in it) are variables that can be changed for your own traces, but make sure that variables are consistent so the programs can run.  The Data84 and Data97 variables are the ones used for match filter calculations.

filename84 = '/home/agif/lgcbstr/1984_L760T9540.sgy'  % 1984 trace
bp84 = ReadSegyDataset(filename84,'mem')
[Data84,TraceHeaderInfo,SegyTraceHeaders,SegyHeader]=ReadSegy(filename84);

filename97 = '/home/agif/lgcbstr/1997_L760T9540.sgy'  % 1997 trace
bp97= ReadSegyDataset(filename97,'mem')
[Data97,TraceHeaderInfo,SegyTraceHeaders,SegyHeader] = ReadSegy(filename97);

The terms (Data97,TraceHeaderInfo,SegyTraceHeaders,SegyHeader) are all automatically created variables that detail information about the SEG-Y data read in by the scripts.


Step 3*
Cross-correlate to find best time-match between the two traces

In Matlab, cross-correlate the two traces using
q=xcorr(Data84,Data97);
Then plot with
caxis=-1250:1250; % for 5-s long traces with 4-ms sampling
corraxis=caxis*4;
plot(corraxis,q); grid; title('1984 cross-correlated with 1997 trace');
Zoom in at the maximum positive peak to determine the amount to shift the 1997 trace.


Step 4*
Apply static shift to trace, then re-export from ProMAX

Use the same flow as in Step 1.  In the Header Statics module, apply the amount of static shift needed.  Negative numbers shift the trace up in time.


Step 5
Derive and apply the match filter

Copy these Matlab files into your home directory (right-click and save). 
Both of these files are functions used to derive the match filter.  The function 'wiener_levinson' requires two inputs: b is the input trace and d is the desired output trace (what you want b to look like after filtering).  The function outputs fout (the actual output of b) and h (the match filter used).  The 'glev' function is used to deconvolve the filter from the input data.
 
Derive and apply the match filter with something like
b = Data97; % input trace
d = Data84; % desired output trace
[trace97filtered, h] = wiener_levinson(b,d);

And look at results with a script like
y = 0:4:5000;
figure(1); subplot(131); plot(b, y); title('Input Trace (1997 trace)'); xlim([-100 100]); grid;
subplot(132); plot(d, y); title('Desired Output (1984 trace)'); xlim([-100 100]); grid;
subplot(133); plot(trace97filtered, y); title('Filtered Output Trace'); xlim([-100 100]); grid;


Look at the scripts for more information about what is happening within them.  The wiener_levinson algorithm uses the methods described in Geophysical Signal Analysis by Robinson and Treitel, 1981 (p. 191).  The glev algorithm is a Levinson recursion method detailed in Statistical Digital Signal Processing and Modeling by M. H. Hayes, 1996 (p. 268).

Department of Geosciences | Penn State University

 

This site was last updated on August 17, 2006
Questions and suggestions may be directed to hnelson@geosc.psu.edu