mirror of
https://github.com/BlackLight/micmon.git
synced 2024-11-27 22:25:13 +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 numpy as np
|
||||||
import matplotlib.pyplot as plt
|
|
||||||
|
|
||||||
|
|
||||||
class AudioSegment:
|
class AudioSegment:
|
||||||
|
@ -30,11 +29,13 @@ class AudioSegment:
|
||||||
])
|
])
|
||||||
|
|
||||||
def plot_audio(self):
|
def plot_audio(self):
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
plt.plot(self.audio)
|
plt.plot(self.audio)
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
def plot_spectrum(self, low_freq: int = default_low_freq, high_freq: int = default_high_freq,
|
def plot_spectrum(self, low_freq: int = default_low_freq, high_freq: int = default_high_freq,
|
||||||
bins: int = default_bins):
|
bins: int = default_bins):
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
spectrum = self.spectrum(low_freq=low_freq, high_freq=high_freq, bins=bins)
|
spectrum = self.spectrum(low_freq=low_freq, high_freq=high_freq, bins=bins)
|
||||||
plt.ylim(0, 1)
|
plt.ylim(0, 1)
|
||||||
plt.bar(range(len(spectrum)), spectrum)
|
plt.bar(range(len(spectrum)), spectrum)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
numpy
|
numpy
|
||||||
tensorflow
|
tensorflow
|
||||||
keras
|
keras
|
||||||
|
matplotlib
|
||||||
|
|
Loading…
Reference in a new issue