Code Monkey home page Code Monkey logo

fourieranalysis.jl's Introduction

Documentation

FourierAnalysis is a signal-processing Julia package for performing the analysis of real multivariate data (e.g., multivariate time series) in the frequency domain and in the time-frequency domain. It is based upon the DSP.jl, FFTW.jl and AbstractFFTs.jl packages.

In the frequency domain FourierAnalysis computes spectra, linear and non-linear cross-spectral matrices and several linear and non-linear coherence matrices using the sliding-windows Welch method.

Time-frequency representations are obtained applying a filter-bank and the Hilbert transform. This way FourierAnalysis computes the analytic signal, from which the instantaneous amplitude (envelope) and instantaneous phase are obtained, along with several popular linear and non-linear, weighted, univariate and bivariate statistics, such as

  • mean amplitude
  • mean direction
  • phase concentration (the non-linear version of which is the directional statistic circular mean resultant length)
  • comodulation
  • coherence (the non-linear version of which is known as phase-locking values or phase coherence).

All these measures are provided in a simple and unified fashion, following the conceptual approach previously illustrated in in the context of electroencephalography (Congedo, 2018), for which all default settings have been tailored. The package has been written with the do-it-with-one-line spirit, but without sacrificing full control over relevant options.

Installation

Execute the following command in Julia's REPL:

]add FourierAnalysis

Disclaimer

Although fully functional, this package is still in a pre-release stage. It needs throughout testing. Independent reviewers are more then welcome.

About the Author

Marco Congedo is a Research Director of CNRS (Centre National de la Recherche Scientifique), working at UGA (University of Grenoble Alpes), in Grenoble (France), the city where Jean-Baptiste Joseph Fourier has served as a Prefect:).

Contact

first name dot last name at gmail dot com

Examples

using FourierAnalysis, Plots

# Set sampling rate (sr) and FFT window length (wl):
sr, wl = 128, 128

# Generate a sinusoidal wave at 10Hz with peak amplitude 0.5 and add some white noise:
v = sinusoidal(0.5, 10, sr, wl*16) + randn(wl*16)

# Get the power spectrum with a rectangular tapering window:
S = spectra(v, sr, wl; tapering=rectangular)

# Plot the power spectrum:
plot(S; fmax=24)

# The same syntax applies in the case of multivariate data (e.g., 4 time-series):
V = randn(wl*16, 4)
S = spectra(V, sr, wl; tapering=hamming)
plot(S)

# Get the analytic amplitude in the time-Frequency domain:
A = TFamplitude(v, sr, wl; fmax=24)

# plot the analytic amplitude:
heatmap(A.y)

Documentation

fourieranalysis.jl's People

Contributors

henry2004y avatar juliatagbot avatar marco-congedo avatar pallharaldsson avatar

Watchers

 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.