vail-systems / node-fft

Pure Node.js implementation of the Fast Fourier Transform (Cooley-Tukey method).
133 stars 24 forks source link

Added ifft #2

Closed MaximilianBuegler closed 8 years ago

MaximilianBuegler commented 8 years ago

Just added ifft and therefore allowed complex input in your fft code.

waxspin commented 8 years ago

@homernl82 Thanks for this! We are happy to include it, but would you mind just adding some markdown to the README.md file to illustrate an example of using the ifft as you intended? If this is not something you will have time to do, let me know and I can add it at some point, just won't have time immediately. One other thing I just thought of too, if you could add some unit tests for the ifft to our mocha tests that would be great. Again, if you don't have time, I may be able to at some point but it would be very helpful.

MaximilianBuegler commented 8 years ago

Here you go...

MaximilianBuegler commented 8 years ago

I also added tests to test.js and their results to the readme, also incremented the version number. Should all be perfect now.

waxspin commented 8 years ago

Awesome, thanks! I'll check this out and merge in as soon as I'm back at my computer.

On Nov 24, 2016 9:53 AM, "Maximilian Bügler" notifications@github.com wrote:

I also added tests to test.js and their results to the readme, also incremented the version number. Should all be perfect now.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vail-systems/node-fft/pull/2#issuecomment-262805926, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHreSw2UCA_l1wdZ6V_zugZFCD-NHjBks5rBbMQgaJpZM4K7CkX .

sylarcp commented 8 years ago

@waxspin Well, off the topic a little bit. Since both the input and output are a series of points. Given the time step is 1ms in time domain, do you know how to tell the frequency step for the plots in frequency domain? Thanks.

waxspin commented 8 years ago

@sylarcp To answer your question, the frequency step can be calculated as Fs (sampling frequency) divided by N (number of points in the FFT size). A much more detailed explanation can be found here and a more full explanation about the mathematics behind the DFT (very dense though) can be found here.

sylarcp commented 8 years ago

@waxspin Thanks! This answers my question.