drom / fourier

:wavy_dash: Fourier transform in JavaScript
MIT License
78 stars 10 forks source link

Initialization #2

Open echo66 opened 9 years ago

echo66 commented 9 years ago

Greetings, @drom !

One question: can I process different data heaps, using the same custom FFT object? Or is each object a "one shot" processor?

drom commented 9 years ago

@echo66 yes, you can operate with other typed arrays. .transform() expects data starting from the beginning, and twiddle factors right after the data. I can change the function interface to pass dataStart and twiddleStart pointers. It will make heap more useful for storing other data. How about this?

echo66 commented 9 years ago

Greetings, @drom ! Thanks for the quick response. :+1:

There are several ways, IHMO, to make a "nice" interface for this:

a) The transform function should accept one or two arguments (one for forward and two for inverse transform). Optionally, the transform function should check the size of the provided arrays.

b) Create a function like "setData" which accepts one or two arguments (one for forward and two for inverse transform).

c) And, of course, your proposal. :)

I'm suggesting (a) and (b) due to my experience regarding the usage of other FFT libraries.

Oh, by the way, awesome work with this library! I'm using it with a Phase Vocoder with Identity Phase Locking.

drom commented 9 years ago

Hi @echo66 do you use the library? Are you still interested in changes that you requested?

echo66 commented 9 years ago

I'm still using it with the phase vocoder. :)