First of my experiments on audio modelling using gaussian processes. Here, I construct a GP that, when sampled, plays middle c the way a grand piano would.
I tried using the Spectral Mixture kernel and the Gaussian Process Convolution Model for this, but neither seemed to work well for me (numerical issues with the covariance, likelihood has too many modes respectively). However, I did learn about the vec trick and that sympy handles infinite precision - for more info check out my scicomp question here.
Due to the difficulty in automating the inference for the kernel, I decided to try my hand at writing it out myself. It’s a simple signal, so it was pretty easy.
Its sample autocorrelation by time:
Key observations about the signal are:
It’s highly periodic, with the same frequency.
The autocorrelation decays to zero if you go far enough away.
The signal is heteroskedastic, with the variance decreasing over time.
The autocorrelation function seems to change at some point.
I designed a kernel with these charecteristics. It may’ve been a total accident (haven’t checked yet), but this works! The result: