summaryrefslogtreecommitdiff
path: root/src/dft.h
diff options
context:
space:
mode:
authorsteven-na <noreply.github@stvnc.dev>2026-08-05 14:31:02 -0700
committersteven-na <noreply.github@stvnc.dev>2026-08-05 14:31:02 -0700
commite939fa891b6403fcdaba7f545b2bf7932aa7f9ba (patch)
tree6e8f021b83d228e0af119e369806fa398c8cb9e1 /src/dft.h
parentcabb2e6d5101506e59abb8be1d87408acabb1136 (diff)
STFT rounds sample_count up to nearest window_size multiple
Diffstat (limited to 'src/dft.h')
-rw-r--r--src/dft.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dft.h b/src/dft.h
index 74178aa..aaa2796 100644
--- a/src/dft.h
+++ b/src/dft.h
@@ -43,10 +43,12 @@ typedef struct {
} stft_data_t;
/// Run STFT algorithm on samples, sliding a window_size window by hop_size each step
+/// Warning: This function assumes that samples' allocation is large enough to fit
+/// ALIGN_UP_POW2(sample_count, window_size) elements.
stft_data_t short_time_fourier_transform(smrt_arena_t * arena ,
u64 window_size ,
u64 hop_size ,
- f64 * samples ,
+ f64 * samples ,
u64 sample_count ,
u64 sample_rate);