# FourierAnalysis.jl - a package for the analysis of multivariate time-series in the frequency and time-frequency domain

**URL:** <https://discourse.julialang.org/t/fourieranalysis-jl-a-package-for-the-analysis-of-multivariate-time-series-in-the-frequency-and-time-frequency-domain/29157>\
**Category:** Package Announcements\
**Tags:** package, announcement, fftw\
**Created:** [September 25, 2019, 12:19pm UTC](https://discourse.julialang.org/t/fourieranalysis-jl-a-package-for-the-analysis-of-multivariate-time-series-in-the-frequency-and-time-frequency-domain/29157 "2019-09-25T12:19:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [September 25, 2019, 12:19pm UTC](https://discourse.julialang.org/t/fourieranalysis-jl-a-package-for-the-analysis-of-multivariate-time-series-in-the-frequency-and-time-frequency-domain/29157/1 "2019-09-25T12:19:47Z")

</div>

> **[GitHub - Marco-Congedo/FourierAnalysis.jl: A Julia package for the Fourier...](https://github.com/Marco-Congedo/FourierAnalysis.jl)**
>
> A Julia package for the Fourier analysis of Multivariate Data in the Frequency and Time-Frequency Domain - GitHub - Marco-Congedo/FourierAnalysis.jl: A Julia package for the Fourier analysis of Mul...

Hello all,

I wrote a package for performing the analysis of _real multivariate time series_ both in the _frequency_ domain and in the _time-frequency_ domain, based on [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).

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](https://en.wikipedia.org/wiki/Welch%27s_method).

Time-frequency representations are obtained applying a [filter-bank](https://en.wikipedia.org/wiki/Filter_bank) and the [Hilber transform](https://en.wikipedia.org/wiki/Hilbert_transform). This way one obtains the **analytic signal** , the **instantaneous amplitude** (envelope) and the **instantaneous phase** , along with several popular _linear_ and _non-linear_ , _weighted_ , _univariate_ and _bivariate_ statistics, such as the **mean amplitude** , **mean direction** , **phase concentration** , the non-linear version of which is a directional statistic known as **circular mean resultant length** , **comodulation** and **coherence** , the non-linear version of which is a synchronization statistic known as **phase-locking values** or **phase coherence**.

Such a tool is basic in signal-processing and data science. I wrote if for electroencephalographic data, but it may turn useful to many people. The usage has been kept as simple as possible, without sacrificing relevant options.

The package is in a pre-release stage. If you are willing to reviewing the code and/or the documentation, you are more then welcome!

---

<div class="post-metadata">

**Author:** ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Post date:** [September 25, 2019, 2:13pm UTC](https://discourse.julialang.org/t/fourieranalysis-jl-a-package-for-the-analysis-of-multivariate-time-series-in-the-frequency-and-time-frequency-domain/29157/2 "2019-09-25T14:13:57Z")

</div>

Looks great, the biggest issue at first sight is the lack of tests. Otherwise adding a nice image to the readme always makes it more appealing (and I see you have methods to make plots).

---

<div class="post-metadata">

**Author:** ![ssfrr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ssfrr/32/3736_2.png) [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Post date:** [September 25, 2019, 4:02pm UTC](https://discourse.julialang.org/t/fourieranalysis-jl-a-package-for-the-analysis-of-multivariate-time-series-in-the-frequency-and-time-frequency-domain/29157/3 "2019-09-25T16:02:01Z")

</div>

Looks really cool. I work with multivariate time-series data in the form of multichannel audio from a large microphone array (distances on the order of 10s of meters). I use a lot of time-frequency representations but am not very familiar with most of the cross-spectral techniques you’re using (at least not by those names). Are they generally applicable when the time delays between channels are large?

---

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [September 25, 2019, 4:03pm UTC](https://discourse.julialang.org/t/fourieranalysis-jl-a-package-for-the-analysis-of-multivariate-time-series-in-the-frequency-and-time-frequency-domain/29157/4 "2019-09-25T16:03:42Z")

</div>

Actually there are several tests in the ‘examples’ units, but i did not set up a formal test unit.

As per the picture, it is a good idea indeed, thanks, i will do it.

---

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [September 25, 2019, 4:14pm UTC](https://discourse.julialang.org/t/fourieranalysis-jl-a-package-for-the-analysis-of-multivariate-time-series-in-the-frequency-and-time-frequency-domain/29157/5 "2019-09-25T16:14:17Z")

</div>

I am not familiar with your kind of data, but i would not be surprised that you know the bivariate time-frequency measures i implemented as they are named very differently by different authors and even more differently in different fields.  
Take a look to [Congedo, 2018](https://hal.archives-ouvertes.fr/hal-01868538v2/document) to check what they correspond to in mathematical terms. Also, it is pretty simple to implement related measures. Let me know if you want to add more.

---

<div class="post-metadata">

**Author:** ![laborg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laborg/32/5474_2.png) [@laborg](https://discourse.julialang.org/u/laborg)\
**Post date:** [September 26, 2019, 5:21am UTC](https://discourse.julialang.org/t/fourieranalysis-jl-a-package-for-the-analysis-of-multivariate-time-series-in-the-frequency-and-time-frequency-domain/29157/6 "2019-09-26T05:21:37Z")

</div>

Thanks for sharing this - looks very useful!

I wonder why you use `⏩` as a parameter for something like `threading`. This symbol appears to be a needless hurdle.

---

<div class="post-metadata">

**Author:** ![Marco-Congedo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marco-congedo/32/7321_2.png) [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Post date:** [September 26, 2019, 8:10am UTC](https://discourse.julialang.org/t/fourieranalysis-jl-a-package-for-the-analysis-of-multivariate-time-series-in-the-frequency-and-time-frequency-domain/29157/7 "2019-09-26T08:10:32Z")

</div>

Hello, thanks for the remark. I used that symbol for consistency with a package i wrote previously. I later realised that using unicode symbols as arguments’ name is not very handy working in the REPL. However, in practice you can ignore completely that argument, as FourierAnalysis automatically check if it is worth multi-threading the operations and, if not, it switches to single-threading mode. All this will change with julia v1.3, when the new multi-threading will be released. I will drop the symbol then.
