Skip to content

Commit 8dbacc1

Browse files
committed
Fresh start: reset history
0 parents  commit 8dbacc1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+13890
-0
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/" # Location of package manifests
6+
schedule:
7+
interval: "weekly"

.github/workflows/CI.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master # update to match your development branch (master, main, dev, trunk, ...)
7+
tags: '*'
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
permissions:
13+
contents: write
14+
pull-requests: read
15+
statuses: write
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: julia-actions/setup-julia@v2
20+
with:
21+
version: '1.11'
22+
- uses: julia-actions/cache@v1
23+
- name: Install dependencies
24+
run: julia --project=docs/ -e ' using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.add("DocumenterTools"); Pkg.instantiate()'
25+
- name: Build and deploy
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
28+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key
29+
run: julia --project=docs/ docs/make.jl

.github/workflows/CompatHelper.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: CompatHelper
2+
3+
on:
4+
schedule:
5+
- cron: '00 00 * * *'
6+
7+
jobs:
8+
CompatHelper:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: julia-actions/setup-julia@latest
12+
with:
13+
version: 1.3
14+
- name: Pkg.add("CompatHelper")
15+
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
16+
- name: CompatHelper.main()
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
run: julia -e 'using CompatHelper; CompatHelper.main()'

.github/workflows/TagBot.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: TagBot
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
7+
inputs:
8+
lookback:
9+
default: "3"
10+
permissions:
11+
actions: read
12+
checks: read
13+
contents: write
14+
deployments: read
15+
issues: read
16+
discussions: read
17+
packages: read
18+
pages: read
19+
pull-requests: read
20+
repository-projects: read
21+
security-events: read
22+
statuses: read
23+
jobs:
24+
TagBot:
25+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: JuliaRegistries/TagBot@v1
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
32+
ssh: ${{ secrets.DOCUMENTER_KEY }}
33+
# ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }}

.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#Emacs temp files
2+
*~
3+
[#]*[#]
4+
.\#*
5+
6+
# MacOS files
7+
.DS_Store
8+
9+
# VS code files
10+
# *.vscode
11+
*.code-workspace
12+
13+
# Files generated by invoking Julia with --code-coverage
14+
*.jl.cov
15+
*.jl.*.cov
16+
17+
# Files generated by invoking Julia with --track-allocation
18+
*.jl.mem
19+
20+
# System-specific files and directories generated by the BinaryProvider and BinDeps packages
21+
# They contain absolute paths specific to the host computer, and so should not be committed
22+
deps/deps.jl
23+
deps/build.log
24+
deps/downloads/
25+
deps/usr/
26+
deps/src/
27+
28+
# Build artifacts for creating documentation generated by the Documenter package
29+
docs/build/
30+
docs/site/
31+
32+
# File generated by Pkg, the package manager, based on a corresponding Project.toml
33+
# It records a fixed state of all packages used by the project. As such, it should not be
34+
# committed for packages, but should be committed for applications that require a static
35+
# environment.
36+
Manifest.toml
37+
38+
# Figures
39+
# Add here folders where figures are generated during development
40+
41+
# to check what is ignored use 'git status' in git Bash

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
Copyright (c) 2019-2025, Marco Congedo, CNRS, Grenobe, France:
3+
https://sites.google.com/site/marcocongedo/home
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"),
7+
to deal in the Software without restriction, including without limitation
8+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
9+
and/or sell copies of the Software, and to permit persons to whom the
10+
Software is furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
19+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name = "FourierAnalysis"
2+
uuid = "e7e9c730-dc46-11e9-3633-f1ab55cc17e1"
3+
authors = ["Marco-Congedo <marco.congedo@gmail.com>"]
4+
version = "1.2.4"
5+
6+
[deps]
7+
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
8+
DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2"
9+
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
10+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
11+
PosDefManifold = "f45a3650-5c51-11e9-1e9a-133aa5e309cf"
12+
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
13+
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
14+
15+
[compat]
16+
AbstractFFTs = "1.0, 1.2, 1.3, 1.4, 1.5"
17+
DSP = "0.7, 0.8"
18+
FFTW = "1.3, 1.4, 1.5, 1.6, 1.7, 1.8"
19+
PosDefManifold = "0.5"
20+
RecipesBase = "1.1, 1.2, 1.3"
21+
Statistics = "1.11"
22+
LinearAlgebra = "1.11"
23+
julia = "1"
24+
25+
[extras]
26+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
27+
28+
[targets]
29+
test = ["Test"]

README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
| **Documentation** |
2+
|:---------------------------------------:|
3+
| [![](https://img.shields.io/badge/docs-dev-blue.svg)](https://Marco-Congedo.github.io/FourierAnalysis.jl/dev) |
4+
5+
![](/docs/src/assets/Fig1.jpg)
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://img.shields.io/badge/docs-dev-blue.svg)](https://Marco-Congedo.github.io/FourierAnalysis.jl/dev) |

docs/Project.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
authors = ["Marco Congedo"]
2+
version = "1.2.4"
3+
4+
[deps]
5+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
6+
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
7+
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
8+
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
9+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
10+
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
11+
FourierAnalysis = "e7e9c730-dc46-11e9-3633-f1ab55cc17e1"
12+
13+
[compat]
14+
Documenter = "1.11"
15+
LinearAlgebra = "1.11"
16+
Statistics = "1.11"

docs/make.jl

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
push!(LOAD_PATH,"../src/")
2+
push!(LOAD_PATH, @__DIR__)
3+
using Documenter, DocumenterTools, DocumenterCitations, DocumenterInterLinks
4+
using FourierAnalysis
5+
6+
makedocs(
7+
sitename="FourierAnalysis",
8+
format = Documenter.HTML(),
9+
authors="Marco Congedo, CNRS, France",
10+
modules=[FourierAnalysis],
11+
pages = [
12+
"index.md",
13+
"Main Module" => "MainModule.md",
14+
"Tapering Windows" => "tapers.md",
15+
"frequency domain" => Any[
16+
"Spectral Estimations" => "spectra.md",
17+
"Cross-Spectral Matrices" => "crossspectra.md",
18+
"Coherence Matrices" => "coherence.md",
19+
"Goertzel's Algorithms" => "goertzel.md",
20+
],
21+
"time-frequency(TF) domain" => Any[
22+
"TF Representations" => "timefrequency.md",
23+
"TF Univariate Measures" => "timefrequencyuni.md",
24+
"TF Bivariate Measures " => "timefrequencybi.md",
25+
],
26+
"utilities" => Any[
27+
"Plots" => "recipes.md",
28+
"Tools" => "tools.md",
29+
"FFTW planners" => "fftw.md",
30+
"Filter Banks" => "filters.md",
31+
"Hilbert Transform" => "hilbert.md",
32+
]
33+
]
34+
)
35+
36+
deploydocs(
37+
repo = "github.com/Marco-Congedo/FourierAnalysis.jl.git",
38+
target = "build",
39+
devurl = "dev",
40+
)

0 commit comments

Comments
 (0)