TacotronSTFT
TacotronSTFT
Bases: Module
Source code in training/preprocess/tacotron_stft.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
__init__(filter_length, hop_length, win_length, n_mel_channels, sampling_rate, center, mel_fmax, mel_fmin=0.0)
TacotronSTFT module that computes mel-spectrograms from a batch of waves.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filter_length |
int
|
Length of the filter window. |
required |
hop_length |
int
|
Number of samples between successive frames. |
required |
win_length |
int
|
Size of the STFT window. |
required |
n_mel_channels |
int
|
Number of mel bins. |
required |
sampling_rate |
int
|
Sampling rate of the input waveforms. |
required |
mel_fmin |
int or None
|
Minimum frequency for the mel filter bank. |
0.0
|
mel_fmax |
int or None
|
Maximum frequency for the mel filter bank. |
required |
center |
bool
|
Whether to pad the input signal on both sides. |
required |
Source code in training/preprocess/tacotron_stft.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
dynamic_range_compression_torch(x, C=1, clip_val=1e-05)
Applies dynamic range compression to x.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
Tensor
|
Input tensor. |
required |
C |
float
|
Compression factor. |
1
|
clip_val |
float
|
Clipping value. |
1e-05
|
Returns:
Type | Description |
---|---|
Tensor
|
torch.Tensor: Output tensor. |
Source code in training/preprocess/tacotron_stft.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|
forward(y)
Computes mel-spectrograms from a batch of waves.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
y |
FloatTensor
|
Input waveforms with shape (B, T) in range [-1, 1] |
required |
Returns:
Type | Description |
---|---|
Tensor
|
torch.FloatTensor: Spectrogram of shape (B, n_spech_channels, T) |
Tensor
|
torch.FloatTensor: Mel-spectrogram of shape (B, n_mel_channels, T) |
Source code in training/preprocess/tacotron_stft.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
linear_spectrogram(y)
Computes the linear spectrogram of a batch of waves.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
y |
Tensor
|
Input waveforms. |
required |
Returns:
Type | Description |
---|---|
Tensor
|
torch.Tensor: Linear spectrogram. |
Source code in training/preprocess/tacotron_stft.py
95 96 97 98 99 100 101 102 103 104 105 |
|
spectral_normalize_torch(magnitudes)
Applies dynamic range compression to magnitudes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
magnitudes |
Tensor
|
Input magnitudes. |
required |
Returns:
Type | Description |
---|---|
Tensor
|
torch.Tensor: Output magnitudes. |
Source code in training/preprocess/tacotron_stft.py
126 127 128 129 130 131 132 133 134 135 |
|