Giter Site home page Giter Site logo

cross-wavelet-transform's Introduction

CODE for MEASURING SEISMIC TRAVEL-TIME CHANGES with the WAVELET METHOD

This python program is based on the work of Mao and Mordret, that you can find here : https://github.com/shujuanmao/dt-wavelet

The original code was in MATLAB, and here is the Python equivalent

Contact : Higueret Quentin ([email protected]) and Aurélien Mordret ([email protected])

This package contains codes and test data for measuring seismic travel-time shifts in the time-frequency domain using the wavelet cross-spectrum analysis.

Requirements

All the files must be in the same folder when you launch the program

Python 3 and the PyCWT packages from https://github.com/regeirk/pycwt are needed to run the codes

You can use pip to install this package :

$ pip install pycwt

Contents in this package

  • xwt.py

    The core function to calculate dt in the time-frequency domain by wavelet cross-spectrum analysis.

  • plotting_example.py

    An example of using the cwt function on synthetic data. Plots come with one click.

  • ori_waveform.npy
    new_waveform.npy

    Two synthetic waveforms for testing the codes, ori_waveform and new_waveform
    The synthetic seismograms are generated using velocity models by a homogeneous background superimposed with random heterogeneities.
    The perturbation between the current and reference velocity models is a 0.05% homogeneous dv/v throughout the medium. (If interested, see Section 3.1 in the following reference for more details.)

  • time.npy
    fs.npy

    The time vector and sampling frequency associated with the synthetic waveforms

Usage

WXamp, WXspec, WXangle, Wcoh, WXdt, freqs = xwt(trace_ref,trace_current,fs,ns,nt,vpo,freqmin,freqmax,nptsfreq)
  • Input

    trace_ref,trace_current : Two vectors, reference and current time series.
    fs : Sampling Frequency // Positive scalar, sampling frequency.
    ns : NumScalesToSmooth // Positive integer, indicating the length of boxcar window.
    nt : DegTimeToSmooth // Positive scalar, indicating the length of the Gaussian window.
    vpo : VoicesPerOctave // Even integer from 4 to 48, indicates how fine the frequency is discretized. Should be no less than 10.
    freqmin : The starting value of the frequency vector, in Hz.
    freqmax : The ending value of the frequency vector, in Hz.
    nptsfreq : Number of frequency samples to generate between the starting and ending value.

  • Output

    WXamp : Matrix of amplitude product of two CWT in time-frequency domain.
    WXspec : Complex-valued matrix, the wavelet cross-spectrum.
    WXangle : Matrix of the angle of the complex argument in WXspec.
    Wcoh: Matrix of wavelet coherence.
    WXdt : Matrix of time difference and phase difference, respectively between the two input time series in time-frequency domain.
    freqs : Vector of frequencies used in CWT, in Hz

Plotting Example

Using the cwt function and the synthetic data, we can perform a cross-wavelet transform.
This is the plot we obtain using the plotting_example.py program :

Size Limit CLI

(If interested, compare the image obtain here with the Figure 3 in this article Geophysical Journal International, Volume 221, Issue 1, April 2020, Pages 550–568, https://doi.org/10.1093/gji/ggz495)

Coming soon

Implementation of the cone of influence for each frequency bands

Reference

S.Mao, A.Mordret, M.Campillo, H.Fang, R.D.van der Hilst, (2019), On the Measurement of Seismic Travel-Time Changes in the Time-Frequency Domain with Wavelet Cross-Spectrum Analysis, GJI, In Review.

Torrence, C. and Compo, G. P.. A Practical Guide to Wavelet Analysis.

cross-wavelet-transform's People

Contributors

qhig avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.