I built a smart volume control system out of distributed Kalman filters + classic PID control to track the EBU-128 loudness envelope of an unknown sound source and attenuate the music gain to keep it at a comfortable level: <a href="https://wallfly.webflow.io/" rel="nofollow">https://wallfly.webflow.io/</a><p>The challenge comes when dealing with silence, or breaks in a song: if you detect silence, should the volume go up or down? Of course, the dynamics make the music and should not change, but you don't know that without access to the source signal. So you add latency to the PID controller, but then you get overshoot (classic time/accuracy trade-off).<p>To do perfect control you need access to the source signal, or lookahead, but you can still do a pretty good job without the source signal by capping the signal gain, i.e. only attenuate and never add amplify. Still compresses the signal, though.<p>There are some clever tricks used in radar systems that you can use to estimate the noise in a room, like coherence: <a href="https://en.wikipedia.org/wiki/Coherence_(signal_processing)" rel="nofollow">https://en.wikipedia.org/wiki/Coherence_(signal_processing)</a>.<p>In an LTI (linear time-invariant system), coherence can compare the acceleration of both input and output signals to calculate the power (but not the contents) of external signals that entered the system.<p>Coherence, is in my opinion, underused in industry.
The use of color to impart additional semantics in mathematical equations, at least to this degree, is not something I have considered before.<p>This is going to change a lot in how I communicate with math.
When implementing Kalman filters a common issue is that the covariance matrix P retards to be not positive semi-definite due to numerical errors. When this happens the Kalman filter may result REALLY weird results.<p>There is an easy fix for this that is rarely mentioned, except one runs into this issue and googles it:
After updating (prediction and observation) P just ensure its positive semi-definiteness by averaging with its transpose:<p>P := (P+transpose(P))/2
I recommend this article frequently when someone is looking to learn about Kalman filters. It's got some nice I intuition building descriptions. I also like <a href="https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python" rel="nofollow">https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Pyt...</a>
The latest innovative mainstream use of a Kalman filter that I'm aware of is from a Microsoft contribution to chromium, for better tracking the mouse:
<a href="https://chromium-review.googlesource.com/c/chromium/src/+/1822657" rel="nofollow">https://chromium-review.googlesource.com/c/chromium/src/+/18...</a>
Nice, I wrote an article too that helps develop an intuition without much math<p><a href="https://aguaviva.github.io/KalmanFilter/KalmanFilter.html" rel="nofollow">https://aguaviva.github.io/KalmanFilter/KalmanFilter.html</a>
If you want to learn Kalman Filter in depth then I can recommend the open source interactive book Kalman and Bayesian Filters in Python <a href="https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python" rel="nofollow">https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Pyt...</a>
When I used to develop Kalman filters, visualizing the covariances was the best way to understand/debug the setup. Two great libraries that I used were eigen3 (for the filter) and point cloud library (<a href="https://pointclouds.org/" rel="nofollow">https://pointclouds.org/</a>) for visuals.
Yes, and I love the pictures, but I wish they had a key attached, with the simple English name of each variable in the equation, because it’s no fun to hunt around a long article for the definition of a one letter variable. Common problem on Arxiv
See my recent submission on particle filters for an alternative to Kalman filters: <a href="https://news.ycombinator.com/item?id=23948245" rel="nofollow">https://news.ycombinator.com/item?id=23948245</a>
One thing the textbooks and explainers never seem to think to do is start with the one-dimensional case. All the confronting looking matrix equations reduce to an intuitive, even obvious set of arithmetic operations.
This video series helped me finally understand how to use Kalman Filters. <a href="https://www.youtube.com/watch?v=CaCcOwJPytQ" rel="nofollow">https://www.youtube.com/watch?v=CaCcOwJPytQ</a>
Great article. I've been trying to grok the Kalman filter for a while now, definitely seems to have clicked a little more this time. BTW if the author sees this the link at the bottom 'Some credit and referral should be given to...' seems to be broken.