コード例 #1
0
def test_pqmf():
    w, sr = load(WAV_FILE)

    layer = PQMF(N=4, taps=62, cutoff=0.15, beta=9.0)
    w, sr = load(WAV_FILE)
    w2 = tf.convert_to_tensor(w[None, None, :])
    b2 = layer.analysis(w2)
    w2_ = layer.synthesis(b2)
    w2_ = w2.numpy()

    print(w2_.max())
    print(w2_.min())
    print(w2_.mean())
    sf.write('tf_pqmf_output.wav', w2_.flatten(), sr)
コード例 #2
0
 def __init__(self,
              in_channels=80,
              out_channels=4,
              proj_kernel=7,
              base_channels=384,
              upsample_factors=(2, 8, 2, 2),
              res_kernel=3,
              num_res_blocks=3):
     super(MultibandMelganGenerator,
           self).__init__(in_channels=in_channels,
                          out_channels=out_channels,
                          proj_kernel=proj_kernel,
                          base_channels=base_channels,
                          upsample_factors=upsample_factors,
                          res_kernel=res_kernel,
                          num_res_blocks=num_res_blocks)
     self.pqmf_layer = PQMF(N=4, taps=62, cutoff=0.15, beta=9.0)