# Probabilistic spectral analysis

Graphical introduction to nonstationary modelling of audio data. The input (bottom) is a sound recording of female speech. We seek to decompose the signal into Gaussian process carrier waveforms (blue block) multiplied by a spectrogram (green block). The spectrogram is learned from the data as a nonnegative matrix of weights times positive modulators (top).

I am interested in probabilistic analogues of time frequency analysis and, what is nearly the same thing, autocorrelation analysis, but for non-stationary signals. This is natural with Gaussian processes.

I am especially interested in this for audio signals, which can be very very large, but have certain simplicities - i.e. being scalar functions of a univariate time index, usually regularly sampled.

In signal processing we frequently use Fourier transforms as a notionally nonparametric model for such a system, or a source of features for analysis.

That is classic stuff but it is (for me) always unsatisfying just taking the Fourier transform of something and hoping to have learned stuff about the system. There are a lot of arbitrary tuning parameters and awkward assumptions about, e.g. local stationarity and arbitrary ways of introducing non-local correlation. The same holds for the deterministic autocorrelogram, on which I have recently published a paper. I got good results, but I had no principled way to select the regularisation and interpretation of the methods. Unsatisfying.

I think we can do better by looking at the probabilistic behaviour of Fourier transforms and treating these as Bayesian nonparametric problems. This could solve a few problems at once.

This is an active area, with a several approaches.

## Classic: stochastic processes studied via correlation function

I’ve discussed basic stationary signal analysis everywhere, but why not chack out some backgrounders in ?

## Non-stationary spectral kernel

The central tool here in practice is Bochner’s theorem, which states that the Fourier transform of some spectral measure is a valid covariance kernel:

$\kappa(\Delta t)=\mathcal{F}_{\Delta t}.$

Taking this insight and running with it you can do lots of fun stuff. is sometimes mentioned as ground-zero of this kind of research, although the connections are certainly much older, e.g. . Wiener and Khintchine approaches were not far from this and it is implicit in Kalman-Bucy filtering . There are natural extensions of classic results, e.g. a Shannon-Nyquist theorem @. In modern times we have related but more specialised techniques such as the probabilistic phase vocoder . See also the connections to time series state models of , , and .

There are nice introductions in some papers , which unite various pieces I was discussing above with actual applications. I will work through these methods here for my own edification.

🏗

The basic setting here is the same as for typical audio signal analysis; we begin with a (random) signal $$f:\mathbb{R}\to\mathbb{R}$$, where the argument is a continuous time index. We do not know this signal, but will infer its properties will have some countable number of discrete observations, $$\mathbf{f}:=\{f(t_k);k=1,2,\dots,K\}.$$

We imagine observations from this signal are modelled by a Gaussian process, giving us the same setup as Gaussian process regression. We introduce the additional assumption here that the scalar index $$\mathcal{I}:=\mathbb{R}$$. ) represents time.

I suppose what we are doing here is requiring that there be some model for sampling error and that it may as well be the most convenient possible model to work with, which is additive Gaussian. More general noise models are indeed possible, and if we allow other Gaussian processes as additive noise models then we are on the way to constructing a source separation model. That is is indeed what do.1

Anyway, with these choices, this becomes absolutely the classic Gaussian process regression with some specialisation. (univariate index, mean-0)

It is also not far from the classic time frequency spectral analysis setup, where we take Fourier transforms over fixed size windows to estimate a kind of deterministic approximation to $$\kappa$$ (thanks Wiener-Khintchine theorem); in that context we are effectively assuming that for each window we have an independent estimation problem, and a periodic kernel. I should make that relationship precise. 🏗

