| 187 | """ |
| 188 | |
| 189 | def __init__(self, sampling_rate, upsample_scale, harmonic_num=0, sine_amp=0.1, |
| 190 | add_noise_std=0.003, voiced_threshod=0): |
| 191 | super(SourceModuleHnNSF, self).__init__() |
| 192 | |
| 193 | self.sine_amp = sine_amp |
| 194 | self.noise_std = add_noise_std |
| 195 | |
| 196 | # to produce sine waveforms |
| 197 | self.l_sin_gen = SineGen(sampling_rate, harmonic_num, |
| 198 | sine_amp, add_noise_std, voiced_threshod) |
| 199 | |
| 200 | # to merge source harmonics into a single excitation |
| 201 | self.l_linear = torch.nn.Linear(harmonic_num + 1, 1) |
| 202 | self.l_tanh = torch.nn.Tanh() |
| 203 | |
| 204 | def forward(self, x): |
| 205 | """ |