# That’s a Moiré

Donovan Young interferes in wave patterns I was sitting in the back seat of my parents’ car, stopped at a junction. I could see two cars in front of ours and both had their indicators flashing. The amber lights were out of phase: one turned on just as the other went off, but then, over the course of a few minutes, they teamed up and were flashing in unison. Then, a few minutes later, they returned to being out of phase.

That memory has always stayed with me. I was a young child, and it would be years before I studied physics and learned about wave oscillations and beat frequency—the technical term for the phenomenon I had witnessed. The flashing frequencies of the cars’ indicator lights were slightly different, causing them to slowly drift in and out of phase with one another. The beat frequency is the frequency with which this phase oscillates, and as we’ll see below, it is equal to the difference between the two flashing frequencies.

My second encounter with beat frequency came when I first picked up the guitar as a teenager and learned how to keep it in tune. The method I learned is familiar to any player. By fretting one string so that it plays the note which the next string plays unfretted and playing the two together, the second string can be tuned. When the second string is slightly out of tune, one can hear a ‘wah-wah-wah-wah’—a periodic variation in sound intensity. One then adjusts the tension in the string until the wah-wahs slow down to a standstill; the string is then in tune. I had no idea at the time that this tuning method had anything to do with my childhood memory of flashing indicator lights, but the frequency of the wah-wahs is the beat frequency: the difference between the vibrational frequencies of the two strings.

In order to visualise what’s happening, a basic trigonometric identity is very useful: $\sin (A+B) + \sin(A-B) \equiv 2\sin A \cos B$. We can represent the sound wave from the first fretted string as $\sin\omega_1 t$ and that from the second, open string as $\sin\omega_2 t$, where $\omega_2$ is (hopefully) nearly equal to $\omega_1$. What arrives at your ear is a sum of these two waves, which looks like: and is represented mathematically as \begin{equation*} \sin \omega_1 t + \sin \omega_2 t = 2 \cos \left(\frac{\omega_1 – \omega_2}{2} t\right) \sin \left(\frac{\omega_1 + \omega_2}{2} t\right). \end{equation*} Here we have used the identity with $A=(\omega_1+\omega_2)/2$ and $B=(\omega_1-\omega_2)/2$. The cosine function oscillates at the beat frequency and defines the amplitude of the sine function, which oscillates at the mean frequency.

If you’re looking for a little intuition as to why this happens, think of it this way. Waves can interfere either constructively, when they are in phase and so work to augment each other, or destructively, when they are out of phase, and as one is decreasing as the other is increasing; in this case they cancel each other out. When the frequency of the waves is slightly different, they slowly drift from being in phase, to out of phase, and back again, just like the indicator lights.

## When the shapes hit your eye, but there’s something awry…

My next encounter with beat frequency came later in life, long after having studied at university, where I learned some important facts about the mathematics of periodic functions. I began to notice visual beat frequencies all around me. I was driving along the motorway and noticed an interesting pattern in the gantry supporting the overhead signs.

If you look closely at the black region just below the signs, a remarkable pattern is visible. The most striking feature for me was the symmetry—the light blobs were arranged in a honeycomb pattern. What was going on here?

The black structure is in fact two identical perforated metal sheets, let’s call them screens, one on each side of the scaffolding which runs across the bottom of the signs. The perforations are much too small to see at a distance, but they are small circular holes arranged—you guessed it—in a honeycomb pattern. What we are seeing is an interference effect between the perforation pattern of the front and back screens.

The back screen is further away from the observer, and so appears slightly smaller. The spatial frequency of the holes is therefore slightly increased compared to the front screen. The two patterns then beat against each other. The light blobs repeat with the beat frequency—the difference of the apparent spatial frequencies of the tiny invisible holes in the two screens. This is an example of what is called a Moiré pattern—an interference pattern formed by two sets of superimposed lines. A simple mock-up demonstrating the same effect is relatively easy to do yourself: Take two rulers with identical measurement scales, and place one a few centimetres above the other. The visual beat frequency phenomena is visible created by the distance tick marks. In the picture, the millimetre and 16th of an inch scales produce patters with different periods—approximately $2$ cm and $1\frac{1}{4}$ in respectively as measured on the upper ruler.

## When the screens perforate, and you then integrate…

We can model the pattern of perforations on the screen by a periodic transmission function $T(x,y)$. This function takes values between $0$ and $1$, representing the amount of light which the screen lets through at coordinates $(x,y)$. So, for example, at a location $(x_0,y_0)$ where there is a perforation in the screen we would have $T(x_0,y_0)=1$, whereas at another location $(x_1,y_1)$ where the screen has no perforation, $T(x_1,y_1) = 0$.

