Fractal dimension analysis of musical instrument sound samples

Fractals in the sound of music

Many irregular objects and patterns found in nature are fractals. In undergraduate classrooms, teachers typically introduce fractals using examples such as mountains, trees, or abstract mathematical shapes like the Koch curve. But measuring the fractal dimension of natural objects like coastlines or mountain ranges in a laboratory setting poses practical difficulties due to their size. As a result, educators often resort to mathematical models for demonstration.

Limited experimental resources also hinder the adoption of engaging topics like fractals. Previous researchers have reported various lab-based approaches: measuring fractal dimension from calcium carbonate crystal growth, from cauliflower, or from resistor networks. Studies show that working with fractals fosters interdisciplinary thinking and keeps learners actively involved. When pre-service teachers worked on projects to calculate fractal dimension from natural objects, most showed interest but struggled — their concept of dimension, based on classical Euclidean geometry, made it hard for them to accept non-integer values or identify scaling factors.

Students at different grade levels also experience confusion: they often believe only regular patterns can form fractals, have trouble distinguishing ordinary patterns from fractal ones, and can identify images of fractals yet fail to draw them because they lack the understanding that infinite self-similarity is a key property. Starting courses with seminars on fractals helps undergraduates appreciate the advancement of science and gives them firsthand experience.

Many learners assume that only physical objects can have fractal structure. In reality, many time-varying phenomena display fractal character as well. Sound serves as an excellent example. Audio samples from musical instruments are readily available and can be used to teach fractal concepts in the classroom.

When someone sings or plays an instrument, the resulting musical sound is not static; it changes constantly. In scientific terms, music is a dynamical system — one where past states influence both present and future states through some mathematical function. The evolution of such a system over time deviates from the predicted path derived from equations. This means music consists of interrelated events progressing with a degree of uncertainty, and such deviations are unavoidable. These natural variations are called fluctuations, or noise, and they appear in speech and music as changes in loudness and pitch. In 1990, Hsu and Hsu found that compositions by Mozart and Bach exhibit fractal geometry. In other words, the structure remains the same at different scales — a property that identifies the music as a fractal.

What are fractals?

In 1975, Benoit Mandelbrot introduced a new type of geometry found in natural objects and called it fractals. Fractals appear irregular and seemingly random, yet they demonstrate self-similarity when viewed at different magnifications. Even before Mandelbrot, mathematicians had conceived of mathematical fractal structures: the Cantor set by Georg Cantor, the Koch curve by Helge von Koch, and the Sierpinski triangle by Waclaw Sierpinski.

A zebra displays similar patterns on its body parts, especially its neck and legs; clouds seen from a seashore show highly irregular structure that maintains self-similarity when enlarged. In both cases, close examination reveals repetition of a basic structure. This self-similarity indicates that the irregular shape of many natural objects holds at different levels of magnification. Crucially, for something to be a fractal, the object must repeat the whole pattern in increasingly magnified views. This self-similarity is statistical, meaning some deviation occurs at different scales. Fractals in nature often have varying repeated patterns along different axes, a property called self-affinity.

background image

Understanding fractal dimension

A line has dimension one, a square has dimension two, and a cube has dimension three. But how is dimension actually determined? Consider three squares — A, B, and C — placed on grids. Square A has sides of length 1 unit, B has sides of length 2 units, and C has sides of length 4 units. It takes 16 pieces the size of A to fill C. We can express this as 16 = 4², where 4 is the scaling factor (how many times longer C's side is compared to A's). It takes 4 pieces the size of B to fill C, which can be written 4 = 2². The exponent, 2, represents the dimension of a square.

background image

Generalizing, we get n = k^D, where n is the number of pieces needed to fill the object, k is the scaling factor, and D is the dimension. Taking logarithms gives D = log n / log k, or specifically the limit as k approaches infinity of log n / log k. This relationship can be used to find the dimension of a fractal such as the Sierpinski triangle. After the first step of transforming an equilateral triangle into a Sierpinski gasket, three identical equilateral triangles are needed to fill the shape, and enlarging the side length by a factor of two reproduces the original large triangle. This gives D = log 3 / log 2, approximately 1.585 — a non-integer value. For fractals, the dimension is never a whole number; this fractional dimension is called the fractal dimension.

Fractals and chaos

Most natural systems are dynamical and exhibit chaotic behavior — tiny differences in initial conditions can strongly affect how the system evolves over time. Weather and natural disaster predictions often fail because of minor errors in initial parameters. It was Lorenz who recognized this chaotic nature of dynamical systems through his "butterfly effect" concept. Fractals are visual representations of chaotic behavior and, like chaos, show identical geometry when examined at different scales.

Measuring fractal dimension in practice

The box-counting method is the standard approach for calculating fractal dimension. In two-dimensional space, a set of points forms a surface. To find the surface’s fractal dimension, square boxes with sides of a given length k are placed over it, and n is the number of boxes needed to cover the entire surface. Larger and smaller box sizes are used, giving the power-law relation n = q k^(-D), where q is a constant. Taking the logarithm of both sides gives log n = log q - D log k. The box-counting dimension exists as the limit as k approaches 0 of log n / log (1/k). This yields D as the slope of the line in a log-log graph of n versus k. Figure 5 shows square grids placed on an irregular shape; by counting how many boxes are required at different sizes, the fractal dimension is found.

background image

Fractals and musical instruments

