MCPcopy Index your code
hub / github.com/MoonInTheRiver/DiffSinger / denorm_f0

Function denorm_f0

utils/pitch_utils.py:63–76  ·  view source on GitHub ↗
(f0, uv, hparams, pitch_padding=None, min=None, max=None)

Source from the content-addressed store, hash-verified

61
62
63def denorm_f0(f0, uv, hparams, pitch_padding=None, min=None, max=None):
64 if hparams['pitch_norm'] == 'standard':
65 f0 = f0 * hparams['f0_std'] + hparams['f0_mean']
66 if hparams['pitch_norm'] == 'log':
67 f0 = 2 ** f0
68 if min is not None:
69 f0 = f0.clamp(min=min)
70 if max is not None:
71 f0 = f0.clamp(max=max)
72 if uv is not None and hparams['use_uv']:
73 f0[uv > 0] = 0
74 if pitch_padding is not None:
75 f0[pitch_padding] = 0
76 return f0

Callers 10

validation_stepMethod · 0.90
validation_stepMethod · 0.90
test_stepMethod · 0.90
validation_stepMethod · 0.90
add_pitchMethod · 0.90
forwardMethod · 0.90
plot_pitchMethod · 0.90
test_stepMethod · 0.90
expand_f0_phMethod · 0.90
plot_pitchMethod · 0.90

Calls

no outgoing calls

Tested by 2

test_stepMethod · 0.72
test_stepMethod · 0.72