# 2.5: Fourier Analysis and Synthesis

$$\newcommand{\vecs}{\overset { \rightharpoonup} {\mathbf{#1}} }$$ $$\newcommand{\vecd}{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$$$\newcommand{\AA}{\unicode[.8,0]{x212B}}$$

## 2.5: Fourier Series with Sound

As we saw in the previous simulation, waves may have very complicated shapes which don't resemble a sine wave. However the French mathematician Jean Baptiste Joseph Fourier showed that any periodic function can be formed from an infinite sum of sines and cosines. This is very convenient because it means that everything we know about sines and cosines applies to a periodic function of any shape. Although the sum is infinite in theory in many cases using just a few terms may be close enough to provide a good approximation.

Fourier analysis is the process of mathematically breaking down a complex wave into a sum of of sines and cosines. Fourier synthesis is the process of building a particular wave shape by adding sines and cosines. Fourier analysis and synthesis can be done for any type of wave, not just the sound waves shown in this simulation.

This simulation shows the sum of up to $$8$$ harmonics of a sine wave with fundamental frequency $$f_{1}$$. The Run buttons shows a slow motion animation of the resulting wave where time $$t$$ is in milliseconds and distance $$x$$ is in meters. A harmonic is a sine wave that has a frequency which is a whole number multiple of the frequency of the original sine wave. The first harmonic (set with the slider $$\text{A1}$$) is called the fundamental. So if the fundamental is $$f_{1}=200\text{ Hz}$$ the second harmonic is $$f_{2}=400\text{ Hz}$$, the third harmonic is $$f_{3}=600\text{ Hz}$$, etc. We know $$v=\lambda f$$ so for a fixed speed, doubling the frequency means the wavelength of the second harmonic is half that of the fundamental. Conversely, holding your finger down in the middle of a guitar string and plucking one side cuts the wavelength in half which doubles the frequency being played. For standing waves on a string fixed at each end (such as a guitar string) each harmonic is also called a normal mode of vibration.

## Fourier Series with Sound

Note

The Fourier Series and Sound JavaScript Model uses the HTML 5 Web Audio API. This API is still under development and may not be supported on all platforms. Press the Reset button to reinitialize the simulation if the sound does not play when the simulations is first loaded.

### Questions:

Exercise $$\PageIndex{1}$$

Try adjusting the slider $$\text{A1}$$ to different values. What does this slider do?

Exercise $$\PageIndex{2}$$

You may have noticed the amplitude shows up in the graph on the right. You can also see the magnitude of the amplitude by holding the mouse the mouse button down and moving the mouse to the top of one of the peaks on the graph on the left. Does it match the value of $$\text{A1}$$ set by the slider? Use the mouse to find the wavelength (distance between peaks on the left graph), what is the wavelength of this wave?

Exercise $$\PageIndex{3}$$

Use the 'reset' button and move slider $$\text{A2}$$ (the second harmonic). What is the wavelength of the second harmonic? How does this wavelength compare to the wavelength of the fundamental? This is a $$400\text{ Hz}$$ sine wave.

Exercise $$\PageIndex{4}$$

The pitch of a sound wave is determined by the fundamental frequency. Turn on the velocity ($$344\text{ m/s}$$ for sound at room temperature). With only amplitude $$\text{A1}$$ showing, run the simulation. Find the period by measuring the time (in $$10^{-3}\text{ sec}$$) between when one peak passes the origin and when the next peak passes (use the step button to get an accurate time measurement). What is the frequency of the fundamental?

Exercise $$\PageIndex{5}$$

Now find the period of a wave with several harmonics. What is the period of the combination (the time between successive highest peaks)? Although the wave looks more complicated it has the same fundamental frequency and therefor the same pitch. The additional, smaller peaks are due to the harmonics and give a sound its timbre. A trumpet and trombone playing the same note have the same fundamental frequency but sound different because of the number and amount of harmonics present.

The graph on the right is called a Fourier spectrum and is a short hand way of showing how much of each harmonic is present in the graph on the left. Fourier series usually include sine and cosine functions and can represent periodic functions in time or space or both. In this simulation we only have combinations of sine waves. The Fourier series for the wave function showing in the left graph is given by $$y(t)=\sum_{n=1}A_{n}\sin (n2\pi x/\lambda -n2\pi ft)$$. Here $$t$$ is time, $$n$$ is the number of the harmonic or mode ($$n=1$$ for the fundamental, $$2$$ for the second harmonic etc.), $$A_{n}$$ is the amplitude of harmonic or mode number $$n$$ and $$f$$ is the fundamental frequency ($$f=1/T$$).

Exercise $$\PageIndex{6}$$

To get the exact shape of an arbitrary periodic function we would need an infinite number of terms in the Fourier series but in this simulation we can only add a maximum of $$10$$ terms. Try the following combination of harmonics (you can type the amplitudes into the boxes next the sliders to get exact values): $$\text{A1} = 1.0,\: \text{A2} = 0,\: \text{A3} = 0.333 (= 1/3),$$ $$\text{A4} = 0,$$ $$\text{A5} = 0.20 (= 1/5),$$ $$\text{A6} = 0,$$ $$\text{A7} = 0.143 (= 1/7),$$ $$\text{A8} = 0$$. What is the approximate shape of this wave?

Exercise $$\PageIndex{7}$$

Reset the simulation and try the following combination of harmonics (you can type the amplitudes into the boxes next the sliders to get exact values): $$\text{A1} = 1.0$$, $$\text{A2} = -0.5$$, $$\text{A3} = 0.333$$, $$\text{A4} = -0.25$$, $$\text{A5} = 0.20$$, $$\text{A6} = -0.166$$, $$\text{A7} = 0.143$$, $$\text{A8} = -0.083$$. What is the approximate shape of this wave?

If you could hear the notes represented by the waves in exercise $$\PageIndex{6}$$ and $$\PageIndex{7}$$, what would be the same for both? What would be different? What is the difference in sound between the two?

Exercise $$\PageIndex{8}$$

Suppose a clarinet and a trumpet both play the same note (have the same fundamental frequency). Why is it that you can still tell them apart, even though they are playing the same note?

Exercise $$\PageIndex{9}$$

Find a definition of timbre and write it in your own words. Based on your answers to the above questions, what causes timbre?

Exercise $$\PageIndex{10}$$

Suppose you wanted to build an electronic instrument which added waves together to imitate other instruments (this is how some musical synthesizers works). What would you need to know about the sound a trumpet makes in order to reconstruct that sound? (Hint: think about the information contained in the graph on the right.)

This page titled 2.5: Fourier Analysis and Synthesis is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Kyle Forinash and Wolfgang Christian via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.