espnet2.gan_svs.visinger2.visinger2_vocoder.Generator_Harm
Less than 1 minute
espnet2.gan_svs.visinger2.visinger2_vocoder.Generator_Harm
class espnet2.gan_svs.visinger2.visinger2_vocoder.Generator_Harm(hidden_channels: int = 192, n_harmonic: int = 64, kernel_size: int = 3, padding: int = 1, dropout_rate: float = 0.1, sample_rate: int = 22050, hop_size: int = 256)
Bases: Module
Initialize harmonic generator module.
- Parameters:
- hidden_channels (int) – Number of channels in the input and hidden layers.
- n_harmonic (int) – Number of harmonic channels.
- kernel_size (int) – Size of the convolutional kernel.
- padding (int) – Amount of padding added to the input.
- dropout_rate (float) – Dropout rate.
- sample_rate (int) – Sampling rate of the input audio.
- hop_size (int) – Hop size used in the analysis of the input audio.
forward(f0, harm, mask)
Generate harmonics from F0 and harmonic data.
- Parameters:
- f0 (Tensor) – Pitch (F0) tensor (B, 1, T).
- harm (Tensor) – Harmonic data tensor (B, hidden_channels, T).
- mask (Tensor) – Mask tensor for harmonic data (B, 1, T).
- Returns: Harmonic signal tensor (B, n_harmonic, T * hop_length).
- Return type: Tensor