CodeKnight & Bitrate
CodeKnight CodeKnight
Привет, я пытаюсь впихнуть FFT в реальном времени в 1 миллисекунду на буфер – какие-нибудь хитрости, чтобы сохранить низкую задержку, но при этом справляться с высокими частотами дискретизации?
Bitrate Bitrate
Yeah, 1 ms is a tight squeeze, but you can hack it with a few tricks. First, keep the FFT size to the smallest power‑of‑two that still gives you the resolution you need—no need for a 4096‑point if 1024 will do. Second, don’t re‑allocate buffers every frame; pre‑allocate and just shuffle pointers. Third, use a fast FFT library that’s tuned for your CPU—FFTW or KissFFT with SIMD. If you’re on a DSP, look for hardware FFT instructions. Fourth, drop the real‑time blocking by running the FFT in a separate thread and queue the output. And don’t forget to drop the overhead of any fancy windowing or padding—just a Hamming window on the fly if you must. Keep it lean, keep it tight, and you’ll stay under that 1 ms sweet spot.