This was my attempt to understand what the code was doing, but I went down the “I should learn signal processing” rabbit hole for a while and eventually got distracted.
This notebook is great, kudos for sort of "thinking out loud" as you figured it out. I'd forgotten about Observable notebooks and makes me want to try them again.