From 11b9220ea93687f20b71c8a1e2dc13497a311e79 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Sat, 26 Sep 2020 21:03:48 -0400 Subject: [PATCH] Move the graph smoothing to the bars --- turntable/gui.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/turntable/gui.py b/turntable/gui.py index 1a023b4..a589739 100644 --- a/turntable/gui.py +++ b/turntable/gui.py @@ -52,8 +52,7 @@ class Plot: fft = fft[: len(fft) // 2] dbfs = 20 * np.log10(fft * 2 / (len(fft) * 2 ** 15)) dbfs = np.maximum(-100, dbfs) + 100 - self.spectrums.append(dbfs) - return np.mean(np.column_stack(self.spectrums), axis=1) + return dbfs def draw_lines(self) -> None: data = self.spectrum() @@ -84,6 +83,8 @@ class Plot: ), axis=1, ) + self.spectrums.append(fft) + fft = np.mean(np.column_stack(self.spectrums), axis=1) light_width = self.width // (2 * self.bars - 1) light_height = self.height // 2 // light_width