Skip to content

Commit

Permalink
[FIX] : scipy.ndimage.morphology namespace is deprecated. Use `grey…
Browse files Browse the repository at this point in the history
…_opening` from the `scipy.ndimage` namespace instead
  • Loading branch information
shaupert committed Aug 8, 2024
1 parent e434362 commit 768e831
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions maad/sound/spectral_subtraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
get_unimode, mean_dB, power2dB)
import matplotlib.pyplot as plt
import numpy as np
from scipy.ndimage import morphology
from scipy import ndimage
from skimage.morphology import reconstruction
from scipy import signal
# min value
Expand Down Expand Up @@ -176,7 +176,7 @@ def remove_background(Sxx, gauss_win=50, gauss_std=25, beta1=1, beta2=1,

# White Top Hat (to remove non uniform background) = i - opening(i)
selem = signal.windows.gaussian(gauss_win, gauss_std)
noise_profile = morphology.grey_opening(mean_profile, structure=selem)
noise_profile = ndimage.grey_opening(mean_profile, structure=selem)

# Remove the artefact at the end of the spectrum (2 highest frequencies)
noise_profile[-2:] = mean_profile[-2:]
Expand Down

0 comments on commit 768e831

Please sign in to comment.