Skip to content

Extension of AbstractFFT #1040

@DylanMMarques

Description

@DylanMMarques

Hi,

I was wondering if there would be interest in having a extension of DimensionalData for AbstractFFT with the aim of using the additional information providing by the lookups.

My idea would be something like this:

function fft(dd::AbstractDimVector)
     dx = step(lookup(dd, 1))
     fx = fftfreq(length(dd), 1 / dx)
     fft_dd = fft(parent(dd))
     D = DimensionalData.basetypeof(dims(dd, 1))
     fft_dd .*= dx
     DimVector(fft_dd, D(fx))
end

 fft(rand(X(1:100)))
┌ 100-element DimArray{ComplexF64, 1} ┐
├─────────────────────────────────────┴─────────────────────── dims ┐
   X Sampled{Float64} [0.0, , -0.01] Unordered Irregular Points
└───────────────────────────────────────────────────────────────────┘
         

Ideally, the implementation would support fft_plan, mul! and N-dimensional arrays.

Happy to create a PR if there is interest in adding something like this as an extension.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions