Unformatted text preview:

1 Linear Algebra and Music Derrick Smith1 1. Introduction In this project you will see how to use linear algebra to understand music and other types of sound. Specifically, you will see that a given sound can be viewed as elements of a linear space and its coordinates relative to a carefully chosen orthonormal basis will explain many different properties of the sound. After completing this project, you will be able to answer the following questions. • What is a good basis for the space of all sounds? • What are musical notes? • How do notes make up a song? • Why do some notes sound pleasing when played together, while others do not? • Why do pianos and flutes sound different even when playing the same note? 2. Why Sines and Cosines? A basis for a linear space is a fundamental set of building blocks that can be used to make any element in the space. To analyze sound and music, we need to find a set of basic sounds that can be combined to make all other sounds. To do this, we first look at how sounds travel through the air and what your ear does when it receives that sound. All sounds are produced by vibrations which cause variations in air pressure to propagate. If you hold your fingers against your throat when you speak, you can feel your larynx vibrate. When a bow is pulled across a flute string, the string vibrates. You have also probably felt these vibrations at a concert or when standing next to a loud speaker. These variations in air pressure travel from the source of the sound to your ear where they are processed and then sent to your brain. How the ear processes sound is not completely understood, but we do know the basic story. The variations in air pressure cause your eardrums to vibrate which causes some liquid in your inner ear to slosh around. This liquid surrounds a hair-lined membrane and is enclosed in a tapered chamber. Different variations in air pressure cause differently shaped waves to propagate through the liquid. Because the chamber containing the membrane is tapered, some waves travel further than others along the membrane and stimulate different hairs. These hairs are connected to neurons that transmit the information to your brain. A crude model of what’s happening to a point on the membrane is given by the differential equation ykdtyd−=22 where t is time and y is the distance of that point on the 1 Question? Comment? Suggestion? Please send me an email at [email protected] membrane from its equilibrium solution. The solutions to this differential equation give us the basic building blocks to understand all sounds. Problem: 2a. Verify that ()tkcos and ()tksin are solutions to the differential equation ykdtyd−=22. In your Differential Equations course, you will see that every solution to the differential equation above is a linear combination of ()tkcos and()tksin . A proof is also sketched in 4.2 #58 in your text. In the language of linear algebra, they form a basis for the space of solutions to the differential equation. Because the solutions to the differential equation are sine and cosine, you will use sine waves and cosine waves will to analyze sounds and music in the rest of this lab. 3. How the shape of the graph affects what you hear. To start, you will graph and then listen to various sine waves. You will see the differences in their graphs and then hear the differences when you listen to them in MATLAB. First, you are going to use MATLAB to graph and then to play two different sounds. You will listen to two seconds of each of the functions )4402sin( t⋅π and )8802sin( t⋅π. The first function represents a vibration at a rate of 440 cycles per second and the second at 880 cycles per second.2 Here is how to use MATLAB to plot the two graphs in the same window: >> % First we set the domain. Here it is [0,2] with 16000 >> % sample points. >> t = linspace(0,2 ,16000)’; %Note the ‘ at the end >> % >> % Now define the two functions. >> sound1 = sin(2*pi*440*t); %define the first function >> sound2 = sin(2*pi*880*t); %define the second function >> % >> % Plot the two functions. Note we only plot the first >> % 1/100th of a second. >> subplot(2,1,1); plot(t,sound1); axis([0,.01,-1, 1]) >> subplot(2,1,2); plot(t,sound2); axis([0,.01,-1, 1]) 2 The unit cycles per second occurs often enough to warrant its own name: Hertz3 Here is how to use MATLAB to listen to )4402sin( t⋅π: >> soundsc(sound1,8000) %The 8000 is needed to tell the >> %soundsc command the sampling frequency. Here there are >> % 8000samples per second. Problems 3a. Plot )4402sin( t⋅π and )8802sin( t⋅π on the interval [0, .01] on two separate graphs in the same window. What differences do you see between the two graphs? Include the two graphs in your write up. 3b. Listen to two seconds of )4402sin( t⋅π and to two seconds of )8802sin( t⋅π. What is the difference between the two sounds you hear? 3c. Plot )4402sin( t⋅π and )4402sin(25. t⋅π on the interval [0, .01] on two separate graphs in the same window. What differences do you see between the two graphs? Include the two graphs in your write up. 3d. Listen to two seconds of )4402sin( t⋅π and to two seconds of )4402sin(25. t⋅π. What is the difference between the two sounds you hear? Use the command >>sound instead of the command >>soundsc for this problem. 3e. Plot )4402sin( t⋅π + )6602cos( t⋅π and )4402sin( t⋅π + )6602sin( t⋅π on the interval [0, .01]. What differences do you see between the two graphs? Include the two graphs in your write up. 3f. Listen to two seconds of )4402sin( t⋅π + )6602cos( t⋅π and to two seconds of )4402sin( t⋅π + )6602sin( t⋅π. What is the difference (if any) between the two sounds you hear? Your result here will be important later in this lab. Be careful when you answer this. 3g. A more realistic function to model musical notes is )4402sin(5tet⋅−π. (This is the solution to another differential equation that models the ear better than the one above.) Plot )4402sin( t⋅π and )4402sin(5tet⋅−π on the interval [0, .5] on two separate graphs in the same window. What differences do you see between the two graphs? Include the two graphs in your write up. (Hint: >> note1 = exp(-5*t).*sin(2*pi*440*t);)4 3h. Listen to one-half second of )4402sin( t⋅π and to one-half second of )4402sin(5tet⋅−π. What is the difference between the


View Full Document

MIT 18 06 - Linear Algebra and Music

Download Linear Algebra and Music
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Linear Algebra and Music and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Linear Algebra and Music 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?