Link to GitHub repo. This project contains a collection of Jupyter notebooks to demonstrate Warped Linear Prediction techniques in DSP, including filter design and audio codecs.
I was looking to implement Tolonen and Karjalainen's summary autocorrelation method in "A computationally efficient multipitch analysis model." I needed a WLP pre-whitening filter as a first step to the algorithm. To that end, I gathered as many resources (papers, online lectures, blog posts, etc.) as I could find on Warped Linear Prediction. I chose Jupyter notebooks to show my work and annotate my thought process as I tried to develop an understanding of how to implement WLP.
As a final artifact to demonstrate the correct working of the WLP filter, I designed my own version of a WLPAC (Warped Linear Prediction audio codec), loosely based on the Harma and Laine's "WLPAC - a perceptual audio codec in a nutshell."
from wlpac import wlpac_encode, wlpac_decode
import scipy.io, scipy.io.wavfile
wlpac_encode('speech_m.wav', 'speech_m.wlpac', quality=0.3)
wlpac_decode('speech_m.wlpac', 'speech_m_roundtrip.wav')
fs, x = scipy.io.wavfile.read('speech_m.wav')
fs, x_wlpac = scipy.io.wavfile.read('speech_m_roundtrip.wav')
from IPython.display import Audio
Audio(x, rate=fs)
Audio(x_wlpac, rate=fs)
Use this project for:
The code is MIT-licensed so you can borrow code at will. Error reports and feedback are welcome and appreciated via GitHub issues.