Skip to content

Commit 95bf014

Browse files
authored
Merge pull request #207 from TensorSpeech/fix-pqmf
🔧 Fix pqmf
2 parents 3c388e7 + 8397a9c commit 95bf014

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tensorflow_tts/configs/mb_melgan.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class MultiBandMelGANGeneratorConfig(MelGANGeneratorConfig):
2222

2323
def __init__(self, **kwargs):
2424
super().__init__(**kwargs)
25-
self.subbands = 4
26-
self.taps = 62
27-
self.cutoff_ratio = 0.15
28-
self.beta = 9.0
25+
self.subbands = kwargs.pop("subbands", 4)
26+
self.taps = kwargs.pop("taps", 62)
27+
self.cutoff_ratio = kwargs.pop("cutoff_ratio", 0.142)
28+
self.beta = kwargs.pop("beta", 9.0)
2929

3030

3131
class MultiBandMelGANDiscriminatorConfig(MelGANDiscriminatorConfig):

tensorflow_tts/models/mb_melgan.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def __init__(self, config, **kwargs):
8282
* np.cos(
8383
(2 * k + 1)
8484
* (np.pi / (2 * subbands))
85-
* (np.arange(taps + 1) - ((taps - 1) / 2))
85+
* (np.arange(taps + 1) - (taps / 2))
8686
+ (-1) ** k * np.pi / 4
8787
)
8888
)
@@ -92,7 +92,7 @@ def __init__(self, config, **kwargs):
9292
* np.cos(
9393
(2 * k + 1)
9494
* (np.pi / (2 * subbands))
95-
* (np.arange(taps + 1) - ((taps - 1) / 2))
95+
* (np.arange(taps + 1) - (taps / 2))
9696
- (-1) ** k * np.pi / 4
9797
)
9898
)
@@ -101,7 +101,7 @@ def __init__(self, config, **kwargs):
101101
analysis_filter = np.expand_dims(h_analysis, 1)
102102
analysis_filter = np.transpose(analysis_filter, (2, 1, 0))
103103

104-
synthesis_filter = np.expand_dims(h_analysis, 0)
104+
synthesis_filter = np.expand_dims(h_synthesis, 0)
105105
synthesis_filter = np.transpose(synthesis_filter, (2, 1, 0))
106106

107107
# filter for downsampling & upsampling

0 commit comments

Comments
 (0)