run method

void run(
  1. List<double> input,
  2. dynamic reportChunk(
    1. Float64x2List
    ), [
  3. int chunkStride = 0
])

Runs STFT on input.

The input is broken up into chunks, windowed, FFT'd, and then passed to reportChunk. If there isn't enough data in the input to fill the final chunk, it is padded with zeros. Does not allocate any arrays.

When using a windowing function, it is recommended that you overlap the chunks by setting chunkStride to less than the chunk size. Once one chunk has been processed, the window advances by the stride. If no stride is given, it defaults to the chunk size.

WARNING: For efficiency reasons, the same Float64x2List is reused for every chunk, always overwriting the FFT of the previous chunk. So if reportChunk needs to keep the data, it should make a copy (eg using result.sublist(0)).

Implementation

void run(
  List<double> input,
  Function(Float64x2List) reportChunk, [
  int chunkStride = 0,
]) =>
    _run(input, reportChunk, chunkStride, false, false);