Top Banner
Digital Representation of Audio Information Kevin D. Donohue Electrical Engineering University of Kentucky
22

Digital Representation of Audio Information

Feb 12, 2016

Download

Documents

nolcha

Digital Representation of Audio Information. Kevin D. Donohue Electrical Engineering University of Kentucky. 11 10 01 00. Elements of a DSP System. Discrete-time Signal. Digital Signal. Analog Signal. Coder. Quantizer. Processed Digital Signal. Processed Analog Signal. - PowerPoint PPT Presentation
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: Digital Representation of Audio Information

Digital Representation of Audio Information

Kevin D. DonohueElectrical EngineeringUniversity of Kentucky

Page 2: Digital Representation of Audio Information

Elements of a DSP SystemDigital SignalDiscrete-time

Signal

Processed Analog Signal

Processed Digital Signal

QuantizerAnalog Signal

Coder

11 10 01 00

Computing /Decoding

Interpolating /Smoothing

)(txa )(nTxa )(ˆ nTx

)(ˆ nx

)(ˆ nx

)(ˆ ny )(ˆ tya

Page 3: Digital Representation of Audio Information

Critical Audio Issues

Trade-off between resources to store/transmit and quality of audio informationSampling rateQuantization levelCompression techniques

Page 4: Digital Representation of Audio Information

Sound and Human Perception

Signal fidelity does not need to exceed the sensitivity of the auditory system

Page 5: Digital Representation of Audio Information

Audible Frequency Range and Sampling Rate

Frequency range - 20 to 20,000 Hz

Audible intensities - threshold of hearing (1 Pico watt/meter2 corresponds to 0 db

Sample sweep constant intensity – 0 to 20 kHz in 10 seconds

Page 6: Digital Representation of Audio Information

Sampling Requirement

A bandlimited signal can be completely reconstructed from a set of discrete samples by low-pass filtering (or interpolating) a sequence of its samples, if the original signal was sampled at a rate greater than twice its highest frequency.

Aliasing errors occur when original signal contains frequencies greater than or equal to half the sampling rate.

Signal energy beyond 20 kHz is not audible, sampling rates beyond 40 kHz should capture almost all audible detail (no perceived quality loss).

Page 7: Digital Representation of Audio Information

Sampling Standards

CD quality samples at 44.1 kHz

DVD quality samples at 48 kHz

Telephone quality 8 kHz.

Page 8: Digital Representation of Audio Information

Spectogram of CD sound

0

20

40

60

80

100

120

Seconds

Her

tzTell Me Ma - Spectrogram in dB

0 5 10 15

1000

2000

3000

4000

5000

6000

7000

8000

Page 9: Digital Representation of Audio Information

Spectrogram at Telephone Rate Sound

-20

0

20

40

60

80

100

Tell Me Ma - Spectrogram in dB

Seconds

Her

tz

0 5 10 15

500

1000

1500

2000

2500

3000

3500

4000

Page 10: Digital Representation of Audio Information

Bandwidth and Sampling Errors

Original Sound

Limited Bandwidth (LPF with 900 Hz cutoff) and sampled at 2 kHz

Original Sound sampled at 2 kHz (aliasing)

102

103

104

-120

-100

-80

-60

-40

-20

Hertz

dB

Tell Me Ma - Average Spectrum CD quality

101

102

103

104

105

-150

-100

-50

0Tell Me Ma - Average Spectrum 900 Hz cutoff

Hertz

dB

Page 11: Digital Representation of Audio Information

Dynamic Range and Audible Sound

Intensity changes less than 1 dB in intensity typically are not perceived by the human auditory system.

25 tones at 1 kHz, decreasing in 3 dB increments

The human ear can detect sounds from 1x10-12 to 10 watts / meter2 (130 dB dynamic range)

Page 12: Digital Representation of Audio Information

Quantization Levels and Dynamic Range

An N bit word can represent 2N levels

For audio signal an N bit word corresponds to:Nx20xLog10(2) dB dynamic range

16 bits achieve a dynamic range of about 96 dB. For every bit added, about 6 db is added to the dynamic range.

Page 13: Digital Representation of Audio Information

Quantization Error and Noise

Quantization has the same effects as adding noise to the signal:

11 10 01 00

)(ˆ)()( nTxnTxnTn aq )(ˆ)()( nTxnTnnTx qa

)(txa )(nTxa )(ˆ nTxAnalog Discrete Digital

Intervals between quantization levels are proportional to the resulting quantization noise.

For uniform quantization, the interval between signal levels is the maximum signal amplitude value divided by the number of quantization intervals.

Page 14: Digital Representation of Audio Information

Quantization Noise

Original CD clip quantized with 6 bits at original sampling frequency

6 bit quantization at 2 kHz sampling

101

102

103

104

105

-140

-120

-100

-80

-60

-40

-20

0

Hertz

dB

Tell Me Ma - with 6 bit quantization

QuantizationNoise Energy

Page 15: Digital Representation of Audio Information

Encoding and Resources

Pulse code modulation (PCM) encodes each sample over uniformly spaced N bit quantization levels.

Number of bits required to represent C channels of a d second signal sampled at Fs with N bit quantization is:

d*C*N*Fs + bits of header information  A 4 minute CD quality sound clip uses Fs=44.1 kHz, C=2,

N=16 (assume no header):  File size = (4*60)*2*16*44.1k = 338.688Mb (or 42.336MBytes) Transmission in real time requires a rate greater than 1.4 Mb/s

Page 16: Digital Representation of Audio Information

Compression TechniquesCompression methods take advantage of signal

redundancies, patterns, and predictability via:

Efficient basis function transforms (wavelet and DCT)

LPC modeling (linear predictive coding)

CLPC (code excited linear prediction)

ADPCM (adaptive delta pulse code modulation)

Huffman encoding

Page 17: Digital Representation of Audio Information

File Formats

• Critical parameters for data encoding describe how samples are stored in the filesigned or unsigned bits per samplebyte ordernumber of channels and interleavingcompression parameters

Page 18: Digital Representation of Audio Information

File Formats• Extension, name origin variable parameters (fixed; Comments)•  • .Au or .snd next, sun rate, #channels, encoding, info string• .aif(f), AIFF apple, SGI rate, #channels, sample width, lots of info• .aif(f), AIFC apple, SGI same (extension of AIFF with compression)• .Voc Soundblaster rate (8 bits/1 ch; Can use silence deletion)• .Wav, wave Microsoft rate, #channels, sample width, lots of info• .sf IRCAM rate, #channels, encoding, info• None, HCOM Mac rate (8 bits/1 ch; Uses Huffman compression)

•  • More details can be found at:•  • http://www.mcad.edu/guests/ericb/xplat.aud.html• http://www.intergate.bc.ca/business/gtm/music/sndweb.html#files• http://www.soften.ktu.lt/~marius/audio.descript.html• http://www.dspnet.com/TOL/newsletter/vol2_issue1/video_streaming.html

Page 19: Digital Representation of Audio Information

Subband Filtering and MPEG

• Subband filtering transforms a block of time samples (frame) into a parallel set of narrow band signal

Page 20: Digital Representation of Audio Information

MPEG Layers

MPEG defines 3 layers for audio. Basic model is same, but codec complexity increases with each layer.

Divides data into frames, each of them contains 384 samples, 12 samples from each of the 32 filtered subbands.

Layer 1: DCT type filter with one frame and equal frequency spread per band. Psychoacoustic model only uses frequency masking (4:1).

Layer 2: use three frames in filter (before, current, next, a total of 1152 samples). This models some temporal masking (6:1).

Layer 3: better critical band filter is used (non-equal frequencies), psychoacoustic model includes temporal masking effects, takes into account stereo redundancy, and uses Huffman coder (12:1).

Page 21: Digital Representation of Audio Information

MPEG - Audio• Http://fas.sfu.Ca/cs/undergrad/CourseMaterials/cmpt479/material/notes/chap4/chap4.3/chap4.3.Html

• Steps in algorithm: Filters audio signal (e.g. 48 kHz sound) into frequency subbands that approximate the 32 critical bands -->

sub-band filtering. Determine amount of masking for each band caused by nearby band (this is called the psychoacoustic

model). If the power in a band is below the masking threshold, don't encode it. Otherwise, determine number of

bits needed to represent the coefficient such that noise introduced by quantization is below the masking effect.

Format bitstream

Page 22: Digital Representation of Audio Information

Example

• After analysis, the first levels of 16 of the 32 bands are these: • ----------------------------------------------------------------------• Band 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

• Level (db) 0 8 12 10 6 2 10 60 35 20 15 2 3 5 3 1• ----------------------------------------------------------------------

• If the level of the 8th band is 60db, • It gives a masking of 12 db in the 7th band, 15db in the 9th. • Level in 7th band is 10 db ( < 12 db ), so ignore it. • Level in 9th band is 35 db ( > 15 db ), so send it. • --> Can encode with up to 2 bits (= 12 db) of quantization error