| 227 | uv (batchsize, length, 1) |
| 228 | """ |
| 229 | def __init__(self, sampling_rate, upsample_scale, harmonic_num=0, sine_amp=0.1, |
| 230 | add_noise_std=0.003, voiced_threshod=0): |
| 231 | super(SourceModuleHnNSF, self).__init__() |
| 232 | self.sine_amp = sine_amp |
| 233 | self.noise_std = add_noise_std |
| 234 | # to produce sine waveforms |
| 235 | self.l_sin_gen = SineGen(sampling_rate, upsample_scale, harmonic_num, |
| 236 | sine_amp, add_noise_std, voiced_threshod) |
| 237 | # to merge source harmonics into a single excitation |
| 238 | self.l_linear = nn.Linear(harmonic_num + 1, 1) |
| 239 | self.l_tanh = nn.Tanh() |
| 240 | |
| 241 | def forward(self, x): |
| 242 | """ |