35
Seismic Analysis Code (SAC) Filtering and Spectral Analysis

Seismic Analysis Code (SAC) Filtering and Spectral Analysis

Embed Size (px)

Citation preview

Page 1: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

Seismic Analysis Code (SAC)

Filtering and Spectral Analysis

Page 2: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

A useful commandFUNCGEN: generate various functions in

memory.

It is useful for testing the other commands on known functions.

STEP BOXCAR TRIANGLE SINE {v1 v2} LINE {v1 v2} IMPULSE QUADRATIC {v1 v2 v3}

CUBIC {v1 v2 v3 v4} DATAGEN RANDOM {v1 v2} IMPSTRIN {n1 n2 ... nN}

Page 3: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

SAC> funcgen impulse delta 0.01 npts 100SAC> p

Page 4: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

Unary Operations Module The commands in this module perform some arithmetic

operation on each data point of the signals in memory.

ADD SUB MUL DIV square (SQR) SQRT absolute value (ABS) natural (LOG) or base 10 (LOG10) logarithm compute the exponential (EXP) or base 10 exponential (EXP10) integratation (INT) differentation (DIF).

Page 5: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

SAC> funcgen impulse delta 0.01 npts 100SAC> dif #default is 2 point difference y=(x1-x0)/deltaSAC> p

Page 6: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

These commands let you perform certain signal correction operations.

• rmean: removes the mean from data.

• rtrend: removes linear trend from data.

Signal Correction Module

Page 7: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

• rglitches: removes glitches and timing marks.

• taper: applies a symmetric taper to each end of the data and SMOOTH applies an arithmetic smoothing algorithm.

• linefit: computes the best straight line fit to the data in memory and writes the results to header blackboard variables.

• reverse: reverses the order of data points.

Page 8: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

Integration – to change from acceleration to velocity to displacement.

SAC> r ccm_india_.bhzSAC> qdp offSAC> plot

Page 9: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

Integrate it (original data was vel, integrate to disp).

SAC> intSAC> p

OOPS!

Page 10: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

What is the problem?

(do you agree that there is a problem!)

Page 11: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

Integral of constant is a line. Seismic data has DC offset. So remove mean.

SAC> rSAC> rmeanSAC> intSAC> p

OOPS again!

Page 12: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

Is this an improvement?Are we getting any better?

What’s the problem now?

Page 13: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

Integral of linear fn (line) is quadratic fn (parabola). So remove trend (line)

SAC> rSAC> rtrend Slope and standard deviation are: -0.038705 0.0037565 Intercept and standard deviation are: -2365.1 15.788 Data standard deviation is: 3010.9 Data correlation coefficient is: 0.026988SAC> intSAC> p

Page 14: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

There is still some “drift”, but this is probably useful for displacement

analysis.SAC> rSAC> rtrend Slope and standard deviation are: -0.038705 0.0037565 Intercept and standard deviation are: -2365.1 15.788 Data standard deviation is: 3010.9 Data correlation coefficient is: 0.026988SAC> intSAC> r moreSAC> p1

SAC> r moreSAC> p1

displacement

velocity

Page 15: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

Differentiate velocity to acceleration.SAC> rSAC> difSAC> p

Page 16: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

SIGNAL MODULE EXAMPLESSAC> funcgen sine 10 90 delta 0.01 npts 100SAC> p

SAC> taper

Page 17: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

STRETCH: upsamples data, including an optional interpolating FIR filter, while

DECIMATE: downsamples data, including an optional anti-aliasing FIR filter.

INTERPOLATE: You can interpolate evenly or unevenly spaced data to a new sampling interval using the INTERPOLATE command.

QUANTIZE: converts continuous data into its quantized equivalent.

ROTATE: pairs of data components through a specified angle.

RQ: removes the seismic Q factor from spectral data.

Page 18: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

SAC> r II.AAK.00.BHN.Q.SAC II.AAK.00.BHE.Q.SACSAC> p1

SAC> rotate to gcp normal

Radial : SV

Transverse : SH

baz = 146º

Page 19: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

Binary Operations Module These commands perform operations on pairs of data files.

MERGE merges (concatenates) a set of files to the data in memory.

ADDF adds a set of data files to the data in memory.

SUBF subtracts a set of data files from the ones in memory.

MULF multiplies a set of data files by the data in memory.

DIVF divides the data in memory by a set of files.

BINOPERR controls errors that can occur during these binary operations.

Page 20: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

SAC> funcgen impulse delta 0.01 npts 100SAC> w impulse1.sac # max y value = 1.0SAC> div 2SAC> w impulse2.sac # max y value = 0.5SAC> r impulse1.sacSAC> addf impulse2.sac

Page 21: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

Spectral Analysis ModuleThere is a set of Infinite Impulse Response (IIR)

