diff --git a/python/config.py b/python/config.py index 9b57374..90c3247 100644 --- a/python/config.py +++ b/python/config.py @@ -65,4 +65,4 @@ N_ROLLING_HISTORY = 2 """Number of past audio frames to include in the rolling window""" MIN_VOLUME_THRESHOLD = 1e-7 -"""No music visualization displayed if recorded audio volume below threshold""" \ No newline at end of file +"""No music visualization displayed if recorded audio volume below threshold""" diff --git a/python/gui.py b/python/gui.py index ef98704..d71ee7a 100644 --- a/python/gui.py +++ b/python/gui.py @@ -27,7 +27,6 @@ class GUI: if __name__ == '__main__': N = 48 gui = GUI(title='Test') - # Sin plot gui.add_plot(title='Sin Plot') gui.add_curve(plot_index=0) @@ -38,9 +37,8 @@ if __name__ == '__main__': while True: t = time.time() - x = np.linspace(t, 2 * np.pi + t, N); + x = np.linspace(t, 2 * np.pi + t, N) gui.curve[0][0].setData(x=x, y=np.sin(x)) gui.curve[1][0].setData(x=x, y=np.cos(x)) gui.app.processEvents() time.sleep(1.0 / 30.0) - diff --git a/python/led.py b/python/led.py index 5d1a596..4a22857 100644 --- a/python/led.py +++ b/python/led.py @@ -28,4 +28,4 @@ def update(): if __name__ == '__main__': pixels *= 0 - update() \ No newline at end of file + update() diff --git a/python/mel_visualization.py b/python/mel_visualization.py index 2a99c4d..0baf103 100644 --- a/python/mel_visualization.py +++ b/python/mel_visualization.py @@ -129,7 +129,7 @@ def visualize_scroll(y): g = int(max(y[len(y) // 3: 2 * len(y) // 3])) b = int(max(y[2 * len(y) // 3:])) p = np.roll(p, 1, axis=1) - p*= 0.98 + p *= 0.98 p = gaussian_filter1d(p, sigma=0.2) p[0, 0] = r p[1, 0] = g diff --git a/python/melbank.py b/python/melbank.py index 257cd3d..1703387 100644 --- a/python/melbank.py +++ b/python/melbank.py @@ -30,7 +30,6 @@ Functions --------- """ - from numpy import abs, append, arange, insert, linspace, log10, round, zeros @@ -88,7 +87,6 @@ def melfrequencies_mel_filterbank(num_bands, freq_min, freq_max, num_fft_bands): lower_edges_mel = frequencies_mel[:-2] upper_edges_mel = frequencies_mel[2:] center_frequencies_mel = frequencies_mel[1:-1] - return center_frequencies_mel, lower_edges_mel, upper_edges_mel @@ -132,7 +130,6 @@ def compute_melmat(num_mel_bands=12, freq_min=64, freq_max=8000, num_fft_bands ) - len_fft = float(num_fft_bands) / sample_rate center_frequencies_hz = mel_to_hertz(center_frequencies_mel) lower_edges_hz = mel_to_hertz(lower_edges_mel) upper_edges_hz = mel_to_hertz(upper_edges_mel)