13 Analyzing sound waves with Fourier series
This chapter covers
- Defining and playing sound waves with Python and PyGame
- Turning mathematical functions called sinusoidal functions into playable musical notes
- Combining two sounds by adding their sound waves as functions
- Decomposing a sound wave function into its Fourier Series to see what musical notes it contains
For a lot of Part 2 we’ve focused on using calculus to simulate moving objects. In this chapter, I’ll show you a completely different application: working with audio data. Digital audio data is a computer representation of sound waves, which are repeating changes of pressure in the air that our ears perceive as sound. We’ll think of sound waves as functions which we can add and scale as vectors, and we can use integrals to understand what kinds of sounds they represent. As a result, our exploration of sound waves will combine a lot of what you’ve learned about both linear algebra and calculus.