Skip to content
Snippets Groups Projects
Commit 80b157de authored by Stephane Chavin's avatar Stephane Chavin
Browse files

remove vmin spectro

parent 1f150fe1
No related branches found
No related tags found
No related merge requests found
......@@ -109,7 +109,7 @@ def create_spectrogram(sig, directory, names, cmap, window_size=1024, overlap=.5
fig = plt.figure()
# plot the spectrogram
plt.imshow(stft[::-1], aspect='auto',
interpolation=None, cmap=cmap, vmin=stft.mean())
interpolation=None, cmap=cmap) # you can add : vmin=stft.mean())
# Remove all the borders around the plot
plt.subplots_adjust(top=1, bottom=0, left=0, right=1)
if names:
......
......@@ -291,7 +291,7 @@ class LoadSpectros:
hop_length=hop, window='hann') # Compute the STFT
stft = np.log10(np.abs(stft))
axim = plt.imshow(stft, aspect = "auto", interpolation = None,
cmap = self.cmap, vmin=np.mean(stft))
cmap = self.cmap) # you can add : vmin=np.mean(stft))
plt.subplots_adjust(top=1, bottom=0, left=0, right=1)
im0 = axim.make_image(fig.canvas)[0][:,:,:-1][:,:,::-1]
cv2.imwrite(path, im0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment