Very minor PEP8 formatting changes

This commit is contained in:
Scott Lawson 2016-12-24 22:54:06 -07:00
parent e677742584
commit b6551e04a2
5 changed files with 4 additions and 9 deletions

View File

@ -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"""

View File

@ -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)

View File

@ -28,4 +28,4 @@ def update():
if __name__ == '__main__':
pixels *= 0
update()
update()

View File

@ -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

View File

@ -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)