From 8bb47c8786dfb8d7b9d22ffe181351771607805a Mon Sep 17 00:00:00 2001 From: Mariusz Ryndzionek Date: Mon, 29 Jul 2024 14:29:55 +0200 Subject: [PATCH] Small adjustment --- src/fbank.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/fbank.c b/src/fbank.c index e73096d..11114b2 100644 --- a/src/fbank.c +++ b/src/fbank.c @@ -1302,9 +1302,16 @@ static void powspec(const float input[FRAME_LEN], float output[NUM_FFT_BINS]) fft_plan = fft_create_plan_radix2(NUM_FFT, in, out); } - for (size_t i = 0; i < FRAME_LEN; i++) + for (size_t i = 0; i < NUM_FFT; i++) { - in[i] = input[i]; + if (i < FRAME_LEN) + { + in[i] = input[i]; + } + else + { + in[i] = 0.0 + 0.0 * I; + } } fft_execute_radix2(fft_plan); @@ -1382,7 +1389,7 @@ static const float LSTM4[1][1][32] = {{{0.0f}}}; void fbank_speech_detect(float input[NUM_FRAMES][NUM_FILT], size_t *label, float *logit) { - float logits[9][6]; + float logits[9][NUM_LABELS]; size_t max_idx; float max_log; @@ -1395,7 +1402,7 @@ void fbank_speech_detect(float input[NUM_FRAMES][NUM_FILT], size_t *label, float for (size_t i = 0; i < 9; i++) { - for (size_t j = 0; j < 6; j++) + for (size_t j = 0; j < NUM_LABELS; j++) { if ((i == 0) && (j == 0)) {