Skip to content

Commit 2e5a812

Browse files
Merge branch 'main' into breaking
2 parents fd8f0ef + 6db30de commit 2e5a812

12 files changed

+41
-12
lines changed

CondaPkg.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
xarray = ""
33
numpy = ""
44
openssl = "<=julia"
5+
# Python 3.14 segfaults something awful
6+
python = "3.13.*"

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ DimensionalDataAlgebraOfGraphicsExt = "AlgebraOfGraphics"
4141
DimensionalDataCategoricalArraysExt = "CategoricalArrays"
4242
DimensionalDataChainRulesCoreExt = "ChainRulesCore"
4343
DimensionalDataDiskArraysExt = "DiskArrays"
44-
DimensionalDataMakie = "Makie"
44+
DimensionalDataMakieExt = "Makie"
4545
DimensionalDataNearestNeighborsExt = "NearestNeighbors"
46-
DimensionalDataPythonCall = "PythonCall"
46+
DimensionalDataPythonCallExt = "PythonCall"
4747
DimensionalDataSparseArraysExt = "SparseArrays"
48-
DimensionalDataStatsBase = "StatsBase"
48+
DimensionalDataStatsBaseExt = "StatsBase"
4949

5050
[compat]
5151
AbstractFFTs = "1"

docs/src/.vitepress/config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const navTemp = {
3131
{ text: 'DiskArrays', link: '/diskarrays' },
3232
{ text: 'Xarray', link: '/xarray' },
3333
{ text: 'Extending DimensionalData', link: '/extending_dd' },
34+
{ text: 'FFT', link: '/fft' },
3435
],
3536
},
3637
],

docs/src/extending_dd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ format(dims, array)
8989
This lets DimensionalData detect the lookup properties, fill in missing fields
9090
of a `Lookup`, pass keywords from `Dimension` to detected `Lookup`
9191
constructors, and accept a wider range of dimension inputs like tuples of `Symbol`
92-
and `Type`. The way you indicate that something needs to be filled is by using the `Auto` types, like `AutoOrder`](@ref) or `AutoSampling`.
92+
and `Type`. The way you indicate that something needs to be filled is by using the `Auto` types, like [`AutoOrder`](@ref) or `AutoSampling`.
9393

9494
Not calling `format` in the outer constructors of an `AbstractDimArray`
9595
has undefined behaviour.

docs/src/fft.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Fast Fourier Transform (FFT)
2+
`DimensionalData.jl` implements the Fast Fourier Transform (FFT) for `DimensionalArray` objects, allowing users to perform frequency domain analysis while preserving dimensional metadata.
3+
4+
It uses lookups to scale the forward and inverse transforms to remain physically meaningful. As such, it implements the following conventions. If we denote a signal as a function of time ``a(x)`` sampled at discrete intervals ``dx``, the discrete Fourier transform (DFT) is defined as:
5+
```math
6+
\operatorname{DFT}(A)[k] =
7+
\sum_{n=1}^{\operatorname{length}(A)} \exp\left(i2π x[n]f[k] \right) A[n] dx.
8+
```
9+
The inverse discrete Fourier transform (IDFT) is defined as:
10+
```math
11+
\operatorname{IDFT}(A)[n] =
12+
\sum_{k=1}^{\operatorname{length}(A)} \exp\left(-i2π x[n]f[k] \right) A[k] df.
13+
```
14+
15+
These conventions ensure that the transforms are unitary, meaning that applying the DFT followed by the IDFT returns the original signal without any additional scaling factors. The scaling factors applied to the forward and inverse transforms are different from the "standard" discrete Fourier transform definitions, which typically does not scale the forward transform, and includes a normalization factor of `1/N` in the inverse transform.
16+
17+
## API
18+
19+
The following functions are provided for performing FFTs on `DimensionalArray` objects:
20+
21+
TODO

ext/DimensionalDataAbstractFFTsExt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ for i in (:fft, :ifft, :rfft)
269269
270270
```math
271271
\\operatorname{DFT}(A)[k] =
272-
\\sum_{n=1}^{\\operatorname{length}(A)} \\exp\\left($(signal)\\pi x[n]f[k] \\right) A[n] dx.
272+
\\sum_{n=1}^{\\operatorname{length}(A)} \\exp\\left($(signal)2\\pi x[n]f[k] \\right) A[n] dx.
273273
```
274274
where `x` is the lookup dimension of the input data, `f` is the lookup dimension of the output data, and `dx` is the step of the lookup dimension of the input data.
275275
@@ -292,7 +292,7 @@ end
292292
293293
```math
294294
\\operatorname{DFT}(A)[k] =
295-
\\sum_{n=1}^{\\operatorname{length}(A)} \\exp\\left(i\\pi x[n]f[k] \\right) A[n] dx.
295+
\\sum_{n=1}^{\\operatorname{length}(A)} \\exp\\left(i2\\pi x[n]f[k] \\right) A[n] dx.
296296
```
297297
where `x` is the lookup dimension of the input data, `f` is the lookup dimension of the output data, and `dx` is the step of the lookup dimension of the input data.
298298

ext/DimensionalDataMakie.jl renamed to ext/DimensionalDataMakieExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module DimensionalDataMakie
1+
module DimensionalDataMakieExt
22

33
using DimensionalData
44
using Makie

ext/DimensionalDataPythonCall.jl renamed to ext/DimensionalDataPythonCallExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module DimensionalDataPythonCall
1+
module DimensionalDataPythonCallExt
22

33
using DimensionalData
44
import DimensionalData as DD

ext/DimensionalDataStatsBase.jl renamed to ext/DimensionalDataStatsBaseExt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module DimensionalDataStatsBase
1+
module DimensionalDataStatsBaseExt
22

33
using DimensionalData
44
using Statistics
@@ -24,4 +24,4 @@ function _weighted(f::F, A, w, dims) where F
2424
end
2525
end
2626

27-
end
27+
end

0 commit comments

Comments
 (0)