The Math behind Music: Exploring Harmonics Through the Fourier Lens
The goal of this project is to explain Fourier Analysis - the breakdown of complex waves into sinusoidal components - in a digestible way that connects mathematical components to the music we hear on a daily basis. First, the video I made to submit to the Junior Breakthrough Challenge is shown.
Then, I included more information on the sine function, its properties of frequency and amplitude, contribution of harmonics to sound, and sample equations to show a visual representation of what we auditorily process.
All sound waves are, at their core, a basic sine function. The sine function has two main properties that relate to music: frequency and amplitude. Frequency defines pitch, and amplitude defines volume.
When the amplitude, A, is changed, the height of the sine function will change. The larger to amplitude, the greater the volume.
When the frequency, f, is changed, the function to repeats itself quicker. The greater the frequency, the higher the pitch.
Sound waves have layers, commonly known as harmonics.
These layers add tone, fullness, brightness, and resonance, and are what help us decipher one instrument from another. Without harmonics, all music or sound would be very sterile sounding, or electronic. We would not be able to tell a clarinet from a piano or a guitar from a trumpet, because the note would only contain something called the fundamental frequency.
Fundamental frequency is the base frequency at which the entire wave vibrates. It is a constant and depends on the note, and instrument being played. The layers, or harmonics, are all multiples of the fundamental frequency. But, when you hear a note and can identify the pitch, it is the fundamental frequency that sets the pitch you recognize.
Harmonics give each instrument their identifiable sound. Every instrument has different fundamental frequencies for the same notes. For example, a D3 on a piano has a fundamental frequency of 146.83Hz, while a D3 on a violin has a fundamental frequency of 293.66 Hz.
We can identify the top video is a violin, and the video below is a piano because of the harmonics in the sound waves, even though the videos contain the same notes and the same song.
As "n" harmonics are added, the sound wave gradually becomes more complex.
This is a sample equation for any piano note played. It is simplified to 5 harmonics but can go beyond 5 to increase how accurately the equation represents the note.
The harmonics begin at 1, and 1-5 are summed together to form the final wave.
A represents the amplitude, which increases and decreases linearly with volume.
f_n is the frequency, which is the fundamental frequency times n which is the number of the harmonic being represented.
t is time
Phi_n is the phase offset of the nth harmonic. In the case of musical tones and speech, we can set it equal to zero since it is unidentifiable to the human ear.
The following animation represents a C4 note being pressed on a piano.
The fundamental frequency is included in every equation for each harmonic. For the C4 key, the fundamental frequency is 261.63 Hz.
As the harmonics are added, we can see the equation get more complex. With just the first harmonic at the top left, we can see it is a simple sin function that is dependent on the fundamental frequency of the C4 note, as well as the variable amplitude that can be changed. However, when the amplitudes of the other harmonics are >0, as shown in the bottom left, we see the function change shape and have more moving parts that transform the sound of the note.
In the image below, we can see the similarities between the generated Desmos function and the recorded sound waves from playing the C4 key at forte (f), which is at loud volume.
Fourier analysis allows us to look at music from a more intricate and mathematical lens. We get to see how complex sound waves can be deduced into a simpler combination of sine waves called harmonics and explore the deep relationship between sound and trigonometry. We are able to enhance our understanding of the structure behind musical tones and understand how mathematics contributes to our perception of sound.