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

Function inverse_cwt_torch

utils/cwt.py:118–124  ·  view source on GitHub ↗
(Wavelet_lf0, scales)

Source from the content-addressed store, hash-verified

116
117
118def inverse_cwt_torch(Wavelet_lf0, scales):
119 import torch
120 b = ((torch.arange(0, len(scales)).float().to(Wavelet_lf0.device)[None, None, :] + 1 + 2.5) ** (-2.5))
121 lf0_rec = Wavelet_lf0 * b
122 lf0_rec_sum = lf0_rec.sum(-1)
123 lf0_rec_sum = (lf0_rec_sum - lf0_rec_sum.mean(-1, keepdim=True)) / lf0_rec_sum.std(-1, keepdim=True)
124 return lf0_rec_sum
125
126
127def inverse_cwt(Wavelet_lf0, scales):

Callers 1

cwt2f0Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected