lecture 17 analog music storage digital signals digital music storage instructor: david kirkby...

23
Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby ([email protected])

Upload: dana-groome

Post on 29-Mar-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Lecture 17Analog Music StorageDigital SignalsDigital Music Storage

Instructor: David Kirkby ([email protected])

                                                                                 

Page 2: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 2

MiscellaneousNormal office hours this week: Wed 10-11am, 3-4pm.

I will be travelling Fri-Wed. Office hours will beWed (Dec 11) 3-5pm during exam week.

The final exam will be 90 mins, held in class on Fri Dec 13.

The final exam format will be similar to the midterm:•multiple choice questions (bring a Scantron again!)

•Free-form questionsWe will do some review questions in class on Thursday.

Page 3: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 3

Analog SignalsAn analog sound signal can be represented as a curve of amplitude versus time:

am

plit

ud

e

time

Ideally, both time and amplitude can vary continuously over any range.

Page 4: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 4

Analog Sound StorageThe first sound recordings were made by Thomas Edison’s tinfoil phonograph in 1877 (a productive period: the telephone was invented in 1876 and the electric light bulb in 1878!).

Edison’s invention was later perfected into the Berliner and Victor gramophones.

Page 5: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 5

Stereo LP RecordsStereo records pressed in vinyl consist of small grooves whose walls are carved in the shape of the signal to be recorded:

A diamond-tipped stylus follows these grooves to recreate the recorded sound.

How does a single groove recordstereo sound?

Page 6: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 6

Magnetic TapeAnother method of storing signals is magnetically.

                                  

        

Magnetic audio tape consists of a thin plastic tape (135m long for 90 mins) coated in a magnetic powder.

Individual particles in the coating behave like tiny magnets. The fraction of particles whose magnets line up encodes the signal’s amplitude.This fraction is read by a magnet with a small (~4m) gap as the tape moves (~5cm/s) by.

                               

Page 7: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 7

Cassette tape actually encodes four parallel tracks of information:

•Side A left channel

•Side A right channel

•Side B left channel

•Side B left channel

Similar techniques of magnetic storage are used in video tapes, and computer hard discs & floppy discs.

                               

Page 8: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 8

Digital SignalsDigital signals replace the continuous amplitude and time variables with their discrete (or quantized) equivalents:

What are the advantages and limitations of converting an analog signal into a digital form?

am

plit

ud

e

time

Page 9: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 9

Digital Signals are Immune to NoiseThe main advantage of a digital signal over the corresponding analog signal is it can usually be stored (eg, on a CD) or transmitted (eg, over the internet) without being corrupted by the addition of any noise.

This means that the stored or transmitted digital copy is an exact replica of the original digital signal.

Analog signals are not immune to noise, so that making a copy of a copy of a … copy results in a final copy that is significantly degraded from the original source version.

Analogy: broken telephone game with full-sentence or yes/no answers.

Page 10: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 10

Here is an example of a CD-quality digital sample that we will use for audio tests. Can you predict what you will hear based on the sample’s spectrograph?

Page 11: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 11

Limitations of Time SamplingThe main limitation of only recording the signal’s amplitude at regularly-spaced intervals is that some wiggles between samples are lost. These wiggles correspond to high-frequency components of the original signal so that only frequencies f < 1/(2T) can be accurately represented by the digital signal (Nyquist Sampling Theorem).

am

plit

ud

e

time

Page 12: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 12

AliasingListen to these digital recordings with different sampling rates:

•44.1 kHz (CD quality)•8 kHz (typical phone line quality)•2 kHz

Note that frequencies above the cutoff frequency (2/T) do not disappear, but instead are mirrored at lower frequencies below the cutoff! This effect is called aliasing.

time

freq

uen

cy2/T

Page 13: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 13

Here are the spectrograms of the 44kHz and 2kHz sounds:

Page 14: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 14

Filtering and Phase DistortionThe solution to the aliasing problem is to remove high frequencies from the original analog signal, before converting it to a digital signal:

•44.1 kHz (CD quality)

•8 kHz (typical phone line quality)

•2 kHz

Low-PassFilter

Analog-to-Digital Converter

The filtering can introduce a new type of problem (phase distortion) for frequencies near the cutoff frequency. These effects are not audible for sampling rates above ~40kHz (DAT: 48kHz, DVD-Audio: up to 192 kHz)

Page 15: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 15

Here are the spectrograms of the 2kHz sample with and without 1kHz low-pass filtering:

with LPfilterwithout LP

filter

Page 16: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 16

Limitations of Amplitude SamplingAmplitude sampling means that there is a smallest possible change that can be represented.

In practice, amplitude sampling also means that there is a minimum/maximum amplitude that can be represented.

am

plit

ud

e

time

Page 17: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 17

Binary Amplitude LevelsThe most common way of digitally encoding amplitude levels is with Pulse Code Modulation (PCM).

PCM signals are encoded in binary with a certain number B of bits. This means that some range of amplitudes(-ALIM,+ALIM) is covered by 2B discrete levels:

•B = 4 gives 16 levels•B = 8 gives 256 levels•B = 16 gives 65536 levels

Amplitude changes of less than 2ALIM / 2B are too small too encode. Amplitudes beyond -ALIM or +ALIM are too large too encode.

Page 18: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 18

Quantization ErrorThe difference between the true amplitude and the digital amplitude value for each sample is called the quantization error.

Quantization error is more noticeable for quiet signals than for loud signals.

Listen to these digital recordings (at 44.1kHz) using:•16-bit (65536 levels, CD quality)•8-bit (256 levels, typical telephone quality)•4-bit (16 levels)

Dithering and companding are two techniques for minimizing the effects of quantization error.

Page 19: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 19

Compare these spectrograms for 16-bit, 8-bit and 4-bit amplitude digitization:

Page 20: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 20

ClippingAmplitudes outside of the range (-ALIM,+ALIM) are clipped:

am

plit

ud

e

time

-ALIM

+ALIM

Clipping affects loud signals more than quiet signals. Listen to these examples of clipped sounds:

• some clipping

• more clipping

Page 21: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 21

Compare these spectrograms with different amounts of clipping:

Page 22: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 22

Sampling Rate and Levels TradeoffThe amount of space S (in bytes) needed to store eight seconds of music (or any other sound) recorded at a sampling rate R (in Hz) and with 2B levels is:

S = R x B

For example, 8 secs of CD-quality music (R=44.1 kHz, B = 16) takes up ~0.7 Mbytes. The same amount of telephone-quality music (R=8 kHz, B=8) takes up ~64 kbytes.

Compare these digital recordings that each take the same amount of space (32 kbytes / 8 secs, 20x less than CD):

•2 kHz sampling rate, 16-bit amplitude levels•4 kHz sampling rate, 8-bit amplitude levels•8 kHz sampling rate, 4-bit amplitude levels

Page 23: Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (dkirkby@uci.edu)

Physics of Music, Lecture 17, D. Kirkby 23

Compare these spectrograms with different rate-levels tradeoffs (but all the same size, ~20x smaller than CD):

2 kHz,16 bit

4 kHz,8 bit

8 kHz,4 bit