|
| 1 | +| **Documentation** | |
| 2 | +|:---------------------------------------:| |
| 3 | +| [](https://Marco-Congedo.github.io/FourierAnalysis.jl/dev) | |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +**FourierAnalysis** is a signal-processing [**Julia**](https://julialang.org/) package for |
| 8 | +performing the analysis of *real multivariate data* (e.g., multivariate time series) |
| 9 | +in the *frequency* domain and in the *time-frequency* domain. It is based upon the |
| 10 | +[DSP.jl](https://github.com/JuliaDSP/DSP.jl), [FFTW.jl](https://github.com/JuliaMath/FFTW.jl) and [AbstractFFTs.jl](https://github.com/JuliaMath/AbstractFFTs.jl) packages. |
| 11 | + |
| 12 | +In the frequency domain *FourierAnalysis* computes **spectra**, *linear* and |
| 13 | +*non-linear* **cross-spectral matrices** and several *linear* and *non-linear* **coherence matrices** using the sliding-windows [Welch method](https://en.wikipedia.org/wiki/Welch%27s_method). |
| 14 | + |
| 15 | +Time-frequency representations are obtained applying a |
| 16 | +[filter-bank](https://en.wikipedia.org/wiki/Filter_bank) and the |
| 17 | +[Hilbert transform](https://en.wikipedia.org/wiki/Hilbert_transform). |
| 18 | +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 |
| 19 | +- **mean amplitude** |
| 20 | +- **mean direction** |
| 21 | +- **phase concentration** (the non-linear version of which is the directional statistic *circular mean resultant length*) |
| 22 | +- **comodulation** |
| 23 | +- **coherence** (the non-linear version of which is known as *phase-locking values* or *phase coherence*). |
| 24 | + |
| 25 | +All these measures are provided in a simple and unified fashion, following the conceptual approach previously illustrated in |
| 26 | +in the context of electroencephalography ([Congedo, 2018](https://hal.archives-ouvertes.fr/hal-01868538v2/document)), 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. |
| 27 | + |
| 28 | +## Installation |
| 29 | + |
| 30 | +Execute the following command in Julia's REPL: |
| 31 | + |
| 32 | + ]add FourierAnalysis |
| 33 | + |
| 34 | +## Disclaimer |
| 35 | + |
| 36 | +Although fully functional, this package is still in a pre-release stage. It needs throughout testing. |
| 37 | +Independent reviewers are more then welcome. |
| 38 | + |
| 39 | +## About the Author |
| 40 | + |
| 41 | +[Marco Congedo](https://sites.google.com/site/marcocongedo) is |
| 42 | +a Research Director of [CNRS](http://www.cnrs.fr/en) (Centre National de la Recherche Scientifique), working at [UGA](https://www.univ-grenoble-alpes.fr/english/) (University of Grenoble Alpes), in Grenoble (France), the city where Jean-Baptiste Joseph Fourier has served as a Prefect:). |
| 43 | + |
| 44 | +## Contact |
| 45 | +first name *dot* last name *at* gmail *dot* com |
| 46 | + |
| 47 | +## Examples |
| 48 | +``` |
| 49 | +using FourierAnalysis, Plots |
| 50 | +
|
| 51 | +# Set sampling rate (sr) and FFT window length (wl): |
| 52 | +sr, wl = 128, 128 |
| 53 | +
|
| 54 | +# Generate a sinusoidal wave at 10Hz with peak amplitude 0.5 and add some white noise: |
| 55 | +v = sinusoidal(0.5, 10, sr, wl*16) + randn(wl*16) |
| 56 | +
|
| 57 | +# Get the power spectrum with a rectangular tapering window: |
| 58 | +S = spectra(v, sr, wl; tapering=rectangular) |
| 59 | +
|
| 60 | +# Plot the power spectrum: |
| 61 | +plot(S; fmax=24) |
| 62 | +
|
| 63 | +# The same syntax applies in the case of multivariate data (e.g., 4 time-series): |
| 64 | +V = randn(wl*16, 4) |
| 65 | +S = spectra(V, sr, wl; tapering=hamming) |
| 66 | +plot(S) |
| 67 | +
|
| 68 | +# Get the analytic amplitude in the time-Frequency domain: |
| 69 | +A = TFamplitude(v, sr, wl; fmax=24) |
| 70 | +
|
| 71 | +# plot the analytic amplitude: |
| 72 | +heatmap(A.y) |
| 73 | +
|
| 74 | +``` |
| 75 | + |
| 76 | + |
| 77 | +| **Documentation** | |
| 78 | +|:---------------------------------------:| |
| 79 | +| [](https://Marco-Congedo.github.io/FourierAnalysis.jl/dev) | |
0 commit comments