When one copy of the screen is placed behind the other, the transmission function of the back screen is relatively compressed due to the effect of perspective. We will take the $x$–$y$ coordinate system to refer to the image coordinates of the front screen and take the front screen’s transmission function to be $T(x,y)$. The apparent transmission function of the back screen is then $T(sx,sy)$, ie a compressed version of the same transmission function with a compression factor $s=1+\varepsilon$, where $\varepsilon$ is very small, applied to the coordinates.

The product of the two transmission functions gives the overall transmission function of the screens taken together. Since the eye cannot resolve the perforations in the screens, what is perceived is a shade of grey—an average transmission taken over the smallest resolvable scale. We will take this scale to be $\ell$, and also assume that $\ell$ is significantly larger than the spacing between the perforations. Let $I(x,y)$ be the resulting brightness that we perceive at the point $(x,y)$. We then have \begin{equation}\nonumber \begin{split} I(x,y) &=\frac{1}{\ell^2}\int_{x-\ell/2}^{x+\ell/2} \int_{y-\ell/2}^{y+\ell/2} T(X,Y) T(sX,sY) \mathrm{d} Y \mathrm{d} X\\ &=\frac{1}{\ell^2}\int_{x-\ell/2}^{x+\ell/2} \int_{y-\ell/2}^{y+\ell/2} T(X,Y) T(X+\varepsilon X, Y+\varepsilon Y) \mathrm{d} Y \mathrm{d} X. \end{split} \end{equation} Now, since $\varepsilon$ is very small, and $\ell$ is also small in comparison to the scale of the Moiré pattern, we can make the approximations $X + \varepsilon X \approx X + \varepsilon x$ and $Y + \varepsilon Y \approx Y + \varepsilon y$. This brings us to  \begin{equation}\nonumber I(x,y) \approx\frac{1}{\ell^2}\int_{x-\ell/2}^{x+\ell/2} \int_{y-\ell/2}^{y+\ell/2} T(X,Y) T(X+\varepsilon x,Y+\varepsilon y) \mathrm{d} Y \mathrm{d} X. \end{equation} We can now use the periodicity of the transmission function to shift the integration domain to be centred around the origin, \begin{equation}\nonumber I(x,y) \approx\frac{1}{\ell^2}\int_{-\ell/2}^{\ell/2} \int_{-\ell/2}^{\ell/2} T(X,Y) T(X+\varepsilon x,Y+\varepsilon y) \mathrm{d} Y \mathrm{d} X. \tag{1} \label{moire:eq1} \end{equation} The is called the autocorrelation of $T(x,y)$. An autocorrelation is an integral of a function against a shifted version of itself, as a function of that shift, and has applications in other areas of mathematics including signal processing, Fourier analysis and statistics. Notice that the autocorrelation in \eqref{moire:eq1} is magnified, as both $x$ and $y$ appear dressed with a factor of $\varepsilon$, ie they have been stretched using a scale factor of $1/\varepsilon$.

The image below shows an example using a square mesh pattern: A perforated screen whose transmission function takes the value 1 in the white regions and 0 in the black regions is shown on the left. The autocorrelation of the transmission function is shown on the right; this is the resulting macroscopic pattern when two such microscopic screens are superposed. Again, the intuition follows from the flashing indicator signals, or the guitar strings. Along certain lines of sight, the perforations of the front and back screens are aligned, allowing the light to pass through both to your eye, and producing a bright spot. Along others, you see through the front screen’s perforations only to be blocked by the back screen’s material; the result is a darker spot.

## From the big things to small, you’ll see this in them all…

The most impressive aspect of these visual beat frequencies is that they act as a kind of microscope: the pattern of the underlying mesh, too small to see, is magnified and revealed due to interference. When one of the screens moves a little (or the observer moves their head a little), the effect is even more pronounced. A small translation of one of the screens by an amount equal to the spacing between the perforations results in a light blob turning into a dark blob—a change which really grabs one’s attention and is easy to spot.

It’s very similar to the way interference is used in very large baseline interferometry, a technique in radio astronomy. Signals from many widely separated receiving dishes are combined to form a powerful radio telescope, one with the resolving power of a single dish whose diameter is equal to the largest separation between the individual dishes. In 2019 this technique was used to form the first image of a black hole.

When I see these visual beat frequencies, I’m reminded that maths is not only about the big stuff—abstract ideas, abstruse proofs of theorems, cutting-edge science and technology, etc. These things are awe inspiring, but also sometimes intimidating for people when they start learning the subject. Maths is also in the little things, the patterns that are all around us. Mathematics is a beautiful lens to view the world through and can be a profound way to commune with nature. Keep your eyes open: mathematics is hiding in plain sight. Donovan is a maths teacher who is transfixed by the science and mathematics of light and vision.