| 144 | Here, PulseGen is based on SinGen. For a perfect |
| 145 | """ |
| 146 | def __init__(self, samp_rate, pulse_amp = 0.1, |
| 147 | noise_std = 0.003, voiced_threshold = 0): |
| 148 | super(PulseGen, self).__init__() |
| 149 | self.pulse_amp = pulse_amp |
| 150 | self.sampling_rate = samp_rate |
| 151 | self.voiced_threshold = voiced_threshold |
| 152 | self.noise_std = noise_std |
| 153 | self.l_sinegen = SineGen(self.sampling_rate, harmonic_num=0, \ |
| 154 | sine_amp=self.pulse_amp, noise_std=0, \ |
| 155 | voiced_threshold=self.voiced_threshold, \ |
| 156 | flag_for_pulse=True) |
| 157 | |
| 158 | def forward(self, f0): |
| 159 | """ Pulse train generator |