fourier icon indicating copy to clipboard operation
fourier copied to clipboard

Build for WASM

Open calebzulawski opened this issue 5 years ago • 5 comments
trafficstars

I'm not a web guy, so I'm not sure what an idiomatic JavaScript/TypeScript interface should look like, but I imagine there's a desire for fast web FFTs and I imagine it should be reasonably easy to build for wasm32-unknown-unknown.

calebzulawski avatar Jan 21 '20 04:01 calebzulawski

Just so no one else starts working on this or you discard plans for it, I'm working on building a wasm fourier package

ADMoreau avatar Feb 15 '20 18:02 ADMoreau

Sorry if it's obvious but just so I know for my implementation, what is the complex input for the Bluestein algorithm? I've only ever used the fft for real number values.

ADMoreau avatar Feb 15 '20 21:02 ADMoreau

I've only implemented complex-to-complex transforms (no real-to-complex or real-to-real, see #5), so both the inputs and outputs are Complex<f32> or Complex<f64>. In memory, each complex number is just equal to two adjacent real values, something like this:

#[repr(C)]
struct Complex<T> {
    real: T,
    imag: T,
}

That shouldn't be specific to Bluestein's algorithm either. I'd recommend working with the fourier crate directly rather than the fourier-algorithms crate.

calebzulawski avatar Feb 15 '20 21:02 calebzulawski

Ahh, thank you. I guess what I am asking is what is this array in real life? Like is it a sine wave that has been processed or what goes into creating this input vector in the real world?

ADMoreau avatar Feb 15 '20 22:02 ADMoreau

Never mind I figured it out

ADMoreau avatar Feb 16 '20 03:02 ADMoreau