Skip to content

Add support for Nx.rfft and Nx.irfft #1723

@msluszniak

Description

@msluszniak

I would be a great addition. Currently, a bottleneck for me is such kind of code:

xfft = Nx.fft(xw, length: nfft, axis: 1)[[.., 0..cutoff]] |> Nx.new_axis(-1)
outf = xfft * filter[[.., 0..cutoff, ..]]
flipped = Nx.conjugate(outf[[.., 1..-2//1, ..]]) |> Nx.reverse(axes: [1])
outw = Nx.concatenate([outf, flipped], axis: 1)

If these operation will be implemented efficiently, the code above can get me a huge speed-up:

xfft = Nx.rfft(xw, length: nfft, axis: 1) |> Nx.new_axis(-1)
outf = xfft * filter[[.., 0..cutoff, ..]]
temp = Nx.irfft(outf, length: nfft, axis: 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions