45
1 COMP 546 Lecture 19 Sound 2: frequency analysis Tues. March 27, 2018

Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

1

COMP 546

Lecture 19

Sound 2:frequency analysis

Tues. March 27, 2018

Page 2: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

Speed of Sound

Sound travels at about 340 m/s, or 34 cm/ ms.

(This depends on temperature and other factors)

2

Page 3: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

Wave equation

3

𝑃𝑟𝑒𝑠𝑠𝑢𝑟𝑒 = 𝐼𝑎𝑡𝑚 + 𝐼(𝑋, 𝑌, 𝑍, 𝑡)

𝐼(𝑋, 𝑌, 𝑍, 𝑡) is not an arbitrary function.

Rather:

𝜕2

𝜕𝑋2+𝜕2

𝜕𝑌2+𝜕2

𝜕𝑍2𝐼 𝑋, 𝑌, 𝑍, 𝑡 =

1

𝑣2𝜕2

𝜕𝑡2𝐼 𝑋, 𝑌, 𝑍, 𝑡

𝑣 = 340 m/s

Page 4: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

The wave equation + boundary conditions give complicated shadow and reflection effects.

What happens when sound enters the ear ?

4plane wave + single slit sea waves + islands

Page 5: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

5

Musical sounds

(brief introduction)

Page 6: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

6

Modes are sin(𝜋

𝐿𝑗𝑥) where 𝐿 is the length of the string, 𝑗 is an integer.

Write one string displacement at t = 0 as sum of sines.

Example: guitar

Page 7: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

7

Physics says:

where constant 𝑐 depends on physical properties of string(mass density, tension)

𝜔 =𝑐

𝐿

𝐿

Page 8: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

8

Modes of a vibrating string each have fixed points which reduce the effective length.

𝜔 =𝑐

𝐿

2𝑐

𝐿

3𝑐

𝐿

4𝑐

𝐿

𝐿

2

𝐿

3

𝐿

4𝐿

Physics says:

Page 9: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

9

𝜔 =𝑐

𝐿

2𝑐

𝐿

3𝑐

𝐿

4𝑐

𝐿

𝜔0

“fundamental” “overtones”(1st harmonic)

The temporal frequency 𝑚 𝜔0 is called the 𝑚-th harmonic.

Page 10: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

10

For stringed instruments, most of the sound is produced by vibrations of the instrument body (neck, front and back plates). http://www.acs.psu.edu/drussell/guitars/hummingbird.html

The lines in the sketches below are the nodal points. They don't move.

These are vibration modes, not harmonics. The guitar sound is a sum of these modes.

Page 11: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

11

Difference of two frequencies 𝜔1 and 𝜔2 :

𝑙𝑜𝑔2𝜔2

𝜔1octaves.

e.g. 1 octave is a doubling of frequency.

Page 12: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

(Western) Musical Notes

Each “octave” ABCDEFGA is divided into 12 “semitones”, separated into 1/12 octave.

C-D, D-E, F-G, G-A, A-B are two semitones each

E-F, B-C are one semitone each.

12

Page 13: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

13

Q: How many semi-tones are there from 𝜔0 to 𝜔 ?

Page 14: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

14

Q: How many semi-tones are there from 𝜔0 to 𝜔 ?

A: 12 𝑙𝑜𝑔2𝜔

𝜔0

𝜔0

Fundamental frequency of note

𝜔

Page 15: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

15

88 fundamental frequencies (Hz) on a keyboard

The fundamental frequencies of successive notes define a geometric progression.

This is different from the harmonics of a vibrating string which define an arithmetic progression.

Page 16: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

Speech Sounds

16

Page 17: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

What determines speech sounds?

• voiced vs. unvoiced

‘zzzz’ vs. ‘ssss’, ‘vvvv’ vs. ‘ffff’

• articulators (jaw, tongue, lips)

‘aaaa’, ‘eeee’, ‘oooo’, …

17

Page 18: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

18

Voiced sounds are produced by “glottal pulses”.

𝑗=0

𝑛𝑔𝑙𝑜𝑡𝑡𝑎𝑙

𝑔 𝑡 − 𝑗 𝑇𝑔𝑙𝑜𝑡𝑡𝑎𝑙

𝑇𝑔𝑙𝑜𝑡𝑡𝑎𝑙

Page 19: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

19

Exercise 16 Q7.

𝑔 𝑡 − 𝑡0 = 𝑔 𝑡 ∗ 𝛿(𝑡 − 𝑡0)

Page 20: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

20

Voiced sounds are produced by “glottal pulses”.

𝑗=0

𝑛𝑔𝑙𝑜𝑡𝑡𝑎𝑙

𝑔 𝑡 − 𝑗 𝑇𝑔𝑙𝑜𝑡𝑡𝑎𝑙 = 𝑔 𝑡 ∗ 𝑗=0

𝑛𝑔𝑙𝑜𝑡𝑡𝑎𝑙

𝛿 𝑡 − 𝑗 𝑇𝑔𝑙𝑜𝑡𝑡𝑎𝑙

𝑇𝑔𝑙𝑜𝑡𝑡𝑎𝑙

Page 21: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

21

𝑗=0

𝑛𝑔𝑙𝑜𝑡𝑡𝑎𝑙

𝑔 𝑡 − 𝑗 𝑇𝑔𝑙𝑜𝑡𝑡𝑎𝑙

𝑇𝑔𝑙𝑜𝑡𝑡𝑎𝑙

decrease 𝑇𝑔𝑙𝑜𝑡𝑡𝑎𝑙 by increasing tension in vocal cords

increase frequency of pulses≡

Page 22: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

22

𝐼 𝑡 = 𝑎 𝑡 ∗ 𝑔 𝑡 ∗ 𝑗=0

𝑛𝑔𝑙𝑜𝑡𝑡𝑎𝑙

𝛿 𝑡 − 𝑗 𝑇𝑔𝑙𝑜𝑡𝑡𝑎𝑙

Let 𝑎 𝑡 be the impulse response function of the articulators.

(jaw, tongue,lips)

Page 23: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

23

𝑛𝑝𝑢𝑙𝑠𝑒 −1

𝑛𝑝𝑢𝑙𝑠𝑒 −1

Page 24: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

24

𝑛𝑝𝑢𝑙𝑠𝑒 −1

𝑛𝑝𝑢𝑙𝑠𝑒 −1

Page 25: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

25

Page 26: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

26

Oral and nasal cavity have resonant modes of vibration, like air cavity in guitar does.

Page 27: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

27

Time domain Temporal frequency domain

Peaks are called “formants”

Page 28: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

28

𝑇𝑔 is the period of the glottal pulse train.

The pulse train has 𝑛𝑔𝑙𝑜𝑡𝑡𝑎𝑙 pulses in 𝑇 time steps, i.e.

𝑇𝑔𝑙𝑜𝑡𝑡𝑎𝑙 𝑛𝑔𝑙𝑜𝑡𝑡𝑎𝑙 = 𝑇.

Assume that the Fourier transform is taken over 𝑇 samples.

𝐅

𝑗=0

𝑛𝑔𝑙𝑜𝑡𝑡𝑎𝑙

𝛿 𝑡 − 𝑗 𝑇𝑔𝑙𝑜𝑡𝑡𝑎𝑙 = ?

Page 29: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

29𝑛𝑔𝑙𝑜𝑡𝑡𝑎𝑙

Assignment 3: Show

𝐅

𝑗=0

𝑛𝑔𝑙𝑜𝑡𝑡𝑎𝑙−1

𝛿 𝑡 − 𝑗 𝑇𝑔𝑙𝑜𝑡𝑡𝑎𝑙 = 𝑛𝑔𝑙𝑜𝑡𝑡𝑎𝑙

𝑚=0

𝑇𝑔𝑙𝑜𝑡𝑡𝑎𝑙 −1

𝛿 𝜔 −𝑚 𝑛𝑔𝑙𝑜𝑡𝑡𝑎𝑙

𝑇𝑔𝑙𝑜𝑡𝑡𝑎𝑙

Page 30: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

Units of temporal frequency 𝜔

30

𝑇𝑔𝑙𝑜𝑡𝑡𝑎𝑙 is the period of the glottal pulse train.

𝑛𝑔𝑙𝑜𝑡𝑡𝑎𝑙 pulses in 𝑇 time samples.

To convert 𝑛𝑔𝑙𝑜𝑡𝑡𝑎𝑙 to ‘pulses per second’, we divide 𝑇 (to get

pulses per sample) and then multiply by ‘time samples per second’. High quality audio uses 44,100 samples per second.

Page 31: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

31

𝑛𝑔𝑙𝑜𝑡𝑡𝑎𝑙 is the fundamental frequency of the voiced sound.

It determines the "pitch".

Adult males : 100-150 Adult females : 150-250 HzChildren: over 250 Hz

Page 32: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

32

𝜔0 = 100 𝐻𝑧

𝜔0 = 200 𝐻𝑧

glottal pulse spectrum formant spectrum sound spectrum

glottal pulse spectrum “formants” sound spectrum

Page 33: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

33

Voiced vowel sounds

Page 34: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

Unvoiced sounds noise instead of glottal pulses

34

Page 35: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

Unvoiced sounds noise instead of glottal pulses

35

Flat amplitude spectrum on average ( ‘white noise’)

Page 36: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

Restrict flow of air by moving tongue, lips into contact with the teeth & palate.

Fricatives

- voiced z, v, zh, th (the)

- unvoiced ?

Stops

- voiced b, d, g

- unvoiced ?

Nasals (closed mouth)

- m, n, ng

Consonants

36

Page 37: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

Restrict flow of air by moving tongue, lips into contact with the teeth & palate.

Fricatives

- voiced z, v, zh, th (the)

- unvoiced s, f, sh, th (theta)

Stops

- voiced b, d, g

- unvoiced p, t, k

Nasals (closed mouth)

- m, n, ng

Consonants

37

Page 38: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

38

I did not have time to cover the following slides properly.

I will present them again in lecture 22.

Page 39: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

Spectrogram

39

Partition a sound signal into 𝐵 blocks of 𝑇 samples each (i.e. the sound has 𝐵𝑇 samples in total).

Take the Fourier transform of each block.

Page 40: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

Spectrogram

40

Partition a sound signal into 𝐵 blocks of 𝑇 samples each (i.e. the sound has 𝐵𝑇 samples in total).

Take the Fourier transform of each block.

Let 𝑏 be the block number, and 𝜔 units be cycles per block.

Page 41: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

41

Cycles per second (Hz)

Time (samples)

𝜔0 =

Page 42: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

42

e.g. T = 512 samples (12 ms), 𝜔0 = 86 Hz T = 2048 samples (48 ms) 𝜔0 = 21 Hz

Page 43: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

43

e.g. T = 512 samples (12 ms), 𝜔0 = 86 Hz T = 2048 samples (48 ms), 𝜔0 = 21 Hz

You cannot simultaneously localize the frequency and the time. This is a fundamental tradeoff. We have seen it before (recall the Gaussian).

Page 44: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

44

Narrowband

(good frequency resolution, poor temporal resolution … ~50ms)

Wideband

(poor frequency resolution,good temporal resolution)

Page 45: Sound 2: frequency analysiscim.mcgill.ca/~langer/546/19-sound2-slides.pdf · (brief introduction) 6 Modes are sin ... Write one string displacement at t = 0 as sum of sines. Example:

45

Examples: Spectrograms of 10 vowel sounds