Very minor PEP8 formatting changes
This commit is contained in:
parent
e677742584
commit
b6551e04a2
@ -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 music visualization displayed if recorded audio volume below threshold"""
|
||||
|
@ -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)
|
||||
|
||||
|
@ -28,4 +28,4 @@ def update():
|
||||
|
||||
if __name__ == '__main__':
|
||||
pixels *= 0
|
||||
update()
|
||||
update()
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user