From d9dfcc39ecac1c13cf2569367b172c8729791cb0 Mon Sep 17 00:00:00 2001 From: liuyihui Date: Mon, 24 Apr 2023 23:37:57 +0800 Subject: [PATCH] remove: Rcos and hann --- src/sstv.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/sstv.c b/src/sstv.c index 3808249..a6b4f49 100644 --- a/src/sstv.c +++ b/src/sstv.c @@ -1,28 +1,20 @@ +#include "derivative.h" #include "fft/fft.h" #include "fft/table.h" #include "math.h" #include "sstv.h" #include "stdio.h" -static q15_t buffer[MN]; static q15_t data[N]; +static q15_t buffer[MN]; static q15_t* pData = &data[0]; -static q15_t img[1843202]; -static q15_t* pImg = &img[0]; static uint8_t colorBuf[960]; static const float32_t color_re = (float32_t)(FREQ_RANGE) / (COLOR_SCALE - 1); #define fre2lum(fre) (uint8_t)((fre - FREQ_BLACK) / color_re) -// #define Rcos(x, N) (0.5 - 0.5 * cos(2.0 * PI * x / (N - 1.0))) - -// static q15_t hann(uint16_t x, uint16_t len) { -// q31_t v = round(Rcos(x, len) * 32768); -// if (v > 32767) v = 32767; -// if (v < -32768) v = -32768; -// return (q15_t)v; -// } - +static q15_t img[1843202]; +static q15_t* pImg = &img[0]; void init() { FILE* fp; fp = fopen("temp/data.txt", "r"); @@ -45,7 +37,6 @@ static uint16_t find_peak(uint16_t L, uint16_t R) { static void hanning(uint16_t len) { for (uint16_t i = len; i < N; i++) data[i] = 0; - // for (uint16_t i = 0; i < len; i++) data[i] = ((q31_t)data[i] * hann(i, len)) >> 15; if (len == 160) for (uint16_t i = 0; i < len; i++) data[i] = ((q31_t)data[i] * hanning_160[i]) >> 15; else