MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / denoise

Function denoise

vocoders/vocoder_utils.py:7–15  ·  view source on GitHub ↗
(wav, v=0.1)

Source from the content-addressed store, hash-verified

5
6
7def denoise(wav, v=0.1):
8 spec = librosa.stft(y=wav, n_fft=hparams['fft_size'], hop_length=hparams['hop_size'],
9 win_length=hparams['win_size'], pad_mode='constant')
10 spec_m = np.abs(spec)
11 spec_m = np.clip(spec_m - v, a_min=0, a_max=None)
12 spec_a = np.angle(spec)
13
14 return librosa.istft(spec_m * np.exp(1j * spec_a), hop_length=hparams['hop_size'],
15 win_length=hparams['win_size'])

Callers 1

spec2wavMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected