mirror of
https://github.com/BlackLight/micmon.git
synced 2024-11-27 14:15:14 +01:00
matplotlib moved to local import
This commit is contained in:
parent
d867880199
commit
85f99e7362
2 changed files with 4 additions and 2 deletions
|
@ -1,7 +1,6 @@
|
|||
from typing import Optional, Union
|
||||
from typing import Optional
|
||||
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
class AudioSegment:
|
||||
|
@ -30,11 +29,13 @@ class AudioSegment:
|
|||
])
|
||||
|
||||
def plot_audio(self):
|
||||
import matplotlib.pyplot as plt
|
||||
plt.plot(self.audio)
|
||||
plt.show()
|
||||
|
||||
def plot_spectrum(self, low_freq: int = default_low_freq, high_freq: int = default_high_freq,
|
||||
bins: int = default_bins):
|
||||
import matplotlib.pyplot as plt
|
||||
spectrum = self.spectrum(low_freq=low_freq, high_freq=high_freq, bins=bins)
|
||||
plt.ylim(0, 1)
|
||||
plt.bar(range(len(spectrum)), spectrum)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
numpy
|
||||
tensorflow
|
||||
keras
|
||||
matplotlib
|
||||
|
|
Loading…
Reference in a new issue