Circle Machines

I’ve been playing around with “circle machines” as part of my attempt to understand the DFT. A circle machine is a sequence of arms, each of which rotates at some fixed frequency; the last one has a pen fixed to its end:

We can think of these machines as tools for plotting functions in the complex plane, specifically, functions whose signature is:

RC\mathbb{R} \to \mathbb{C}

A single arm with a length of RR making ω\omega revolutions per second plots the function:

f(t)=Rei2πωtf(t) = Re^{i2\pi \omega t}

as shown here:

Connecting two machines corresponds to (pointwise) addition of the functions they plot. As a simple example, connecting a single linkage with a length of 1 and an angular frequency of 1 revolution per second with another having a length of 12\frac{1}{2} and an angular frequency of 2 revolutions per second produces:

m1(t)=ei2πtm2(t)=12ei2π12tm(t)=m1(t)+m2(t)=ei2πt+12ei2π12t\begin{aligned} m_1(t) &= e^{i2\pi t} \\ m_2(t) &= \frac{1}{2}e^{i2\pi \frac{1}{2}t} \\ m(t) &= m_1(t) + m_2(t) \\ &= e^{i2\pi t} + \frac{1}{2}e^{i2\pi \frac{1}{2}t} \end{aligned}

This “composite machine” traces out the familiar cardioid:

Thinking of these machines as complex-function plotters allows us to easily answer a few nagging questions. First: does the order of the arms matter? Not at all, since addition in C\mathbb{C} is commutative:

Second: do the angular frequencies of the arms need to be distinct? What happens if I link together multiple arms having the same angular frequency? Again, there’s no benefit to doing so over just including a single arm at that frequency, thanks to the commutativity and associativity of addition:

These two facts let us simplify our model of circle machines slightly: they’re a sequence of linkages, each of which rotates at a distinct angular frequency.

However, there’s another parameter that we haven’t yet considered. Each linkage currently “starts” at an angular offset of 0. What if we relaxed this, effectively allowing each linkage to specify a phase in addition to its length and frequency?

mR,ω,ϕ(t)=Rei(2πωt+ϕ)m_{R,\omega,\phi}(t) = Re^{i\left(2\pi \omega t + \phi\right)}

For simple machines, this simply rotates the function plotted:

However, it significantly changes more complex machines. The following three “swirly machines” share all of their parameters aside from their linkages’ phases. And yet they produce images with strikingly different symmetries:

Does introducing the phase parameter change the answer to the second question above, which asked whether there’s any benefit to including multiple arms with the same frequency? Specifically, what if the two arms have different phases? It turns out not to make a difference, and this is another easy consequence of the way addition works in C\mathbb{C}. Clearly, the first two linkages with the same angular frequency (but different phases) could be replaced by a single linkage with a length and phase calculated using the law of cosines, for instance:

Alright, so a circle machine plots a function having the form:

tkKRkei(2πωkt+ϕk)t \mapsto \sum_{k \in K} R_k e^{i \left( 2\pi \omega_k t + \phi_k \right)}

Where the ω\omega’s are distinct. This is clearer if we parameterize the sum by the angular frequency:

tωΩRωei(2πωt+ϕω)t \mapsto \sum_{\omega \in \Omega} R_\omega e^{i \left( 2\pi \omega t + \phi_\omega \right)}

What can we say about the set Ω\Omega? In the examples above, it’s always been some finite set of real numbers, like:

ΩCircle={1}ΩCardioid={1,2}\begin{aligned} \Omega_\mathrm{Circle} &= \{ 1 \} \\ \Omega_\mathrm{Cardioid} &= \{ 1, 2 \} \end{aligned}

Can we restrict the elements of Ω\Omega to rational numbers? Integers? Positive integers?

Scaling all of a circle machine’s frequencies by the same factor produces a different machine that nonetheless draws the same picture, only faster:

As a result, if all of the frequencies in a machine are commensurable, we could define a machine that uses only integer frequencies to produce the same picture.

On the other hand, if two frequencies are incommensurable, no such reduction is possible. However, in this case the machine never appears to retrace its steps:

So if we restrict our attention to periodic functions only, it seems like we can limit our attention to integer frequencies.

Does it ever make sense to include a frequency of 0? This just seems to translate the resulting image:

Alright, but what about negative frequencies? These turn out to be important! There are certain pictures that you just can’t draw without including negative frequencies. For example, here’s a straight line:

And an interesting propeller shape:

Neither of which appear to be possible to draw without including linkages with negative frequencies. (I found the concept of a negative frequency a bit strange at first, but it just indicates a rotation in the opposite direction.)

Summary

Well that was fun! Where does it leave us? We can represent many periodic functions from RC\mathbb{R} \to \mathbb{C} as an assemblage of “linkages”:

tωZRωei(2πω+ϕω)t \mapsto \sum_{\omega \in \mathbb{Z}} R_\omega e^{i\left( 2\pi \omega + \phi_\omega \right)}

Such a machine can be represented simply by listing the values of RωR_\omega and ϕω\phi_\omega for each integer ωZ\omega \in \mathbb{Z}. For instance, the circle machine from above has the representation:

ω\omega RωR_\omega ϕω\phi_\omega
00 00 00
11 11 00
1-1 00 00
22 00 00
2-2 00 00

The cardioid:

ω\omega RωR_\omega ϕω\phi_\omega
00 00 00
11 11 00
1-1 00 00
22 12\frac{1}{2} 00
2-2 00 00

The propeller:

ω\omega RωR_\omega ϕω\phi_\omega
00 00 00
11 11 00
1-1 00 00
22 00 00
2-2 11 π2\frac{\pi}{2}

Etc.

These are examples of parameterizations of Fourier Series, which are intimately related to the Fourier Transform of periodic functions, including discrete signals.

I believe several punchlines are: