From c1d0166c443c1bf0740e78fa46daca9bd7667462 Mon Sep 17 00:00:00 2001 From: liuyihui Date: Tue, 25 Apr 2023 19:09:55 +0800 Subject: [PATCH] fix: fft function type --- include/fft/fft.h | 2 +- src/fft/fft.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/fft/fft.h b/include/fft/fft.h index e1a8a18..4ac8ac5 100644 --- a/include/fft/fft.h +++ b/include/fft/fft.h @@ -8,4 +8,4 @@ #define FFT_BIN(num, re) (uint16_t)((float)(num + 0.5) * re) #define FFT_INDEX(freq, re) (uint16_t)((float)freq / re) -int FFT(q15_t *data); +void FFT(q15_t *data); diff --git a/src/fft/fft.c b/src/fft/fft.c index 71d4f76..79f9fac 100644 --- a/src/fft/fft.c +++ b/src/fft/fft.c @@ -84,7 +84,7 @@ static inline void butterfly(q15_t *data) { } } -int FFT(q15_t *data) { +void FFT(q15_t *data) { for (uint16_t i = 0; i < N; i++) { res[Re(i)] = data[i]; // real res[Im(i)] = 0; // imaginary @@ -93,6 +93,4 @@ int FFT(q15_t *data) { butterfly(res); bitreversal((q31_t *)res); for (uint16_t i = 0; i < N; i++) data[i] = (q15_t)abs(res[Re(i)]); - - return 0; }