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

Function norm_f0

utils/pitch_utils.py:34–42  ·  view source on GitHub ↗
(f0, uv, hparams)

Source from the content-addressed store, hash-verified

32
33
34def norm_f0(f0, uv, hparams):
35 is_torch = isinstance(f0, torch.Tensor)
36 if hparams['pitch_norm'] == 'standard':
37 f0 = (f0 - hparams['f0_mean']) / hparams['f0_std']
38 if hparams['pitch_norm'] == 'log':
39 f0 = torch.log2(f0) if is_torch else np.log2(f0)
40 if uv is not None and hparams['use_uv']:
41 f0[uv > 0] = 0
42 return f0
43
44
45def norm_interp_f0(f0, hparams):

Callers 2

cwt2f0_normMethod · 0.90
norm_interp_f0Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected