sound: introduction encoding and simple manipulation

37
Sound: Introduction Encoding and Simple Manipulation

Upload: hilary-warner

Post on 14-Jan-2016

230 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Sound: Introduction Encoding and Simple Manipulation

Sound: Introduction

Encoding and Simple Manipulation

Page 2: Sound: Introduction Encoding and Simple Manipulation

Sound is made when something vibrates

Air molecules oscillate back and forth from their equilibrium position, affecting their neighbors

Page 3: Sound: Introduction Encoding and Simple Manipulation

Sound waves are pressure waves• As molecules oscillate back and forth, areas of high and low

pressure occur• Called compressions and rarefactions, respectively

Page 4: Sound: Introduction Encoding and Simple Manipulation

Sound waves are longitudinal• Motion is parallel to

direction of energy transport

• Representation of sound by a sine wave is merely an attempt to illustrate the sinusoidal nature of the pressure-time fluctuations

Page 5: Sound: Introduction Encoding and Simple Manipulation

Sound waves are longitudinal

• Plot pressure fluctuations over time encountered by a fixed detector

Page 6: Sound: Introduction Encoding and Simple Manipulation

Properties of sound waves

• Frequency: cycles per second (Hz)

• Amplitude: distance from 0

Page 7: Sound: Introduction Encoding and Simple Manipulation

Psychoacoustics: Human Perception of Sound

• Ear serves as transducer: coverts sound energy to mechanical energy to nerve impulse transmitted to brain

Page 8: Sound: Introduction Encoding and Simple Manipulation

Psychoacoustics: Human Perception of Sound

• Pitch• Loudness• Timbre

Page 9: Sound: Introduction Encoding and Simple Manipulation

Psychoacoustics: Human Perception of Sound

• Pitch – frequency• Loudness – amplitude• Timbre – combination of various frequencies

Page 10: Sound: Introduction Encoding and Simple Manipulation

Pitch

• Humans hear frequencies between 20 Hz and 20,000 Hz • frequency = pitch

Page 11: Sound: Introduction Encoding and Simple Manipulation

Pitch

• Humans hear frequencies between 20 Hz and 20,000 Hz • frequency = pitch

Hearing works on ratios for pitch…

We hear difference between 200 Hz and 400 Hz, the same as 500 Hz and 1000 Hz

Page 12: Sound: Introduction Encoding and Simple Manipulation

Loudness• Perception of volume is related logarithmically to

changes in amplitude• amplitude = pitch

Page 13: Sound: Introduction Encoding and Simple Manipulation

Loudness

If one sound is 10x times more intense than another sound, then it has a sound level which is 10*x more decibels than the less intense sound.

Intensity is very objective quantity; can be measured with sensitive instrumentation

Loudness is more subjective response; will vary with a number of factors (e.g. age, frequency)

Page 14: Sound: Introduction Encoding and Simple Manipulation

Decibel is a logarithmic measure

• A decibel is a ratio between two intensities: 10 * log10(I1/I2)– As an absolute measure, it’s in comparison to

threshold of audibility– 0 dB can’t be heard. – Normal speech is 60 dB. – A shout is about 80 dB

Page 15: Sound: Introduction Encoding and Simple Manipulation

Digitizing Sound• Analog-to-digital conversion: measure amplitude at an

instant as a number• Instantaneous measure is called a sample

Page 16: Sound: Introduction Encoding and Simple Manipulation

Understanding how computers represent sound

• Consider how a film represents motion…– Movie is made by taking still photos in rapid

sequence at a constant rate, usually twenty-four frames per second

– When the photos are displayed in sequence at that same rate, it fools us into thinking we are seeing continuous motion, even though we are actually seeing twenty-four discrete images per second

http://music.arts.uci.edu/dobrian/digitalaudio.htm

Page 17: Sound: Introduction Encoding and Simple Manipulation

http://en.wikipedia.org/wiki/Animation

A collection of still frames

Page 18: Sound: Introduction Encoding and Simple Manipulation
Page 19: Sound: Introduction Encoding and Simple Manipulation
Page 20: Sound: Introduction Encoding and Simple Manipulation
Page 21: Sound: Introduction Encoding and Simple Manipulation
Page 22: Sound: Introduction Encoding and Simple Manipulation
Page 23: Sound: Introduction Encoding and Simple Manipulation
Page 24: Sound: Introduction Encoding and Simple Manipulation
Page 25: Sound: Introduction Encoding and Simple Manipulation
Page 26: Sound: Introduction Encoding and Simple Manipulation
Page 27: Sound: Introduction Encoding and Simple Manipulation
Page 28: Sound: Introduction Encoding and Simple Manipulation
Page 29: Sound: Introduction Encoding and Simple Manipulation
Page 30: Sound: Introduction Encoding and Simple Manipulation

How computers represent sound

• Digital recording of sound works on the same principle– We take many discrete samples of the sound

wave's instantaneous amplitude, store that information, then later reproduce those amplitudes at the same rate to create the illusion of a continuous wave

http://music.arts.uci.edu/dobrian/digitalaudio.htm

Page 31: Sound: Introduction Encoding and Simple Manipulation

How often should we take samples?

• sampling rate: number of samples taken per second

• Nyquist Theorem: need to take twice as many samples as the highest frequency we wish to record– Sampling rate = 2 * max sound wave frequency

Page 32: Sound: Introduction Encoding and Simple Manipulation

How often should we take samples?

• sampling rate: number of samples taken per second

• Nyquist Theorem: need to take twice as many samples as the highest frequency we wish to record– Sampling rate = 2 * max sound wave frequency

• CD quality is 44,100 samples per second– what is the max frequency a CD can represent?

Page 33: Sound: Introduction Encoding and Simple Manipulation

Nyquist Theorem

• Consider a graph of a 4,000 Hz cosine wave, being sampled at a rate of 22,050 Hz

• Sample is taken every 0. 045 milliseconds

http://music.arts.uci.edu/dobrian/digitalaudio.htm

Page 34: Sound: Introduction Encoding and Simple Manipulation

Nyquist Theorem

• Consider same 4,000 Hz cosine wave sampled at 6,000 Hz

• Sample is taken every 0. 167 milliseconds • Wave completes more than 1/2 cycle per sample

http://music.arts.uci.edu/dobrian/digitalaudio.htm

Page 35: Sound: Introduction Encoding and Simple Manipulation

Digitizing sound with the computer: bit depth

• The range of possible sample values depends on the number of bits used to store each sample

• Common bit-depths: 8 and 16

http://music.arts.uci.edu/dobrian/digitalaudio.htm

Page 36: Sound: Introduction Encoding and Simple Manipulation

16 bits per sample: +/- 32K

• Each sample can be between -32,768 and 32,767

Compare this to 0..255 for light intensity

(i.e. 8 bits or 1 byte giving us 256 different values)

Why such a bizarre number?

Because 32,768 + 32,767 + 1 = 216

i.e. 16 bits, or 2 bytes< 0 > 0 0

Page 37: Sound: Introduction Encoding and Simple Manipulation

Properties of sound

Sound wave• Frequency• Amplitude• Wavelength• Period

Digitized sound• Sampling rate• Bit depth• Playback rate