def synthesis_mel_generalized_cepstrum(mgc, source_excitation):
    b = ps.mgc2b(mgc, ALPHA, GAMMA)
    synthesizer = ps.synthesis.Synthesizer(
        ps.synthesis.MGLSADF(order=ORDER, alpha=ALPHA, stage=STAGE),
        HOP_LENGTH)
    synthesized = synthesizer.synthesis(source_excitation, b)
    return synthesized
示例#2
0
    def __test_synthesis(filt):
        # dummy source excitation
        source = __dummy_source()

        hopsize = 80

        # dummy filter coef.
        windowed = __dummy_windowed_frames(source,
                                           frame_len=512,
                                           hopsize=hopsize)
        gamma = -1.0 / filt.stage
        mgc = pysptk.mgcep(windowed, filt.order, filt.alpha, gamma)
        b = pysptk.mgc2b(mgc, filt.alpha, gamma)

        # synthesis
        synthesizer = Synthesizer(filt, hopsize)
        y = synthesizer.synthesis(source, b)
        assert np.all(np.isfinite(y))

        # transpose
        synthesizer = Synthesizer(filt, hopsize, transpose=True)
        y = synthesizer.synthesis(source, b)
        assert np.all(np.isfinite(y))