Ambient Noise Cross-Correlation in Julia
Author tclements
33 Stars
Updated Last
27 Days Ago
Started In
April 2019

SeisNoise.jl ๐Ÿ”‰ ๐ŸŒŽ

SeisNoise.jl is designed for fast and easy ambient noise cross-correlation on the CPU and GPU in Julia.

Documentation Build Status Coverage Chat
Build Status Coverage Status

Noise.jl Logo


You can install the latest version of SeisNoise using the Julia package manager (Press ] to enter pkg). From the Julia command prompt:

(@v1.5) pkg> add SeisNoise

Or, equivalently, via the Pkg API:

julia> import Pkg; Pkg.add("SeisNoise")

We recommend using the latest version of SeisNoise by updating with the Julia package manager:

(@v1.5) pkg> update SeisNoise

Package Features


  • Built upon SeisIO for easy and fast I/O.
  • Custom structures for storing Raw Data, Fourier Transforms of data, and cross-correlations
  • CPU/GPU compatible functions for cross-correlation.
  • Methods for dv/v measurements.
  • Coming soon: Dispersion analysis.

Check out the SeisNoise GPU tutorial on NextJournal!

SeisNoise Cross-Correlation Example

Once you have installed the package you can type using SeisNoise to start cross-correlating. SeisNoise uses a functional syntax to implement cross-correlation. For example

using SeisNoise, SeisIO
fs = 40. # sampling frequency in Hz
freqmin,freqmax = 0.1,0.2 # min and max frequencies
cc_step, cc_len = 450, 1800 # corrleation step and length in S
maxlag = 60. # maximum lag time in correlation
s = "2019-02-03"
t = "2019-02-04"
S1 = get_data("FDSN","CI.SDD..BHZ",src="SCEDC",s=s,t=t)
S2 = get_data("FDSN","CI.PER..BHZ",src="SCEDC",s=s,t=t)
R = RawData.([S1,S2],cc_len,cc_step)
FFT = rfft.(R)
C = correlate(FFT[1],FFT[2],maxlag)

will produce this figure:


Cross-correlation on the GPU

SeisNoise can process data and compute cross-correlations on the GPU with CUDA. The JuliaGPU suite provides a high-level interface for CUDA programming through the CUDA.jl package. CUDA.jl provides an the CuArray type for storing data on the GPU. Data in SeisNoise structures (R.x, F.fft, and C.corr fields, for RawData, FFTData, and CorrData, respectively) can move between an Array on the CPU to a CuArray on the GPU using the gpu and cpu functions, as shown below.

โš ๏ธ Only Nvidia GPUs are suported at the moment. Hold in there for AMD/OpenCL support...

# create raw data and send to GPU
R = RawData(S1, cc_len, cc_step) |> gpu
72000ร—188 CUDA.CuArray{Float32,2,Nothing}

# send data back to the CPU
R = R |> cpu
72000ร—188 Array{Float32,2}

All basic processing remains the same on the GPU. Here is a complete cross-correlation routine on the GPU:

# send data to GPU
R1 = RawData(S1, cc_len, cc_step) |> gpu
R2 = RawData(S2, cc_len, cc_step) |> gpu
R = [R1,R2]

# preprocess on the GPU

# Real FFT on GPU
FFT = rfft.(R)

# compute correlation and send to cpu
C = correlate(FFT[1],FFT[2],maxlag) |> cpu

Routines Implemented on the GPU

gpu times

Processing times for a selection of routines on the GPU with Julia + GPU (white), Julia + CPU (black), and Python (grey). Currently these operations are implemented in SeisNoise on the GPU:

  • Preprocessing:
    • detrend,demean, taper, onebit, smooth
  • Filtering:
    • bandpass, bandstop, lowpass, highpass
  • Fourier Domain:
    • whiten, rfft, irfft
  • Cross-correlation:
    • correlate, cross-coherence, deconvolution
  • Post-processing:
    • stack, filters, etc..

Cite SeisNoise

If you use SeisNoise in your work, please star the package and cite our work DOI: 10.1785/0220200192:

  author = {Clements, Timothy and Denolle, Marine A.},
  title = {SeisNoise.jl: Ambient Seismic Noise Cross Correlation on the CPU and GPU in Julia},
  journal = {Seismological Research Letters},
  year = {2020},
  month = {09},
  issn = {0895-0695},
  doi = {10.1785/0220200192},
  url = {},
  eprint = {},


We welcome folks interested in contributing to SeisNoise. Please open an issue to let us know about bug reports, new methods/code, and or feature requests/usage cases. If you would like to submit a pull request (PR), please include accompanying tests.

Used By Packages

No packages found.