There is clearly a lot wrapped up in the kernel, $$\kappa(t, t';\mathbf{\theta}).$$

Typically this is some kind of spectral mixture kernel . summarizes these as:

\begin{aligned} \kappa_{\mathrm{sm}}\left(t, t^{\prime}\right) &=\sum_{d=1}^{D} \kappa_{z}^{(d)}\left(t, t^{\prime}\right) \\ \kappa_{z}^{(d)}\left(t, t^{\prime}\right) &=\sigma_{d}^{2} \cos \left(\omega_{d}\left(t-t^{\prime}\right)\right) \kappa_{d}\left(t, t^{\prime}\right) \end{aligned}

$$\kappa_{d}$$ is free to be chosen, but is typically from the Matérn class of kernel functions. Parameters $$\omega_{d}$$ determine the periodicity of the kernel components, which can be interpreted as the centre frequencies of the filters in a probabilistic filter bank. By choosing the exponential kernel $$\kappa_{d}\left(t, t^{\prime}\right)=\exp \left(\left|t-t^{\prime}\right| / \ell_{d}\right)$$ we recover exactly the probabilistic phase vocoder (Cemgil & Godsill, 2005 ), and the lengthscales $$\ell_{d}$$ control the filter bandwidths.

More generally we woudl like this to be a non-stationary kernel, which requires a model for the density of these kernels. uses a NMF model with a GP prior on some matrix rows and applying a softmax link. ( seems to get a similar structure?)

## Change point detection version

There is an alternative approach which looks at switching between covariance kernels. One strande is the AdaptSpect family of methods . I just enjoyed a seminar by Michael Bertolacci on this theme. Russell Tsuchida has made me aware of a parallel body of work .

## Non-Gaussian approaches

For now, see sparse stochastic processes.

## References

Adams, Ryan Prescott, and David J. C. MacKay. 2007. “Bayesian Online Changepoint Detection.” October 19, 2007. http://arxiv.org/abs/0710.3742.
Alvarado, Pablo A., Mauricio A. Alvarez, and Dan Stowell. 2019. “Sparse Gaussian Process Audio Source Separation Using Spectrum Priors in the Time-Domain.” In ICASSP 2019 - 2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 995–99. https://doi.org/10.1109/ICASSP.2019.8683287.
Alvarado, Pablo A., and Dan Stowell. 2018. “Efficient Learning of Harmonic Priors for Pitch Detection in Polyphonic Music.” November 16, 2018. http://arxiv.org/abs/1705.07104.
Bertolacci, Michael. 2019. “Hierarchical Bayesian Mixture Models for Spatiotemporal Data with Nonstandard Features.”
Bertolacci, Michael, Edward Cripps, Ori Rosen, John W. Lau, and Sally Cripps. 2019. “Climate Inference on Daily Rainfall Across the Australian Continent, 1876–2015.” Annals of Applied Statistics 13 (2): 683–712. https://doi.org/10.1214/18-AOAS1218.
Bertolacci, Michael, Ori Rosen, Edward Cripps, and Sally Cripps. 2020. AdaptSPEC-X: Covariate Dependent Spectral Modeling of Multiple Nonstationary Time Series.” June 4, 2020. http://arxiv.org/abs/1908.06622.
Cemgil, Ali Taylan. 2009. “Bayesian Inference for Nonnegative Matrix Factorisation Models.” Computational Intelligence and Neuroscience. https://doi.org/10.1155/2009/785152.
Cheng, Changqing, Akkarapol Sa-Ngasoongsong, Omer Beyca, Trung Le, Hui Yang, Zhenyu (James) Kong, and Satish T. S. Bukkapatnam. 2015. “Time Series Forecasting for Nonlinear and Non-Stationary Processes: A Review and Comparative Study.” IIE Transactions 47 (10): 1053–71. https://doi.org/10.1080/0740817X.2014.999180.
Choudhuri, Nidhan, Subhashis Ghosal, and Anindya Roy. 2004. “Bayesian Estimation of the Spectral Density of a Time Series.” Journal of the American Statistical Association 99 (468): 1050–59. https://doi.org/10.1198/016214504000000557.
Cunningham, John P., Krishna V. Shenoy, and Maneesh Sahani. 2008. “Fast Gaussian Process Methods for Point Process Intensity Estimation.” In Proceedings of the 25th International Conference on Machine Learning, 192–99. ICML ’08. New York, NY, USA: ACM Press. https://doi.org/10.1145/1390156.1390181.
Curtain, Ruth F. 1975. “Infinite-Dimensional Filtering.” SIAM Journal on Control 13 (1): 89–104. https://doi.org/10.1137/0313005.
Duvenaud, David K., Hannes Nickisch, and Carl E. Rasmussen. 2011. “Additive Gaussian Processes.” In Advances in Neural Information Processing Systems, 226–34. http://papers.nips.cc/paper/4221-additive-gaussian-processes.pdf.
Edwards, Matthew C., Renate Meyer, and Nelson Christensen. 2019. “Bayesian Nonparametric Spectral Density Estimation Using B-Spline Priors.” Statistics and Computing 29 (1): 67–78. https://doi.org/10.1007/s11222-017-9796-9.
Févotte, Cédric, Nancy Bertin, and Jean-Louis Durrieu. 2008. “Nonnegative Matrix Factorization with the Itakura-Saito Divergence: With Application to Music Analysis.” Neural Computation 21 (3): 793–830. https://doi.org/10.1162/neco.2008.04-08-771.
Girolami, Mark, and Simon Rogers. 2005. “Hierarchic Bayesian Models for Kernel Learning.” In Proceedings of the 22nd International Conference on Machine Learning - ICML ’05, 241–48. Bonn, Germany: ACM Press. https://doi.org/10.1145/1102351.1102382.
Godsill, Simon J, and Ali Taylan Cemgil. 2005. “Probabilistic Phase Vocoder and Its Application to Interpolation of Missing Values in Audio Signals.” In 2005 13th European Signal Processing Conference, 4. https://www.eurasip.org/Proceedings/Eusipco/Eusipco2005/defevent/papers/cr1319.pdf.
Hartikainen, J., and S. Särkkä. 2010. “Kalman Filtering and Smoothing Solutions to Temporal Gaussian Process Regression Models.” In 2010 IEEE International Workshop on Machine Learning for Signal Processing, 379–84. Kittila, Finland: IEEE. https://doi.org/10.1109/MLSP.2010.5589113.
Hensman, James, Nicolas Durrande, and Arno Solin. 2018. “Variational Fourier Features for Gaussian Processes.” Journal of Machine Learning Research 18 (151): 1–52. http://jmlr.org/papers/v18/16-579.html.
Hermansen, Gudmund Horn. 2008. “Bayesian Nonparametric Modelling of Covariance Functions, with Application to Time Series and Spatial Statistics.” https://www.duo.uio.no/handle/10852/10811.
Jesus, Joao, and Richard E. Chandler. 2017. “Inference with the Whittle Likelihood: A Tractable Approach Using Estimating Functions.” Journal of Time Series Analysis 38 (2): 204–24. https://doi.org/10.1111/jtsa.12225.
Kailath, Thomas. 1971. “The Structure of Radon-Nikodym Derivatives with Respect to Wiener and Related Measures.” The Annals of Mathematical Statistics 42 (3): 1054–67.
Kalman, R. 1959. “On the General Theory of Control Systems.” IRE Transactions on Automatic Control 4 (3): 110–10. https://doi.org/10.1109/TAC.1959.1104873.
Kalman, R. E. 1960. “A New Approach to Linear Filtering and Prediction Problems.” Journal of Basic Engineering 82 (1): 35. https://doi.org/10.1115/1.3662552.
Karvonen, Toni, and Simo Särkkä. 2016. “Approximate State-Space Gaussian Processes via Spectral Transformation.” In 2016 IEEE 26th International Workshop on Machine Learning for Signal Processing (MLSP), 1–6. Vietri sul Mare, Salerno, Italy: IEEE. https://doi.org/10.1109/MLSP.2016.7738812.
Kirch, Claudia, Matthew C. Edwards, Alexander Meier, and Renate Meyer. 2019. “Beyond Whittle: Nonparametric Correction of a Parametric Likelihood with a Focus on Bayesian Time Series Analysis.” Bayesian Analysis 14 (4): 1037–73. https://doi.org/10.1214/18-BA1126.
Lindgren, Finn, Håvard Rue, and Johan Lindström. 2011. “An Explicit Link Between Gaussian Fields and Gaussian Markov Random Fields: The Stochastic Partial Differential Equation Approach.” Journal of the Royal Statistical Society: Series B (Statistical Methodology) 73 (4): 423–98. https://doi.org/10.1111/j.1467-9868.2011.00777.x.
Liutkus, Antoine, Roland Badeau, and Gäel Richard. 2011. “Gaussian Processes for Underdetermined Source Separation.” IEEE Transactions on Signal Processing 59 (7, 7): 3155–67. https://doi.org/10.1109/TSP.2011.2119315.
Liutkus, Antoine, Zafar Rafii, Bryan Pardo, Derry Fitzgerald, and Laurent Daudet. 2014. “Kernel Spectrogram Models for Source Separation.” In, 6–10. IEEE. https://doi.org/10.1109/HSCMA.2014.6843240.
Macaro, Christian, and Raquel Prado. 2014. “Spectral Decompositions of Multiple Time Series: A Bayesian Non-Parametric Approach.” Psychometrika 79 (1): 105–29. https://doi.org/10.1007/s11336-013-9354-0.
Meier, Alexander, Claudia Kirch, and Renate Meyer. 2020. “Bayesian Nonparametric Analysis of Multivariate Time Series: A Matrix Gamma Process Approach.” Journal of Multivariate Analysis 175 (January): 104560. https://doi.org/10.1016/j.jmva.2019.104560.
Nickisch, Hannes, Arno Solin, and Alexander Grigorevskiy. 2018. “State Space Gaussian Processes with Non-Gaussian Likelihood.” In International Conference on Machine Learning, 3789–98. http://proceedings.mlr.press/v80/nickisch18a.html.
Osborne, Michael A. 2010. “Bayesian Gaussian Processes for Sequential Prediction, Optimisation and Quadrature.” Http://purl.org/dc/dcmitype/Text, Oxford University, UK. https://ora.ox.ac.uk/objects/uuid:1418c926-6636-4d96-8bf6-5d94240f3d1f.
Rasmussen, Carl Edward, and Hannes Nickisch. 2010. “Gaussian Processes for Machine Learning (GPML) Toolbox.” Journal of Machine Learning Research 11: 3011–15. http://www.jmlr.org/papers/v11/rasmussen10a.html.
Reece, S., and S. Roberts. 2010. “An Introduction to Gaussian Processes for the Kalman Filter Expert.” In 2010 13th International Conference on Information Fusion, 1–9. https://doi.org/10.1109/ICIF.2010.5711863.
Remes, Sami, Markus Heinonen, and Samuel Kaski. 2017. “Non-Stationary Spectral Kernels.” In Advances in Neural Information Processing Systems 30, edited by I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, 4642–51. Curran Associates, Inc. http://papers.nips.cc/paper/7050-non-stationary-spectral-kernels.pdf.
———. 2018. “Neural Non-Stationary Spectral Kernel.” November 27, 2018. http://arxiv.org/abs/1811.10978.
Roberts, S., M. Osborne, M. Ebden, S. Reece, N. Gibson, and S. Aigrain. 2013. “Gaussian Processes for Time-Series Modelling.” Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences 371 (1984): 20110550. https://doi.org/10.1098/rsta.2011.0550.
Rosen, Ori, David S. Stoffer, and Sally Wood. 2009. “Local Spectral Analysis via a Bayesian Mixture of Smoothing Splines.” Journal of the American Statistical Association 104 (485): 249–62. https://doi.org/10.1198/jasa.2009.0118.
Rosen, Ori, Sally Wood, and David S. Stoffer. 2012. AdaptSPEC: Adaptive Spectral Estimation for Nonstationary Time Series.” Journal of the American Statistical Association 107 (500): 1575–89. https://doi.org/10.1080/01621459.2012.716340.
Saatçi, Yunus, Ryan Turner, and Carl Edward Rasmussen. 2010. “Gaussian Process Change Point Models.” In Proceedings of the 27th International Conference on International Conference on Machine Learning, 927–34. ICML’10. Madison, WI, USA: Omnipress. http://publications.eng.cam.ac.uk/345777/.
Särkkä, S., and J. Hartikainen. 2013. “Non-Linear Noise Adaptive Kalman Filtering via Variational Bayes.” In 2013 IEEE International Workshop on Machine Learning for Signal Processing (MLSP), 1–6. https://doi.org/10.1109/MLSP.2013.6661935.
Särkkä, Simo. 2007. “On Unscented Kalman Filtering for State Estimation of Continuous-Time Nonlinear Systems.” IEEE Transactions on Automatic Control 52 (9): 1631–41. https://doi.org/10.1109/TAC.2007.904453.
Särkkä, Simo, and A. Nummenmaa. 2009. “Recursive Noise Adaptive Kalman Filtering by Variational Bayesian Approximations.” IEEE Transactions on Automatic Control 54 (3): 596–600. https://doi.org/10.1109/TAC.2008.2008348.
Särkkä, Simo, A. Solin, and J. Hartikainen. 2013. “Spatiotemporal Learning via Infinite-Dimensional Bayesian Filtering and Smoothing: A Look at Gaussian Process Regression Through Kalman Filtering.” IEEE Signal Processing Magazine 30 (4, 4): 51–61. https://doi.org/10.1109/MSP.2013.2246292.
Särkkä, Simo, and Arno Solin. 2019. Applied Stochastic Differential Equations. Institute of Mathematical Statistics Textbooks 10. Cambridge ; New York, NY: Cambridge University Press. https://users.aalto.fi/~ssarkka/pub/sde_book.pdf.
Solin, Arno. 2016. “Stochastic Differential Equation Methods for Spatio-Temporal Gaussian Process Regression.” Aalto University. https://aaltodoc.aalto.fi:443/handle/123456789/19842.
Solin, Arno, and Simo Särkkä. 2013. “Infinite-Dimensional Bayesian Filtering for Detection of Quasiperiodic Phenomena in Spatiotemporal Data.” Physical Review E 88 (5): 052909. https://doi.org/10.1103/PhysRevE.88.052909.
———. 2014. “Explicit Link Between Periodic Covariance Functions and State Space Models.” In Artificial Intelligence and Statistics, 904–12. http://proceedings.mlr.press/v33/solin14.html.
Sykulski, Adam M., Sofia C. Olhede, Arthur P. Guillaumin, Jonathan M. Lilly, and Jeffrey J. Early. 2019. “The Debiased Whittle Likelihood.” Biometrika 106 (2): 251–66. https://doi.org/10.1093/biomet/asy071.
Tobar, Felipe. 2019. “Band-Limited Gaussian Processes: The Sinc Kernel.” Advances in Neural Information Processing Systems 32: 12749–59. https://proceedings.neurips.cc/paper/2019/hash/ccce2fab7336b8bc8362d115dec2d5a2-Abstract.html.
Tobar, Felipe, Lerko Araya-Hernández, Pablo Huijse, and Petar M. Djurić. 2020. “Bayesian Reconstruction of Fourier Pairs.” November 9, 2020. http://arxiv.org/abs/2011.04585.
Tuft, Marie. 2020. “Statistical Learning for the Spectral Analysis of Time Series Data.” http://d-scholarship.pitt.edu/39351/.
Turner, Richard E., and Maneesh Sahani. 2014. “Time-Frequency Analysis as Probabilistic Inference.” IEEE Transactions on Signal Processing 62 (23): 6171–83. https://doi.org/10.1109/TSP.2014.2362100.
Valenzuela, C., and F. Tobar. 2019. “Low-Pass Filtering as Bayesian Inference.” In ICASSP 2019 - 2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 3367–71. https://doi.org/10.1109/ICASSP.2019.8683798.
Virtanen, T., A. Taylan Cemgil, and S. Godsill. 2008. “Bayesian Extensions to Non-Negative Matrix Factorisation for Audio Signal Modelling.” In 2008 IEEE International Conference on Acoustics, Speech and Signal Processing, 1825–28. https://doi.org/10.1109/ICASSP.2008.4517987.
Wiener, N, and P Masani. 1957. “The Prediction Theory of Multivariate Stochastic Processes.” Acta Mathematica 98 (1): 111–50. https://doi.org/10.1007/BF02404472.
———. 1958. “The Prediction Theory of Multivariate Stochastic Processes, II.” Acta Mathematica 99 (1): 93–137. https://doi.org/10.1007/BF02392423.
Wilkinson, W. 2019. “Gaussian Process Modelling for Audio Signals.” Thesis, London: Queen Mary University of London. https://qmro.qmul.ac.uk/xmlui/handle/123456789/61329.
Wilkinson, William J., M. Riis Andersen, J. D. Reiss, D. Stowell, and A. Solin. 2019a. “Unifying Probabilistic Models for Time-Frequency Analysis.” In ICASSP 2019 - 2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 3352–56. https://doi.org/10.1109/ICASSP.2019.8682306.
Wilkinson, William J., Michael Riis Andersen, Joshua D. Reiss, Dan Stowell, and Arno Solin. 2019b. “End-to-End Probabilistic Inference for Nonstationary Audio Analysis.” January 31, 2019. https://arxiv.org/abs/1901.11436v1.
Wilson, Andrew Gordon, and Ryan Prescott Adams. 2013. “Gaussian Process Kernels for Pattern Discovery and Extrapolation.” In International Conference on Machine Learning. http://arxiv.org/abs/1302.4245.
Yaglom, A. M. 1987. Correlation Theory of Stationary and Related Random Functions. Volume II: Supplementary Notes and References. Springer Series in Statistics. New York, NY: Springer Science & Business Media.
Zheng, Yanbing, Jun Zhu, and Anindya Roy. 2010. “Nonparametric Bayesian Inference for the Spectral Density Function of a Random Field.” Biometrika 97 (1): 238–45. https://doi.org/10.1093/biomet/asp066.

1. We might more generally consider a sampling problem where we observe the signal through inner products with some sampling kernel, possibly even a stochastic one, but that sounds complicated.↩︎