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

Function cwt2f0

utils/cwt.py:135–146  ·  view source on GitHub ↗
(cwt_spec, mean, std, cwt_scales)

Source from the content-addressed store, hash-verified

133
134
135def cwt2f0(cwt_spec, mean, std, cwt_scales):
136 assert len(mean.shape) == 1 and len(std.shape) == 1 and len(cwt_spec.shape) == 3
137 import torch
138 if isinstance(cwt_spec, torch.Tensor):
139 f0 = inverse_cwt_torch(cwt_spec, cwt_scales)
140 f0 = f0 * std[:, None] + mean[:, None]
141 f0 = f0.exp() # [B, T]
142 else:
143 f0 = inverse_cwt(cwt_spec, cwt_scales)
144 f0 = f0 * std[:, None] + mean[:, None]
145 f0 = np.exp(f0) # [B, T]
146 return f0

Callers 2

cwt2f0_normMethod · 0.90
plot_pitchMethod · 0.90

Calls 2

inverse_cwt_torchFunction · 0.85
inverse_cwtFunction · 0.85

Tested by

no test coverage detected