# On Fractal Music, Fourier Analysis and Fat Cantor Sets.

Two weeks ago Adam Neely published a mind blowing video where he introduces fractal music. This is a perfect topic for my blog as well, because it is a mixture between science and art, and this is what Bats and Seahorses is mainly after (apart from the related topic of *how *to lead a creative life whether in science or art). Before jumping into mathematcs, first of all, here is the video:

Amazing, huh?

So, as a mathematician I ask: can we actually find a fractal here and how do we find it? In order to do that I will analyse, for the sake of simplicity, whether we can find a fractal A. So instead of a melody, we just concentrate on one single pitch which is the 440 Hz A: what would be a fractal version of A? We will notice that the mathematical analysis will depend on what do our ears actually interpret as sounds.

One thing we notice in this approach is that the pitch is no longer represented as a value of a function in time (high pitches represented by big numbers and low by small), but rather as a frequency of beats. So suppose we have a 440 beat (440 beats in a second). This should sound like A. Let’s assume that each beat takes as long time as the pause between them, so each of the 440 beats is one 880:th of a second long. All is fine. But suppose now that each of these beats in turn consists itself of 440 beats each of which is 880:th beat long. Then there are 440×440=193600 beats in total during this second, each of which has the length a 880×880=774400:th of a second. Each of the beats has the frequency of 440×880=387200 Hz. The question is: does this still sound like a 440 Hz A or like the super high-frequency 387200 Hz sound that humans cannot even hear? I believe that both are correct in the sense that the sound depends on our hearing apparatus. In the same sound we will hear A, while some other creature (some insect?) may be hearing the “fast-track”, i.e. the super high-frequency sound, *and* if we slow down the sound, then *we* will hear it as A in what used to be the high-pitch beats. How do we formalise this mathematically? One way is to use the tools that are normally used to describe sound waves: functional analysis, and especially Fourier analysis. In fact I will use this opportunity to present some of the theory in an understandable way. If we replace 440 by a smaller number, say 4, the first sound wave above will look something like this:

The curve gets values ‘1’ and ‘0’. Value 1 means that the beat is ‘on’ and 0 means that it is ‘off’. This is the simplest way to represent a beat in time. There are four beats in a second now. Now, if we replace each beat with four small beats, the resulting wave will look like this:

Now, intuitively the first wave is somehow represented in the second, but how? Mathematically, we can take the projection of the second wave to the first wave in the same way as we can take the projection of a point in a plane to one of the axes:

In projection one obtains the information “how much of” a certain vector (the one to which we project) is there in the original one in an additive sense. Denote the first wae by and the second by . The magnitude of the projection is the inner product of the two vectors divided by the magnitude of the vector on which we project: . In this case the inner product becomes an integral: which is easily seen to equal 1/4. To see this, note that the integral of functions with values o and 1 is equal to the measure of their support, i.e. the set in which they are equal to 1. So essentially, when we are taking an inner product of such binary functions, we just look at how large is the intersection of the corresponding sets (the sets in which they take value 1), see below how this translates to Cantor sets. The magnitude of is the square root of its inner product with itself: which is equal to 1/2. Its square root is and so the ratio of the inner product to the magnitude equals . Here we see that the component is present in the wave . Suppose we want to find out how much of the higher frequency is there in the wave. To do that we make the same calculation with the following wave instead of :

It turns out that the answer is the same! If we take the projection to any other frequency, we will get half of that, so these other frequences are less present. However, the “appearance-factor” does not become zero. But this is not because we could hear them, but rather the current mathematical model is too simplistic. This is a simple illustration in which the mathematical details aren’t taken care of well enough. To be precise, the functions of this form, i.e. these kind of “dyadic” waves that take values 0 and 1, do not form an orthogonal basis in the Hilbert space of all square integrable functions. Normally, to make mathematics work out, mathematicians use functions that do form an orthonormal basis in this function space, for instance the functions of the form for form an orthonormal basis. If we use functions with values -1 and 1 instead of 0 and 1, then we get a set of orthonormal functions, although its not a basis. So look at the graphs above and just imagine that that the y axes is deformed such that -1 is in place of 0 and 0 is in place of 0.5. Let’s also change notation. Denote the *first and last wave*s by and the second one (the most interesting one) by just . Now it is easy to see that . This can be simplified into so as we can see, both and are additive components of the wave. This time we see it directly without integrating. You may ask: but what if I could represent the same function as a sum of some other basic waves? Don’t we get a contradiction then as to whether this particular wave belongs to the representation or not? In fact, such representations are unique as long as the vectors are linearly independent. This is one of the beauties of Fourier analysis.

These properties will be preserved if iterate the above three times and obtain a three-times-scaleable function:

This wave has 4 beats per second each of which consists of 4 beats each of which consists of 4 beats. If we had 440 instead of 4, it would sound like A, and after slowing down 880 times it would sound like A again and after slowing down by 880 once again, it would sound like…. A. The only difference to the two-iteration is that now thethe magnitude of the projetion to main wave is 1/2 instead of 1 which means that the first A of the three-iteration would be quieter than the first A of the two-iteration. It is natural that it gets quieter, since the measure in which the function obtains a non-zero value is smaller and so the whole sound should be quieter. But is sounds nonetheless!

But this isn’t yet a fractal. A fractal is something whose complexity is unchanged not only after three iterations, but after arbitrarily many. So, can we continue this indefinitely? What happens if we keep iterating this process? To make it easier to visualise, we can simply draw the points with value =1 black and the points with value =0 white, so the above graphs will become:

If you have ever seen the classical Cantor set construction, then this is familiar to you. At the limit, once we take the intersection of infinitely many such iterations, this will indeed become a version of the Cantor set. Will it work? Well, not in the sense we have analysed above. In fact, all the inner products will become zero, and all the sound will vanish. This is because the measure of the set is halved at every iteration, so at the limit it is zero. But fortunately, there is a solution, or at least I believe so. It is based on the assumption, that a 440Hz beat soudns like A not only independently of the pitches of the individual beats (which is confirmed by the above toy-version of Fourier analysis), but also independently on the length of the individual beats. So, does this sound the same as the first one above?

I don’t know. But if it does, then this works. In the iteration process make the gaps progressively smaller. The measure of the resulting Cantor set is the product of the measures of the intermediate sets. So if we remove at each stage, then the measure of the Cantor set will be

To analyse whether it becomes zero, we can see, if its logarithm is not negative infinity:

So for example, if , then the sum is bounded, so can be any solutions to the inequality

which is . These numbers are ** very** rapidly

**small, but on the upside, the measure of the resulting, so called “fat” Cantor set becomes positive. The last question I have is**

*very**How to get music which gives rise to two dimensional fractals? For example like the Sierpinski carpet:*

## Leave a Reply

Want to join the discussion?Feel free to contribute!