liamappelbe / fftea

A simple and efficient FFT implementation for Dart
Apache License 2.0
63 stars 1 forks source link

Help me with the use of STFT. #16

Closed certainlyWrong closed 2 years ago

certainlyWrong commented 2 years ago

Hello, I'm trying to implement a function to extract MFCCs and I need to understand its function.

I implemented this same algorithm in Javascript and it gave great results, but for that I used tensorflow. I used it like this:

const stfts = tf.signal.stft(input, n_fft, 512);

How could I use your function to do something like this?

Please understand that I don't have much understanding on the matter.

liamappelbe commented 2 years ago

Sorry for the slow response. I'm traveling and wifi is patchy.

From the tensorflow docs, it looks like your n_fft arg is tf's frame_length, which is analogous to fftea's chunkSize, and the 512 is tf's frame_step, which is fftea's chunkStride. So this should work:

final stfts = STFT(n_fft).runAndCopy(input, 512);
certainlyWrong commented 2 years ago

This will help me a lot. Thank you for your time and kindness.