LPC_for_TTS
1.0.0
Linear Prediction Coefficients estimation from mel-spectrogram implemented in Python based on Levinson-Durbin algorithm.
The linear prediction coefficient estimation is done based on the Levinson-Durbin induction method. This code can be used for estimating LPC coefficients, and can also be used for feature extraction of synthesizers such as LPCNet. The process is to obtain the Mel score from the audio and obtain the LPC from the Mel score.
from audio import *
import numpy as np
from hparams import Hparams as hparams
input_wav_file = 'test.wav'
sample_rate = 24000
lpc_order = 8
orig_audio , pred_audio , residual , lpcs = lpc_audio ( input_wav_file , lpc_order , hparams )
save_wav ( pred_audio , 'wavs/pred.wav' , hparams )
save_wav ( orig_audio , 'wavs/orig.wav' , hparams )
save_wav ( residual , 'wavs/error.wav' , hparams ) Raw audio: 
Predicted audio: 
Prediction error: