Top Banner
EECS 352: Machine Perception of Music and Audio Bryan Pardo 2008 Topic 1 Recording & Sampling
21

Machine Perception of Music

Feb 03, 2022

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Topic 1

Recording & Sampling

Page 2: Machine Perception of Music

The Edison Cylinder Recorder

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Page 3: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Recording sound

Mechanical

Vibration

Pressure

WavesMotion->Voltage

TransducerVoltage over time

Page 4: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Microphones

Page 5: Machine Perception of Music

Magnetic tape

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Magnetic tape

Recording

audio signal is sent through the coil of wire

to create a magnetic field in the core.

At the gap, magnetic flux forms a fringe

pattern that magnetizes the oxide on the

tape.

Playback

The motion of the tape pulls a varying

magnetic field across the gap.

This creates a varying magnetic field in the

core and therefore a signal in the coil.

This signal is amplified to drive the

speakers.

Iron C

ore

Wire

Page 6: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

0

1

2

3

4

5

6

-4

-3

-2

-1

0000

0001

0010

0110

0100

0101

0011

1001

1010

1011

1000

Digital SamplingA

MP

LIT

UD

E

TIMEsample

interval

quantization increment

RECONSTRUCTION

Page 7: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

More quantization levels mean

more dynamic range

0

1

2

3

-1

-2

AM

PLIT

UD

E

TIME

quantization increment

Page 8: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Bit depth and dynamics

• More bits = more quantization levels

• More quant. levels = more dynamic range

• More dynamic range = better sound

• Compact disc = 16 bits = 65,536 levels

• POTS = 8 bits = 256 levels

Page 9: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Faster sample rates = better

reconstruction

0

1

2

3

4

5

6

AM

PLIT

UD

E

TIME

-4

-3

-2

-1

sample

interval

Page 10: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

0

1

2

3

4

5

6

AM

PLIT

UD

E

TIME

-4

-3

-2

-1

sample

interval

0

Aliasing and Nyquist

Page 11: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

0

1

2

3

4

5

6

AM

PLIT

UD

E

TIME

-4

-3

-2

-1

sample

interval

0

Aliasing and Nyquist

Page 12: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Sample rates

• You can’t reproduce things if your sample

rate isn’t fast enough to catch them

• Nyquist frequency (def 1)

Over twice the frequency of the highest

frequency you want to represent

• Nyquist frequency (def 2)

½ the sample frequency…

Page 13: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Common Encodings

• Compact Disc

– 16 bits

– 44,100 Hz

• POTS (Plain old telephone service)

– 8 bits

– 8,000 Hz

• MP3

– It’s complicated. Tell you later.

Page 14: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Pure Tone = Sine Wave

0 10 20 30 40 50 60 70 80 90 100-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

TIME

AM

PLIT

UD

E

( ) sin(2 )x t A f

time amplitude frequency phase

Page 15: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Reminders

• Frequency, is measured in cycles per second , AKA Hertz (Hz).

• One cycle contains radians.»

• Angular frequency, , is measured in radians per second and is related to frequency by

• So we can rewrite the sine wave as

( ) sin( )x t A t

1/ f T

2

2 f

Page 16: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Alternate Representation

TIME

AM

PL

ITU

DE

0 10 20 30 40 50 60 70 80 90 100-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

AM

PL

ITU

DE

Frequency Phase

Page 17: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Complex Tone = Sine Waves

0 10 20 30 40 50 60 70 80 90 100-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

0 10 20 30 40 50 60 70 80 90 100-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

0 10 20 30 40 50 60 70 80 90 100-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

0 10 20 30 40 50 60 70 80 90 100-2.5

-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

2.5

+

+

=

220 Hz

660 Hz

1100 Hz

Page 18: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Alternately A

MP

LIT

UD

E

Frequency

0 10 20 30 40 50 60 70 80 90 100-2.5

-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

2.5

200 400 600 800 1000 1200

Time

AM

PLIT

UD

E

Page 19: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Harmonic Sound

• 1 or more sine waves

• Strong components at INTEGER

MULTIPLES of a FUNDAMENTAL

FREQUENCY in the range of human

hearing (20 Hz to 20,000 Hz)

• Examples

– 220 + 660 + 1100 is HARMONIC

– 100 + 220 + 263 is NOT HARMONIC

Page 20: Machine Perception of Music

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Noise

• Lots of sines at random freqs. = NOISE

• Example: 100 sines with random

frequencies, such that 100 < f < 10000

0 0.5 1 1.5 2 2.5 3 3.5

x 104

-30

-20

-10

0

10

20

30

Page 21: Machine Perception of Music

A Fun Example

EECS 352: Machine Perception of Music and Audio

Bryan Pardo 2008

Fre

quency o

f sin

e w

ave

Fre

quency o

f sin

e w

ave

(Thanks to Robert Remez)