indutny / fft.js

The fastest JS Radix-4/Radix-2 FFT implementation
278 stars 31 forks source link

No example of expected output #7

Closed SephReed closed 7 years ago

SephReed commented 7 years ago

There is no example of expected output. I'm pretty sure the following is wrong, but I have nothing to compare it to.

-2.7350754211020335e+37, 0, -2.74791941673057e+37, 1.7924465771967297e+35, -2.746905263214394e+37, 3.543421938934245e+35, -2.745614364226398e+37, 5.223895408963396e+35, -2.744560770814082e+37, 6.823236792035908e+35, -2.7445039397166733e+37, 8.335100408925063e+35, -2.750007665709478e+37, 9.503987944167054e+35, -2.7362066697780583e+37, 1.2031876673943803e+36, -2.740032083855111e+37, 1.346091445541995e+36, -2.7410313849063947e+37, 1.5144149620484113e+36, -2.741017338984276e+37, 1.6922964485080548e+36, -2.7399726599251418e+37, 1.8758977693295546e+36....

indutny commented 7 years ago

Hello!

There is no example, because output strongly depends on input array. It is a two way transform so almost any output is possible.

Would you care to share the code that generated it?

On Sun, Jul 30, 2017 at 11:46 Seph Reed notifications@github.com wrote:

There is no example of expected output. I'm pretty sure the following is wrong, but I have nothing to compare it to.

-2.7350754211020335e+37, 0, -2.74791941673057e+37, 1.7924465771967297e+35, -2.746905263214394e+37, 3.543421938934245e+35, -2.745614364226398e+37, 5.223895408963396e+35, -2.744560770814082e+37, 6.823236792035908e+35, -2.7445039397166733e+37, 8.335100408925063e+35, -2.750007665709478e+37, 9.503987944167054e+35, -2.7362066697780583e+37, 1.2031876673943803e+36, -2.740032083855111e+37, 1.346091445541995e+36, -2.7410313849063947e+37, 1.5144149620484113e+36, -2.741017338984276e+37, 1.6922964485080548e+36, -2.7399726599251418e+37, 1.8758977693295546e+36....

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/indutny/fft.js/issues/7, or mute the thread https://github.com/notifications/unsubscribe-auth/AAOjwz9FnrC59y1DTrZU_6jswYvqMhIJks5sTFELgaJpZM4Onl0r .

SephReed commented 7 years ago

Hello, I've gotten a bit further since this, but the signal that was generating this was a sine wave at 1000Hz with amplitude 1.0... or so I thought. What was happening was I was getting some header data with my signal, and the header data was a number in the e+36 magnitude, throwing off the rest of everything.

In general, my confusion was over the e+36 and above magnitudes for the real and imaginary numbers, and whether or not that was expected, which in most cases it is not.

An example of numbers to be expected would be more in the 0 < abs(x) < 3 for a signal of amplitude 1.0

In general, and example of static, and a sine wave could be very useful just to give newcomer users an idea as to whether or not the numbers they are getting are within the general neighborhood.

indutny commented 7 years ago

It might be indeed! If you have any particular suggestions - I'd love to review Pull Request!