Abstract
Mathematics is a far reaching discipline and its tools appear in many applications. In this paper we discuss its role in music and signal processing by revisiting the use of mathematics in algorithms that can extract chord information from recorded music. We begin with a light introduction to the theory of music and motivate the use of Fourier analysis in audio processing. We introduce the discrete and continuous Fourier transforms and investigate their use in extracting important information from audio data.
Introduction
The intersection of music theory and digital signal processing provides a pedagogical bridge between aesthetic structures and rigorous mathematical analysis. Identifying the harmonic structure, or chords, of a musical piece is a task typically reserved for trained musicians. For researchers performing statistical analysis on massive music databases, manual annotation is a significant bottleneck. The primary challenge lies in the data format: raw audio is a time-domain signal representing amplitude over time, whereas a "chord" is a frequency-domain concept.
Mathematical Framework for Chord Detection
The authors, Nathan Lenssen and Deanna Needell, propose a multi-step pipeline to transform high-dimensional audio signals into a simplified 12-bin representation suitable for machine learning models.
Musical Modeling and Fourier Analysis
The process begins by defining the chromatic scale using a recursive sequence ($P_i = 2^{1/12} P_{i-1}$), reflecting the logarithmic spacing of frequencies in Western music. To analyze these frequencies, the Discrete Fourier Transform (DFT) is derived from the continuous Fourier integral. By applying this to sampled digital audio, we can move from the time domain to the frequency domain, identifying the constituent frequencies of a signal.
Computational Efficiency and Feature Extraction
To handle real-world audio data efficiently, the Fast Fourier Transform (FFT) is employed, reducing computational complexity from $O(n^2)$ to $O(n \log n)$. For a standard 3-minute song, this optimization makes the process approximately 100,000 times faster. The Short-Time Fourier Transform (STFT) is then used to analyze overlapping audio segments, producing a spectrogram that captures frequency changes over time.
Chroma Mapping and Octave Invariance
A key innovation in this pipeline is the creation of a Chromagram. Because a chord's identity (e.g., C-major) remains the same regardless of the octave in which it is played, the frequency spectrum is collapsed into 12 "chroma bins." This involves summing the intensities of a specific note across all octaves into a single vector. This dimensionality reduction preserves semantic meaning while discarding irrelevant octave information. The chromagram also handles the "wrap-around" from B back to C, mirroring human pitch perception.
Insights and Limitations
The study highlights the fundamental trade-off in signal processing known as the reciprocity relation ($\Delta t \Delta \nu = 1/N$), where longer time windows yield finer frequency resolution. While the framework is robust for Western 12-tone equal temperament systems, it faces limitations in microtonal music. Furthermore, the complexity of timbre—the unique overtone profile of different instruments—can interfere with chroma intensities. Future work involves refining the "chord fitting" stage, often utilizing Hidden Markov Models (HMMs) to statistically determine the most likely chord sequence from the generated chromagram.
Summary updated