Sliding DFT: Difference between revisions
(implementing the sliding DFT is more complicated than it seems right?) |
(Added external links section) |
||
Line 7: | Line 7: | ||
The sliding DFT, unlike FFT requires contiguous stream of data, which means implementing that requires tricks involved with delta variable (time difference between current and previous calculations). However, the offset part of audio capture part of visualization (especially with <code>get_chunk_absolute(data, offset, size)</code>) is kinda complicated; the time of the resulting captured signal is <code>requested_length/2</code> samples ahead of actual playback (as long as the requested length is lower than buffer size in samples), which means the offset should be adjusted to something like <code>time - delta/2</code>. | The sliding DFT, unlike FFT requires contiguous stream of data, which means implementing that requires tricks involved with delta variable (time difference between current and previous calculations). However, the offset part of audio capture part of visualization (especially with <code>get_chunk_absolute(data, offset, size)</code>) is kinda complicated; the time of the resulting captured signal is <code>requested_length/2</code> samples ahead of actual playback (as long as the requested length is lower than buffer size in samples), which means the offset should be adjusted to something like <code>time - delta/2</code>. | ||
== External links == | |||
* {{Wikipedia|Sliding DFT}} | |||
* [https://scratch.mit.edu/projects/184263583/editor/ A video explaining how sliding DFT works and how to properly capture audio samples for sliding DFT calculation] | |||
[[Category:Technical]] | [[Category:Technical]] | ||
[[Category:Signal Processing]] | [[Category:Signal Processing]] |
Revision as of 04:27, 18 May 2023
This article is a stub. You can help the Hydrogenaudio Knowledgebase by expanding it.
A sliding DFT is a recursive complex FIR filter bank that calculates short-time Fourier transform sample-by-sample. Unlike FFT, the sDFT calculation for each bin is independent of each other, making it ideal for single-bin STFT and even constant-Q transform but this technique are limited by having only integer K otherwise, the sDFT goes out of phase but this is not in case on some sDFT implementations that allows non-integer K.
The sliding DFT can also have asymmetric windowing function by replacing ring buffers with an IIR exponential decay and it can be cascaded to further increase rolloff.
Implementation in foobar2000
The sliding DFT, unlike FFT requires contiguous stream of data, which means implementing that requires tricks involved with delta variable (time difference between current and previous calculations). However, the offset part of audio capture part of visualization (especially with get_chunk_absolute(data, offset, size)
) is kinda complicated; the time of the resulting captured signal is requested_length/2
samples ahead of actual playback (as long as the requested length is lower than buffer size in samples), which means the offset should be adjusted to something like time - delta/2
.