Audible sound proves an excellent source for studying fractals in the lab. Students can easily obtain audio samples and compute fractal dimensions fairly quickly using computational tools. Hsu and Hsu noted self-similarity in compositions by Bach and Mozart, and many other authors have since examined fractal characteristics in both music and musical instruments. Research has shown that classical songs have higher fractal dimensions compared with semi-classical or light songs, and similar studies on musical instruments reveal their harmonic nature. Music across different styles and noises yields fractal dimensions around 1.65, with values ranging between roughly 1.6 and 1.69.

background image

A musical performance includes many components — lyrics, the performer, scale, accompanying instruments — all of which affect the final output. However, the fractal dimension of sound produced by individual instruments differs from that of full compositions. In this study, we analyze different sound samples from musical instruments as well as environmental noises. Prior approaches to teaching fractal dimension measurement, while well-intentioned, often require significant time, material, or instructor supervision. Our method, by contrast, is straightforward, quick to conduct, and relies on easily obtainable resources.

Methods

Sound samples of various musical instruments and common environmental noises were collected. Each sample used in this study had a duration of one second — shorter, finer samples provide more consistent results. The frequency spectrum was plotted using the MIR toolbox in Matlab with the command "mirspectrum(filename, 'db')". The resulting spectrum image was saved, converted to black-and-white bitmap format via photo editing software, and then analyzed using the free software Fractalyse. After opening the file and selecting the "Box" analysis option, a log-log plot appeared showing both the data (in blue) and the expected exact line (in red). The fractal dimension value was displayed on the plot alongside the curve.

Results and discussion

The fractal dimensions obtained for various sound samples are summarized in the table below. The selected sounds include string instruments, common noises, and pure tones. The string instrument sounds all yielded well-defined fractal dimensions. Among them, the Sarangi gave the lowest value, while the Tampura and Dilruba gave the highest. Values ranged from 1.658 to 1.708, with a mean of 1.6882. In a simple box-counting method, a characteristic fractal dimension falls between 1 and 2, indicating a nature somewhere between a line (1) and a square (2). Values near 1 suggest an ordered structure, while those near 2 indicate disorder or randomness. The measured values show that music is a system with both order and randomness, with the latter slightly dominant.

  • Electric drill: 1.806
  • 1 kHz sine tone: 1.820
  • Heavy rain: 1.824
  • 250 Hz sine tone: 1.825
  • Printer fan: 1.829
  • Sarangi: 1.658
  • Flute: 1.674
  • Sitar: 1.680
  • Violin: 1.687
  • Veena: 1.703
  • Tampura: 1.708
  • Dilruba: 1.708

Closing thoughts

The world around us is filled with shapes that lack regularity yet reveal identical structures when magnified to different degrees. Nature creates these beautiful symmetries, which we now recognize as fractals following Mandelbrot's discovery. Music possesses a built-in symmetry of its own, and studying fractal dimension helps uncover it. Using the approach described here, students can collect sounds from various instruments, compare their fractal dimensions, and explore patterns in acoustic phenomena. Our measurements show that fractal dimension for musical instruments lies between 1.658 and 1.708. By using freely available resources and straightforward computational tools, fractal dimensions of diverse musical sounds can be determined quickly in any teaching laboratory — a simple method that may inspire further student investigation into the world of fractals.

The iterative processes that generate fractals also appear in music performance. Composers such as Johann Sebastian Bach wrote pieces whose pitch structures mirror self-similar patterns, a property studied in works by Hsu and Hsu (1990, 1991). Ornes (2014) described fractal hunting in Bach's musical scores, noting scale-invariant motifs. Meyer (1993) measured the fractal dimension of compositions to quantify their complexity. Voss and Clarke (1975) discovered that audio signals in music and speech exhibit 1/f noise, a statistical signature of fractality. Because music is both metric and tonal, its analysis using box-counting dimension can reveal general features of musical genres and instrumentation (Das & Das, 2005, 2006). A MatLab toolbox for music information retrieval (Lartillot et al., 2008) facilitates fractal computation on audio files. The resolution parameter chosen during dispersion analysis determines the sampling interval within a piece.

Karakus and colleagues (2010, 2013, 2014, 2015, 2016) showed that fractals offer a rich context for mathematics and science education. Students generated fractal shapes iteratively by scaling unit segments. Karakus noted that misconceptions often stem from viewing fractals as purely disordered objects, whereas their scaling rule produces long-range order. Karakus and Karatas (2014) linked this misconception to the dual nature of irregular yet structured patterns. Similar interdisciplinary classroom modules exist for subjects as diverse as tree s and canopies (Nishanth et al., 2020), chaotic pendulum dynamics (De Jong, 1992), and electrodeposited fractal patterns (García & Liu, 1995). Teachers may adopt simple printing projects from Cantor-type constructions (Knutson & Dahlberg, 2003; Peitgen et al., 1992) or measurement exercise s employing leaf scans (Hartvigsen, 2000) to lower the entry barrier. More technical seminars (Hughes, 2003) introduce undergraduates to dimension formulas without advanced mathematical preliminaries.

Shore et al. (1992) described using authentic 'doing science' strategies in university courses to deepen procedural reasoning. Software such as Fractalyse (Vuidel, n.d.) empowers students to compute box-counting fractal dimensions following set standard protocols (Wu et al., 2020). For high school classes, compact combinatorial exercises exist in comprehensible, single-day or week-long lesson plans (Zembrowska & Kuźma, 2002; Souza et al., 2019). Analog lessons for crystal formation illuminate how small iterated processes lead to glass-branching morphologies.