<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Nathan Ho (Posts about mathematics)</title><link>https://nathan.ho.name/</link><description></description><atom:link href="https://nathan.ho.name/categories/mathematics.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>© 2026</copyright><lastBuildDate>Thu, 07 May 2026 05:13:16 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Composing with Accelerating Rhythms</title><link>https://nathan.ho.name/posts/accelerating-rhythms/</link><dc:creator>Nathan Ho</dc:creator><description>&lt;div&gt;&lt;p&gt;Thanks to all who checked out my album &lt;a class="reference external" href="https://nathanho.bandcamp.com/album/haywire-frontier"&gt;&lt;em&gt;Haywire Frontier&lt;/em&gt;&lt;/a&gt;. Yesterday, I gave a remote talk for the &lt;a class="reference external" href="https://notam.no/meetups/supercollider-meetup/"&gt;NOTAM SuperCollider meetup&lt;/a&gt; on the project. The talk wasn’t recorded, but I decided to rework it into prose. This is partially for the benefit of people that missed the event, but mostly because I’m too lazy to research and write a new post wholly from scratch this month.&lt;/p&gt;
&lt;p&gt;It’s not necessary to listen to the album to understand this post, but of course I would appreciate it.&lt;/p&gt;
&lt;section id="acceleration-from-notes-to-an-entire-piece"&gt;
&lt;h2&gt;Acceleration from notes to an entire piece&lt;/h2&gt;
&lt;p&gt;One of the earliest decisions I had to make while planning out &lt;em&gt;Haywire Frontier&lt;/em&gt; was how to approach rhythm. I’m a huge fan of breakcore and old school ragga jungle (Venetian Snares’ work convinced me to dedicate my life to electronic music), and partially as a result of that, unpitched percussion and complex rhythms are central to a lot of my output.&lt;/p&gt;
&lt;p&gt;However, I resolved pretty early on that I didn’t want the rhythmic material of the project to fall into the grids and time signatures of dance music. My reasons for this are nebulous and difficult to articulate, but I think a big part is that I wanted to challenge myself. When I make beat-based music, which I do frequently, I tend to think relative to established genres like drum-‘n’-bass or techno or house, and I mimic the tropes of what I want to imitate. Removing those guardrails, while still trying to make music conducive to active listening, puts me out of my comfort zone. I like to put myself in creative situations where I feel a little awkward or uncomfortable, because if there’s anything I personally fear in my creative output, it’s complacency. &lt;a class="brackets" href="https://nathan.ho.name/posts/accelerating-rhythms/#footnote-1" id="footnote-reference-1" role="doc-noteref"&gt;&lt;span class="fn-bracket"&gt;[&lt;/span&gt;1&lt;span class="fn-bracket"&gt;]&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So beats are out. An alternative, which I have used a lot in the past, is a type of randomized rhythm I call the “i.i.d. rhythm,” or “&lt;code class="docutils literal"&gt;Pwhite&lt;/code&gt;-into-&lt;code class="docutils literal"&gt;\dur&lt;/code&gt; rhythm:”&lt;/p&gt;
&lt;audio controls src="https://nathan.ho.name/audio/rhythms/white.mp3"&gt;&lt;/audio&gt;&lt;p&gt;SuperCollider code:&lt;/p&gt;
&lt;pre class="literal-block"&gt;// NB: Full aggregated code from example, plus SynthDefs, are at the end of the post.
Routine({
    loop {
        s.bind { Synth(\kick) };
        rrand(0.03, 0.6).wait;
    };
}).play;&lt;/pre&gt;
&lt;p&gt;In these rhythms, the inter-onset intervals (IOIs), or time between successive hits, are chosen with a single random distribution. In statistics terms, the IOIs are &lt;em&gt;i.i.d.&lt;/em&gt;, or independently and identically distributed. The distribution is uniform in this example, but you can use log-uniform, or &lt;a class="reference external" href="https://en.wikipedia.org/wiki/List_of_probability_distributions"&gt;any distribution&lt;/a&gt; over the positive real numbers.&lt;/p&gt;
&lt;p&gt;Every SuperCollider user has written one of these rhythms at some point. They’re perfectly serviceable for some applications. However, for rhythmic material that drives an entire percussion section, I have to admit that I find these tiresome and uninspiring. In one word, what these rhythms lack is phrasing.&lt;/p&gt;
&lt;p&gt;If you were to grab a non-musician, give them a snare drum, and ask them to hit it “randomly,” their result would be nothing like this. They might produce a cluster of rapid hits, then silence, then a nearly steady rhythm, and modulate between all those approaches. That’s to say nothing of a free jazz drummer who’s spent years training to produce complex, compelling rhythms that may not fall on a grid. It’s &lt;a class="reference external" href="https://psycnet.apa.org/record/1972-09976-001"&gt;well known to psychologists&lt;/a&gt; that humans are very bad at producing data that passes randomness tests; I view it as Geiger-counter-type rhythms failing to pass humanity tests.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://nathan.ho.name/posts/accelerating-rhythms/"&gt;Read more…&lt;/a&gt; (15 min remaining to read)&lt;/p&gt;&lt;/section&gt;&lt;/div&gt;</description><category>algorithmic composition</category><category>mathematics</category><category>music composition</category><category>music theory</category><category>rhythm</category><category>supercollider</category><guid>https://nathan.ho.name/posts/accelerating-rhythms/</guid><pubDate>Thu, 21 Sep 2023 16:12:14 GMT</pubDate></item><item><title>An Intro to Wavelets for Computer Musicians</title><link>https://nathan.ho.name/posts/wavelets/</link><dc:creator>Nathan Ho</dc:creator><description>&lt;div&gt;&lt;p&gt;&lt;em&gt;I wasn’t able to get this post fully complete in time for my self-imposed monthly deadline. I have decided to put it up in an incomplete state and clean it up in early September. I hope it is informative even in its current condition, which gets increasingly sketchy towards the end. Open during construction.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Among DSP types, those unfamiliar with wavelets often view them as a mysterious dark art, vaguely rumored to be “superior” to FFT in some way but for reasons not well understood. Computer musicians with a penchant for unusual and bizarre DSP (for instance, people who read niche blogs devoted to the topic) tend to get particularly excited about wavelets purely for their novelty. Is the phase vocoder too passé for you? Are you on some kind of Baudelairean hedonic treadmill where even the most eldritch Composers Desktop Project commands bore you?&lt;/p&gt;
&lt;p&gt;Well, here it is: my introduction to wavelets, specifically written for those with a background in audio signal processing. I’ve been writing this post on and off for most of 2023, and while I am in no way a wavelet expert, I finally feel ready to explain them. I’ve found that a lot of wavelet resources are far too detailed, containing information mainly useful to people wishing to invent new wavelets rather than people who just want to implement and use them. After you peel back those layers, wavelets are surprisingly not so scary! Maybe not easy, but I do think it’s possible to explain wavelets in an accessible and pragmatic way. The goal here is not to turn you into a wavelet guru, but to impart basic working knowledge (with some theory to act as a springboard to more comprehensive resources).&lt;/p&gt;
&lt;p&gt;Before we go further, I have to emphasize an important fact: while wavelets have found many practical uses in image processing and especially biomedical signal processing, &lt;em&gt;wavelets are not that common in audio&lt;/em&gt;. I’m not aware of any widely adopted and publicly documented audio compression codec that makes use of wavelets. For both audio analysis alone and analysis-resynthesis, the short-time Fourier transform and the phase vocoder are the gold standard. The tradeoffs between time and frequency resolution are generally addressable with multiresolution variants of the STFT.&lt;/p&gt;
&lt;p&gt;There is no one “wavelet transform” but a huge family of methods. &lt;a class="reference external" href="https://scholar.google.com/scholar?hl=en&amp;amp;as_sdt=0,5&amp;amp;q=%22wavelet+transform%22++variant"&gt;New ones are developed all the time&lt;/a&gt;. To limit the scope of this post, I will introduce the two “classical” wavelet transforms: the Continuous Wavelet Transform (CWT) and Multiresolution Analysis (MRA). I’ll also go over popular choices of individual wavelets and summarize their properties. There are other wavelet transforms, some of more musically fertile than CWT or MRA, but you can’t skip the fundamentals before moving on to those. My hope is that demystifying wavelet basics will empower more DSP-savvy artists to learn about these curious creatures.&lt;/p&gt;
&lt;nav class="contents" id="table-of-contents" role="doc-toc"&gt;
&lt;p class="topic-title"&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#top"&gt;Table of Contents&lt;/a&gt;&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#preliminaries" id="toc-entry-1"&gt;Preliminaries&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#crash-course-on-hilbert-spaces" id="toc-entry-2"&gt;Crash course on Hilbert spaces&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#continuous-wavelet-transform" id="toc-entry-3"&gt;Continuous Wavelet Transform&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#mother-wavelet" id="toc-entry-4"&gt;Mother wavelet&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#time-shifting-the-mother-wavelet" id="toc-entry-5"&gt;Time-shifting the mother wavelet&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#scaling-the-mother-wavelet" id="toc-entry-6"&gt;Scaling the mother wavelet&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#definition-of-the-cwt" id="toc-entry-7"&gt;Definition of the CWT&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#inverse-continuous-wavelet-transform" id="toc-entry-8"&gt;Inverse Continuous Wavelet Transform&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#discrete-time-continuous-wavelet-transform" id="toc-entry-9"&gt;Discrete-Time Continuous Wavelet Transform&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#quantizing-frequency" id="toc-entry-10"&gt;Quantizing frequency&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#downsampling-dt-cwt-bands" id="toc-entry-11"&gt;Downsampling DT-CWT bands&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#multiresolution-analysis-fast-wavelet-transform" id="toc-entry-12"&gt;Multiresolution Analysis (Fast Wavelet Transform)&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#analysis-with-mra" id="toc-entry-13"&gt;Analysis with MRA&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#implementation-details" id="toc-entry-14"&gt;Implementation details&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#connecting-mra-to-the-cwt-part-1-the-intuition" id="toc-entry-15"&gt;Connecting MRA to the CWT, part 1: the intuition&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#connecting-mra-to-the-cwt-part-2-the-math" id="toc-entry-16"&gt;Connecting MRA to the CWT, part 2: the math&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#specific-wavelets" id="toc-entry-17"&gt;Specific wavelets&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#morlet-wavelet-gabor-wavelet" id="toc-entry-18"&gt;Morlet wavelet (Gabor wavelet)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#haar-wavelet" id="toc-entry-19"&gt;Haar wavelet&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#shannon-wavelet" id="toc-entry-20"&gt;Shannon wavelet&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#daubechies-wavelets" id="toc-entry-21"&gt;Daubechies wavelets&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#mexican-hat-wavelet-ricker-wavelet" id="toc-entry-22"&gt;Mexican hat wavelet (Ricker wavelet)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#others" id="toc-entry-23"&gt;Others&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#conclusion" id="toc-entry-24"&gt;Conclusion&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#acknowledgements" id="toc-entry-25"&gt;Acknowledgements&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#footnotes" id="toc-entry-26"&gt;Footnotes&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a class="reference internal" href="https://nathan.ho.name/posts/wavelets/#references" id="toc-entry-27"&gt;References&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/nav&gt;
&lt;p&gt;&lt;a href="https://nathan.ho.name/posts/wavelets/"&gt;Read more…&lt;/a&gt; (41 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>dsp</category><category>mathematics</category><guid>https://nathan.ho.name/posts/wavelets/</guid><pubDate>Wed, 30 Aug 2023 07:00:00 GMT</pubDate></item><item><title>Hearing Graphs</title><link>https://nathan.ho.name/posts/hearing-graphs/</link><dc:creator>Nathan Ho</dc:creator><description>&lt;p&gt;My latest project is titled &lt;em&gt;Hearing Graphs&lt;/em&gt;, and you can access it by clicking on the image below.&lt;/p&gt;
&lt;a class="reference external image-reference" href="https://nathan.ho.name/hearing-graphs/"&gt;
&lt;img alt="A screenshot of the project, with an undirected graph to the left and music notation to the right." class="align-center" src="https://nathan.ho.name/images/hearing_graphs.png"&gt;
&lt;/a&gt;
&lt;p&gt;&lt;em&gt;Hearing Graphs&lt;/em&gt; is a sonification of graphs using the &lt;em&gt;graph spectrum&lt;/em&gt; – the eigenvalues of the graph’s adjacency matrix. Both negative and positive eigenvalues are represented by piano samples, and zero eigenvalues are interpreted with a bass drum. The multiplicity of each eigenvalue is represented by hitting notes multiple times.&lt;/p&gt;
&lt;p&gt;Most sonifications establish some audible relationship between the source material and the resulting audio. This one remains mostly incomprehensible, especially to a general audience, so I consider it a failed experiment in that regard. Still, it was fun to make.&lt;/p&gt;</description><category>mathematics</category><category>projects</category><category>sonification</category><guid>https://nathan.ho.name/posts/hearing-graphs/</guid><pubDate>Tue, 21 Sep 2021 00:38:19 GMT</pubDate></item><item><title>Venn 7</title><link>https://nathan.ho.name/posts/venn7/</link><dc:creator>Nathan Ho</dc:creator><description>&lt;p&gt;I have released &lt;a class="reference external" href="https://nathan.ho.name/venn7/"&gt;Venn 7&lt;/a&gt;, a little artistic Web app that turns symmetric 7-fold Venn diagrams into a musical interface. Click the screenshot below to visit the app, which also has an attached explanatory article.&lt;/p&gt;
&lt;a class="reference external image-reference" href="https://nathan.ho.name/venn7/"&gt;
&lt;img alt='A symmetric 7-fold Venn diagram labeled "Victoria" with a pink and purple color scheme.' class="align-center" src="https://nathan.ho.name/images/venn_7_screenshot.png"&gt;
&lt;/a&gt;
&lt;p&gt;There are some bugs and minor issues with it which I hope to hammer out as I receive feedback. Check the &lt;a class="reference external" href="https://github.com/nhthn/venn7/"&gt;repository&lt;/a&gt; for bug reports and some technical documentation.&lt;/p&gt;</description><category>combinatorics</category><category>electronic music</category><category>mathematics</category><category>music theory</category><category>projects</category><category>sonification</category><category>supercollider</category><guid>https://nathan.ho.name/posts/venn7/</guid><pubDate>Thu, 31 Dec 2020 08:00:00 GMT</pubDate></item></channel></rss>