From 0ddc37c308de11844c13508b1807ba705bf91738 Mon Sep 17 00:00:00 2001 From: Asaf Zorea Date: Mon, 11 Dec 2023 23:39:12 +0200 Subject: [PATCH] Fixed a bug related to the win_length setting when using torchgating (#100) Fixed a warning using greater than function in stationary torchgating --- noisereduce/torchgate/torchgate.py | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/noisereduce/torchgate/torchgate.py b/noisereduce/torchgate/torchgate.py index b905775..7f056ed 100644 --- a/noisereduce/torchgate/torchgate.py +++ b/noisereduce/torchgate/torchgate.py @@ -39,7 +39,7 @@ def __init__( n_movemean_nonstationary: int = 20, prop_decrease: float = 1.0, n_fft: int = 1024, - win_length: bool = None, + win_length: int = None, hop_length: int = None, freq_mask_smooth_hz: float = 500, time_mask_smooth_ms: float = 50, @@ -161,7 +161,7 @@ def _stationary_mask( noise_thresh = mean_freq_noise + std_freq_noise * self.n_std_thresh_stationary # create binary mask by thresholding the spectrogram - sig_mask = X_db > noise_thresh.unsqueeze(2) + sig_mask = torch.gt(X_db, noise_thresh.unsqueeze(2)) return sig_mask @torch.no_grad() diff --git a/setup.py b/setup.py index 28d8577..fed50fc 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name="noisereduce", packages=find_packages(), - version="3.0.1", + version="3.0.2", description="Noise reduction using Spectral Gating in Python", author="Tim Sainburg", license="MIT",