5bl lab 6: sound · 2020. 8. 21. · play the unknown sound from the 5bl lab 6 website . for...

11
5BL Lab 6: Sound 1. Introduction How can you distinguish two different musical instruments that play the same note? How can you recognize somebody’s voice? Or how can apps like Shazam identify a random song? And what determines the pitch of an instrument anyway? In this lab, you will generate and analyze sound waves, investigate the timbre of instruments, and measure the speed of sound in air. Please see chapters 15.3, 15.5,16.2, 16.3, and 16.4 in the Knight textbook. Required equipment: Two devices with phyphox, tape-measure, straw, or musical instrument, or a wine glass. 2. Experiment Measurement 1: what is the highest and lowest pitch you can hear? This experiment works best with headphones. Start an online tone-generator from your web-browser (e.g. https://www.szynalski.com/tone-generator/): Figure 1. Online tone generator. When you press the PLAY button you will hear a sound of pitch f=440 Hz. If you are musically inclined you may recognize this sound as an A4. Using the slider, change the pitch first to lower and then to higher frequencies. For deliverable 1 , record the highest and lowest pitch you can hear in Hz. What happens to the perceived loudness of the sound as you change frequency? You should develop a good feel for the frequency of various pitches. We will ask you later and in next week’s lab to identify the pitch of an unknown sound. 1

Upload: others

Post on 13-Oct-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 5BL Lab 6: Sound · 2020. 8. 21. · Play the unknown sound from the 5BL lab 6 website . For deliverable 4 use the ‘ pick data ’ tool to measure the time of two subsequent crests

5BL Lab 6: Sound

1. Introduction How can you distinguish two different musical instruments that play the same note? How can you recognize somebody’s voice? Or how can apps like Shazam identify a random song? And what determines the pitch of an instrument anyway? In this lab, you will generate and analyze sound waves, investigate the timbre of instruments, and measure the speed of sound in air. Please see chapters 15.3, 15.5,16.2, 16.3, and 16.4 in the Knight textbook. Required equipment: Two devices with phyphox, tape-measure, straw, or musical instrument, or a wine glass.

2. Experiment

Measurement 1: what is the highest and lowest pitch you can hear? This experiment works best with headphones. Start an online tone-generator from your web-browser (e.g. https://www.szynalski.com/tone-generator/ ):

Figure 1. Online tone generator.

When you press the PLAY button you will hear a sound of pitch f=440 Hz. If you are musically inclined you may recognize this sound as an A4. Using the slider, change the pitch first to lower and then to higher frequencies. For deliverable 1 , record the highest and lowest pitch you can hear in Hz. What happens to the perceived loudness of the sound as you change frequency? You should develop a good feel for the frequency of various pitches. We will ask you later and in next week’s lab to identify the pitch of an unknown sound.

1

Page 2: 5BL Lab 6: Sound · 2020. 8. 21. · Play the unknown sound from the 5BL lab 6 website . For deliverable 4 use the ‘ pick data ’ tool to measure the time of two subsequent crests

Measurement 2: period and amplitude of sound In this experiment you will play a sound from your computer speakers and analyze it using phyphox on your phone. Select the ‘ Audio Scope ’ in phyphox and start the readout. The scope now displays the instantaneous pressure amplitude vs time, as measured by the phone’s microphone. For deliverable 2 play the low pitch sound from the lab 6 website and take a screen-shot of your scope. As you can see (figure 2a), the pressure changes sinusoidally with time. Next, play the high pitch sound and take another screen-shot. Keep the displayed range on both the horizontal and vertical axis the same (using ‘ pan and zoom ’) so that you can directly compare both recordings. Can you identify any qualitative differences? In our example, we compared 350 Hz (figure 2a) and 800 Hz (2b). The high pitch tone has more oscillations per unit time and a smaller period T .

Figure 2. Direct comparison of a low pitch (a) and high pitch (b) tone as displaced in the phyphox audio-scope. A higher pitch tone has a higher frequency and shorter period T. Next, place your phone on the table next to your computer and keep it at a constant distance. For deliverable 3, play the high pitch sound again and take a screen-shot of your audio-scope trace. Then, reduce the volume of your speakers and take another screen-shot. Keep the range on both the horizontal and vertical axis the same . Can you identify any qualitative difference between the two traces? As you can see in figure 3, the amplitude decreases while the frequency and period stay the same.

Figure 3. Direct comparison of a loud tone (a) and a more quiet tone (b) at the same pitch. The loudness of a tone determines the amplitude of the sinusoidal oscillation.

2

Page 3: 5BL Lab 6: Sound · 2020. 8. 21. · Play the unknown sound from the 5BL lab 6 website . For deliverable 4 use the ‘ pick data ’ tool to measure the time of two subsequent crests

Measurement 3: how to determine the frequency of an unknown tone? In this activity you will use the ‘ Audio Scope ’ in phyphox to quantitatively measure the frequency of an unknown tone. Play the unknown sound from the 5BL lab 6 website . For deliverable 4 use the ‘ pick data ’ tool to measure the time of two subsequent crests or troughs and calculate the difference T (figure 4). In our case the difference was T = 3.04 ms - 1.31 ms = 1.73 ms (1 ms = 0.001 s) for a frequency of f=1/T = 578 Hz.

Figure 4. Using the audio-scope to quantitatively measure the period.

Measurement 4: spectrum analyzer A faster and more elegant method to determine the frequency of a tone is to use a spectrum analyzer. A spectrum analyzer calculates the Fourier-transform of the pressure amplitude versus time graph to display the magnitude as a function of frequency. Play the unknown tone from the 5BL lab 6 website again. Start the ‘ Audio Spectrum ’ tool in phyphox. First you need to change the number of samples in ‘Settings’ to 32768. This will maximize the spectral resolution to 10,000/32768 Hz = 0.3 Hz at the expense of sampling speed. In case you are wondering, the 32768 corresponds to 15 bits (2 15 = 32768). When you play your mystery sound again, the ‘Spectrum’ will show a distinct peak corresponding to the pitch of your tone. Use the ‘pick data’ tool to measure the frequency of your peak. In our spectrum (figure 5) the peak occurs at a frequency of 578 Hz, consistent with our audio-scope trace (figure 4). Since the trace is a pure sine-wave of frequency 578 Hz, the Fourier-spectrum only shows one distinct peak at that frequency. Spectrum analyzers typically display spectra on logarithmic scales for both the horizontal and vertical axis (figure 5a). With each tick-mark the frequency or

3

Page 4: 5BL Lab 6: Sound · 2020. 8. 21. · Play the unknown sound from the 5BL lab 6 website . For deliverable 4 use the ‘ pick data ’ tool to measure the time of two subsequent crests

magnitude increases by a factor of 10. This increased dynamic range allows you to see the lower magnitude contributions to the spectrum caused by background noise, or electronic noise in the microphone. As you can see, the noise level is at least a factor of 1000 below the magnitude of the peak. Use the ‘ More tools ’ tab to switch both the x- and y-axis to a linear scale and use the ‘ pan and zoom ’ tool as needed to find your peak (figure 5b). You can now more clearly see that the spectrum is dominated by one single frequency. For deliverable 5 take screen-shots of the Fourier spectrum of your mystery sound in both a log and a linear scale and measure the frequency of your peak. You should understand that the audio-scope and the spectrum analyzer display the very same information but in different domains: the audio-scope displays the time domain while the spectrum analyzer displays the frequency domain.

Figure 5. Fourier-spectrum of the audio-trace from figure 4. The same spectrum is displaced both in a double-logarithmic scale (a) and a linear scale (b).

Measurement 5: timbre of a musical instrument In this experiment you will investigate how the Fourier spectrum of a musical instrument differs from that of a simple sine-wave tone. Use any musical instrument you may have, or a straw , a bottle , a wine glass , a whistle, a toy that produces a distinct sound, or your voice. You may also use Garageband on MacOS or LMMS on Windows to produce synthetic instrument sounds on your computer.

4

Page 5: 5BL Lab 6: Sound · 2020. 8. 21. · Play the unknown sound from the 5BL lab 6 website . For deliverable 4 use the ‘ pick data ’ tool to measure the time of two subsequent crests

Figure 6 shows the spectra of various instruments. In contrast to a simple sine-wave sound (figure 5b), the spectra on the left side consist of several distinct and evenly spaced peaks. For example, figure 6a shows the spectrum of an acoustic guitar playing a C5 at 523 Hz. The peak at 523 Hz is clearly visible in the spectrum. However, the spectrum also shows peaks at 1046 Hz, 1569 Hz, 2092 Hz, etc. In fact, there are many more peaks that are just outside of our displayed frequency range of 3 kHz. The audioscope trace of that very same sound (figure 6b) displays a large amplitude sine-wave, with smaller amplitude higher frequency waves superimposed. Although the lowest frequency is the same for all instruments (except 6e, which shows a different note C6), the magnitudes of the higher frequency peaks vary.

Figure 6. Fourier-spectrum of different instruments (left column) and the corresponding audio-scope trace (right column). Each line corresponds to a different instrument. For deliverable 6 take screenshots of the Fourier-spectrum and audio-scope trace of a single note from your instrument, and measure the frequency of the first four peaks. Use linear scales for both the frequency and magnitude and adjust the frequency range

5

Page 6: 5BL Lab 6: Sound · 2020. 8. 21. · Play the unknown sound from the 5BL lab 6 website . For deliverable 4 use the ‘ pick data ’ tool to measure the time of two subsequent crests

between 0 and 4 kHz. Repeat the measurement for two different notes . If you use a musical instrument produce tones that are an octave apart (such as A4 and A5). Otherwise, simply produce two tones of different pitches. Make sure to use the same frequency range for both spectra for comparison. You need a total of four screenshots. You may also construct a simple pan-flute from a drinking straw. Unlike the other instruments, the pan-flute allows us to find the speed of sound from the flute’s pitch and length. In order to turn a straw into a simple pan-flute you need to hermetically seal one end using pliers and a lighter (see e.g. this video ). Thick straws work better than thin straws. If you blow air across the open end of the straw from a side you will produce a sound. Producing a nice sound from this flute requires practice. Figure 6g shows the spectrum of a straw of length L=16 cm. The lowest frequency peak was at 523∓10 Hz. We will see below how you can calculate the speed of sound from these two measurements.

Measurement 6: speed of sound This measurement requires two devices with phyphox (e.g. two phones, or a phone and a tablet). If you do not have two devices you may also use Audacity on your computer instead. You can measure the speed of sound with a stop-watch by measuring the time-of-flight between two points A and B a distance of L apart. However, unless the distance L is large, the time-of-flight is so short that a manual stopwatch is not quick enough, given the typical human reaction time around 0.17 s to an audio stimulus. Instead, we will use the ‘ Acoustic stopwatch ’ in phyphox , which measures the time between two acoustic triggers (e.g. claps). Phyphox can measure this delay with millisecond accuracy. The problem though is that although the phone can accurately measure the arrival of a sound wave at point B it does not know when the sound left point A. You can solve this problem by using two phones, one at point A and one at B. This measurement is best performed with an assistant, in a quiet environment, and outside where sound cannot bounce off of walls. Both phones must run phyphox . First, place each phone on a chair or table and measure their distance. The distance L must be at least three meters. But as usual, a larger distance will produce a more accurate measurement. You may need to adjust the trigger ‘Threshold’ so that the background noise does not inadvertently start or stop the watches. Too low a threshold will lead to premature triggers, while too high a threshold will prevent the phones from hearing your claps. Next, clap once right next to your phone to start both clocks. Then your assistant claps once close to their phone to stop both clocks. When done properly both phones will now indicate the time delay between both claps. For deliverable 8 take screenshots

6

Page 7: 5BL Lab 6: Sound · 2020. 8. 21. · Play the unknown sound from the 5BL lab 6 website . For deliverable 4 use the ‘ pick data ’ tool to measure the time of two subsequent crests

of your acoustic-stopwatch measurements on both phones, and record the distance L between the phones. Would you expect the two times to be identical? If you do not have an assistant you may perform the measurement alone by clapping first near one phone, walking quietly to the second phone, and then clapping again. The total time between the two claps is not important and could be well over 10 s. In our case, the distance between the phones was L=7.5 m and the experiment was performed outdoors using a trigger threshold of 0.01. We measured a time between claps of 7.018 s for the phone near the first clap, and a slightly shorter time of 6.976 s for the phone near the second clap. The difference between these two times was ΔT= 0.042 s = 42 ms. Repeating the measurement three times we found a standard- deviation of 0.004 s for an average ΔT= 42∓4 ms. We will see below how you can calculate the speed of sound from these two measurements. This video shows how to perform this measurement in detail.

3. Evaluation and explanation of results

What is the highest and lowest pitch you can hear? Sound is a longitudinal pressure wave that can stimulate your ear-drums. The ear-drums are membranes that act as driven oscillators and vibrate at the very same frequency as the sound wave (i.e. the driver). A driven oscillator vibrates with the highest amplitude when driven at its natural frequency but does not respond well to much lower and much higher frequencies. The human ear is most sensitive at 2.7 kHz (the resonance frequency) and responds to sound waves between 20 Hz and 20 kHz, depending on age. Sound at frequencies above 20 kHz is inaudible and is therefore called ultrasound, even though other animals such as dolphins or bats can hear frequencies as high as 150 kHz. When playing with the online tone-generator you should have noticed that a 2.7 KHz tone seemed significantly louder than sound at much higher or lower frequencies. In our case we used standard wired Apple earbuds and could hear frequencies as low as 25 Hz and as high as 14.6 kHz. The problem with this measurement (experiment 1) is, that the speakers or headphones you use to produce the sound also act as driven oscillators (with the computer provided sinusoidal voltage as driver), and have their own frequency response and cutoff. Your measurement is therefore a convolution (i.e., combination) of your ear’s frequency response with the speaker’s response. Apple claims their in-ear headphones produce a flat frequency response between 5 Hz and 21

7

Page 8: 5BL Lab 6: Sound · 2020. 8. 21. · Play the unknown sound from the 5BL lab 6 website . For deliverable 4 use the ‘ pick data ’ tool to measure the time of two subsequent crests

kHz, but your built-in speakers may not be able to produce sounds below 50 Hz or above 15 kHz.

What determines the pitch and loudness of sound? The pitch of the sound is the frequency f=1/T of the wave, where T is the period. The volume of the sound (loudness) is the pressure amplitude of the wave (figure 7). Do not confuse the instantaneous pressure that oscillates sinusoidally with the amplitude. An instantaneous pressure of zero does not mean that you cannot hear a sound. It only indicates that the ear-drum is currently moving through its equilibrium position. In fact, the ear needs at least a few full oscillations to even recognize a sound. Changes in loudness occur on much slower time scales than the period and are represented by the amplitude or envelope of the sin-wave. The sound in figure 7 has a constant pitch but the loudness (blue envelope) changes from high to low on a time scale of several periods . We will see in next week’s lab how to produce such a sound.

Figure 7. Amplitude modulated sound wave. The frequency f=1/T determines the pitch and the amplitude determines the loudness. This sound has a constant pitch but oscillates in volume.

Why do different instruments sound differently? The same note does not sound exactly the same if it is played by a guitar, a piano, or any other instrument. The reason for that is that each instrument has its own timbre for a given note. Timbre, also known as tone quality, is the sum of all qualities that are different in two different sounds which have the same pitch and the same loudness. For each instrument, the sound produced is a multitude of frequencies. The sound has a fundamental frequency (i.e. the lowest frequency) and multiple overtones (any frequency higher than the fundamental). One of the things that determine the timbre is the relative magnitude of these different spectral components.

8

Page 9: 5BL Lab 6: Sound · 2020. 8. 21. · Play the unknown sound from the 5BL lab 6 website . For deliverable 4 use the ‘ pick data ’ tool to measure the time of two subsequent crests

Figure 6c shows the spectrum of a piano playing a C5 at 523 Hz. Besides the fundamental frequency of 523 Hz the spectrum also shows peaks at 1046 Hz, 1569 Hz, etc. but at varying magnitude. As you can see (figure 6a,c,g) the relative magnitude of each peak is different for each instrument. The relative magnitude of the overtones is a unique fingerprint and the reason why we can distinguish different instruments. A piano is a stringed-instrument and is based on a vibrating string just like a guitar. When you excite the string with the stroke of a key, sinusoidal standing waves form on the string. Since the string is fixed on both ends, only certain wavelengths and frequencies are allowed:

where L is the length of the string, v is the wave velocity on the string that depends on the string and its tension, and n =1,2,3,… is an integer called the mode number (or order). When you pluck a string, you excite many different modes simultaneously. Each peak in the spectra corresponds to a different n . The lowest frequency mode ( n =1) is called the fundamental mode and usually has the largest amplitude. Higher order modes or overtones are also called harmonics (e.g. n =2 is the second harmonic, n =3 is the third harmonic etc.). The peaks in the Fourier spectrum of an instrument are equally spaced since f is proportional to n . Furthermore, the spacing between adjacent modes is v/2L . Table 1 summarizes the properties of the first three modes in the C5 note spectrum, or the first three peaks. You can find the mode number of a peak by dividing its frequency f by the frequency f 1 of the fundamental mode ( n=f/f 1 ).

f n Designation Wave pattern

523 Hz n = 1 Fundamental or 1 st harmonic

1046 Hz n = 2 1 st overtone or 2 nd harmonic

1568 Hz n = 3 2 nd overtone or 3 rd harmonic

Table 1. The three lowest frequency standing wave modes in the C5 note. Figures 6c and 6e compare two different notes from a piano. While 6c shows a C5 at 523 Hz, figure 6e shows a C6 at 1046 Hz and exactly one octave higher. The

9

Page 10: 5BL Lab 6: Sound · 2020. 8. 21. · Play the unknown sound from the 5BL lab 6 website . For deliverable 4 use the ‘ pick data ’ tool to measure the time of two subsequent crests

fundamental mode of C6 precisely overlaps with the 2nd harmonic of C5. The reason that shifting up one octave “sounds the same” is that the overtone pattern of a tone and the same tone one octave higher is nearly identical. Reverse-song search apps such as Shazam or Soundhound are based on the same physics. The app records a couple of seconds of music, calculates the Fourier transform for each 1 second interval, and identifies the most pronounced frequencies. These frequencies versus time represent a unique fingerprint that identifies the song. Shazam has precomputed such fingerprints from a very big database of music tracks (currently more than 15 billion songs), and compares the fingerprint of your recording with its database. Recording a song with the ‘ Audio Spectrum / History ’ tool in phyphox visualizes nicely what Shazam does. Finally, we can calculate the speed of sound from our pan-flute pitch measurement. Unlike the guitar or piano, the pan-flute is a wind-instrument. The oscillating medium is air, the velocity is the speed of sound in air, and vibrations are caused by standing sound waves. Since this flute is closed on one end, the formula is different than the one for stringed instruments above. The wavelength of the fundamental standing wave on a ‘closed flute’ is λ=4L, where L is the length of the flute. The pitch of this flute is therefore f = c/(4L). We measured a pitch of 523∓10 Hz for a length of L=16 cm. This corresponds to a speed of sound of c = 4Lf = 328∓7 m/s.

How can you find the speed of sound from time-of-flight? Figure 8 shows our setup. The two phones are a distance of L apart.

Figure 8. Setup to measure the speed of sound with two phones.

You clap near phone A at time t=0 . This starts the acoustic stopwatch on phone A at once. However, it takes a time of L/c for the sound to travel to phone B and your assistant (c is the speed of sound). Clock B starts at t=L/c . This is also the time when your assistant hears your clap. The assistant claps after an arbitrary delay of Δt . This stops clock B at t=L/c + Δt . The time measured on clock B is therefore (L/c + Δt) - L/c = Δt . It takes a time of L/c for the second clap to travel from B to A. Clock A is therefore

10

Page 11: 5BL Lab 6: Sound · 2020. 8. 21. · Play the unknown sound from the 5BL lab 6 website . For deliverable 4 use the ‘ pick data ’ tool to measure the time of two subsequent crests

stopped at t=2L/c + Δt . The time measured on clock A is therefore 2L/c + Δt . The difference between the two measurements is then ΔT= (2L/c + Δt) - Δt = 2L/c . The sound speed can then be calculated as c=2L/ΔT . We measured ΔT = 42∓4 ms for a distance of L =7.5 m. The measured sound speed is then c = 2L/ΔT = 15 m / 0.042 s = 357 ∓ 35 m/s. This is consistent with the theoretical speed of sound in dry air at 20 o C of c = 343 m/s = 767 mph. Measurement 6 in reverse has several important applications: knowing c one can find the distance L = c٠ Δt from a time of flight Δt measurement. This is used for example in a depth-sounder or camera autofocus, and for navigation by bats and marine mammals. Also, if you measure a delay of Δt between the flash and the thunder from a lightning strike, the storm will be a distance of c٠ Δt away from you (0.2 miles for each second).

4. Deliverables

For full credit, please include the following in your lab report. Follow the template provided on the Weebly Lab 6 page and include one deliverable per Google slide in the order that they are presented below.

1. What was the highest and lowest pitch you could hear? How did the loudness vary with frequency? Did you use headphones or speakers? (measurement 1)

2. Screenshots of your audio-scope for a high and low pitch (similar to figure 2). 3. Screenshots of your audio-scope for a loud and silent tone (similar to figure 3). 4. T of the mystery tone measured from the audio-scope and its calculated

frequency (measurement 3). 5. Screen-shots of the Fourier-spectrum of your mystery tone both in log and linear

scales (similar to figure 5). What is the frequency of your peak? 6. Fourier spectrum and audio-scope trace of two different tones from your

instrument (experiment 5). You need 4 screenshots total. State your instrument. 7. Frequencies of the first four peaks in your instrument Fourier spectra expressed

in Hertz and as ratio to the fundamental frequency (n). Also include the name of each harmonic and sketch the wave-pattern (experiment 5).

8. Screenshots of your acoustic stopwatches. What speed of sound did you measure ? Show all your work (measurement 6).

11