filtersBANDPASS (bp; pass signal within the low and high

corner cutoffs)BANDREJ (br; band reject filter does the opposite

of a bandpass)LOWPASS (lp; set a low corner cutoff value)HIGHPASS (hp; set a high corner cutoff value)

Page 22: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

Spectral Analysis Module

These recursive digital filters are all based upon classical analog designs:

Butterworth: a good choice for most applications, since it has a fairly sharp transition from pass band to stop band, and its group delay response is moderate. This is the default

Bessel: best for those applications which require linear phase without twopass filtering. It's amplitude response is not very good.

Chebyshev type I & Chebyshev type II: for situations which require very rapid transitions from pass band to stop band. Does horrible things to the phase

Page 23: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

The Butterworth and Bessel filters are easiest to set upBANDPASS {BUTTER|BESSEL|C1|C2},{CORNERS v1 v2},

{NPOLES n},{PASSES n},{TRANBW v},{ATTEN v}

SAC> funcgen datagen

SAC> rmeanSAC> taperSAC> bp butter co 1 3

#using default valuespasses (p) 1num poles (n) 2

Page 24: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

SAC> funcgen datagenSAC> bp butter co 1 3

SAC> rmeanSAC> taperSAC> bp bessel co 1 3 n 1 p 2

Page 25: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

SAC> hp butter co .2SAC> xlim t1 -120 800

Page 26: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

other filtersFinite Impulse Response filter (FIR)

Adaptive Wiener filter ( WIENER) It tailors itself to be the “best possible filter” for a given

dataset.

Two specialized filters (BENIOFF & KHRONHITE) lowpass filter is a digital approximation of an analog

filter which was a cascade of two fourth-order Butterworth lowpass filters. This lowpass filter has been used with a corner frequency of 0.1 Hz to enhance measurements of the amplitudes of the fundamental mode Rayleigh wave (Rg) at regional distances.

Page 27: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

Instrument Correction Module

This module currently contains only one command, TRANSFER.

TRANSFER: performs a deconvolution to remove one instrument response followed a convolution to apply another instrument response.

Over 40 predefined instrument responses are available. A general instrument response can also be specified in terms of its poles and zeros.

Page 28: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

SAC> funcgen datagenSAC> transfer to wa #usually you would remove the known instrument response using ‘transfer from XXX’

Why would you want to remove the instrument response and apply the response for a Wood-Anderson torsion

seismometer?

Page 29: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

Let’s say you’ve downloaded some data from IRIS, unpacked the seed volume using rdseed, and extracted the response files (RESP.NET.STA.LOC.CHAN)

SAC> r BJT*SAC> lh kstnm kcmpnm FILE: BJT.BHE_00.Q.2005.01:23:41 - 1 -------------------------------- kstnm = BJT kcmpnm = BHE FILE: BJT.BHN_00.Q.2005.01:23:41 - 2 -------------------------------- kstnm = BJT kcmpnm = BHN FILE: BJT.BHZ_00.Q.2005:01:23:41 - 3 -------------------------------- kstnm = BJT kcmpnm = BHZ

SAC> rtrendSAC> rmeanSAC> transfer from evalresp to none #reads seed response files and transforms velocity to displacement

Page 30: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

SAM: fft analysis You can do a discrete Fourier transform (FFT) and an inverse

transform (IFFT).

You can also compute the amplitude and unwrapped phase of a signal (UNWRAP). This is an implementation of the algorithm due to Tribolet.

The FFT and UNWRAP commands produce spectral data in memory. You can plot this spectral data (PLOTSP), write it to disk as ``normal'' data (WRITESP), and read in back in again (READSP).

You can also perform integration (DIVOMEGA) and differentiation (MULOMEGA) directly in the frequency domain.

Page 31: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

SAC> funcgen datagenSAC> fftSAC> plotsp

AMPLITUDE

PHASE

Page 32: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

SPECTROGRAM commandDEFAULT VALUES: SPECTROGRAM WINDOW 2 SLICE 1 METHOD

MEM ORDER 100 NOSCALING YMIN 0 YMAX FNYQUIST COLOR

SAC> funcgen datagenSAC> spectrogram ymin 0 ymax 20Window size: 200 Overlap: 100 FFT size: 512 Spectrogram dimensions are 512 by 9 .

Page 33: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

SAM: other commandsCORRELATE: computes the auto- and cross-

correlation functions.

CONVOLVE: computes the auto- and cross-convolution functions.

HANNING: applies a "hanning" window (recursive smoothing algorithm) to each data file.

Page 34: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

HILBERT: applies a Hilbert transform (90º phase shift at all frequencies in the signal). Applied twice, this flips the sign of the amplitude.

ENVELOPE: computes the envelope function using a Hilbert transform.

Page 35: Seismic Analysis Code (SAC) Filtering and Spectral Analysis

SAC> funcgen seismogramSAC> w seism.sacSAC> taperSAC> envelopeSAC> w envelope.sacSAC> r seism.sac envelope.sacSAC> color on increment onSAC> p2