CS 414 – Multimedia Systems Design Lecture 3 – Digital Audio RepresentationAdministrativeKey QuestionsCharacteristics of SoundDigital Representation of AudioSampling (in time)Nyquist TheoremNyquist LimitLimited SamplingSlide 10Sampling RangesSlide 12QuantizationSlide 14Pulse Code ModulationPCM Quantization and DigitizationLinear Quantization (PCM)Non-uniform QuantizationPerceptual Quantization (u-Law)Differential Pulse Code Modulation (DPCM)Differential Quantization (DPCM)Adaptive Differential Pulse Code Modulation (ADPCM)Signal-to-Noise RatioSignal To Noise RatioQuantization ErrorCompute Signal to Noise RatioExampleData RatesComparison and Sampling/Coding TechniquesSummaryCS 414 - Spring 2011CS 414 – Multimedia Systems Design Lecture 3 – Digital Audio RepresentationKlara NahrstedtSpring 2011CS 414 - Spring 2011Administrative Form Groups for MPs Deadline January 24 (today!!) to email TAKey QuestionsHow can a continuous wave form be converted into discrete samples?How can discrete samples be converted back into a continuous form?CS 414 - Spring 2011Characteristics of SoundAmplitudeWavelength (w)Frequency ( )TimbreHearing: [20Hz – 20KHz] Speech: [200Hz – 8KHz]Digital Representation of AudioMust convert wave form to digitalsamplequantizecompressSampling (in time)Measure amplitude at regular intervalsHow many times should we sample?CS 414 - Spring 2011Nyquist TheoremFor lossless digitization, the sampling rate should be at least twice the maximum frequency response. In mathematical terms:fs > 2*fmwhere fs is sampling frequency and fm is the maximum frequency in the signalCS 414 - Spring 2011Nyquist Limit max data rate = 2 H log2V bits/second, whereH = bandwidth (in Hz)V = discrete levels (bits per signal change)Shows the maximum number of bits that can be sent per second on a noiseless channel with a bandwidth of H, if V bits are sent per signalExample: what is the maximum data rate for a 3kHz channel that transmits data using 2 levels (binary) ? Solution: H = 3kHz; V = 2; max. data rate = 2x3,000xln2=6,000bits/second CS 414 - Spring 2011Limited SamplingBut what if one cannot sample fast enough?CS 414 - Spring 2011Limited SamplingReduce signal frequency to half of maximum sampling frequencylow-pass filter removes higher-frequenciese.g., if max sampling frequency is 22kHz, must low-pass filter a signal down to 11kHzCS 414 - Spring 2011Sampling RangesAuditory range 20Hz to 22.05 kHzmust sample up to to 44.1kHzcommon examples are 8.000 kHz, 11.025 kHz, 16.000 kHz, 22.05 kHz, and 44.1 KHzSpeech frequency [200 Hz, 8 kHz]sample up to 16 kHz but typically 4 kHz to 11 kHz is used CS 414 - Spring 2011CS 414 - Spring 2011QuantizationCS 414 - Spring 2011QuantizationTypically use8 bits = 256 levels16 bits = 65,536 levelsHow should the levels be distributed?Linearly? (PCM)Perceptually? (u-Law)Differential? (DPCM)Adaptively? (ADPCM)CS 414 - Spring 2011Pulse Code ModulationPulse modulationUse discrete time samples of analog signalsTransmission is composed of analog information sent at different timesVariation of pulse amplitude or pulse timing allowed to vary continuously over all valuesPCMAnalog signal is quantized into a number of discrete levelsCS 414 - Spring 2011PCM Quantization and DigitizationCS 414 - Spring 2011DigitizationQuantizationLinear Quantization (PCM)Divide amplitude spectrum into N units (for log2N bit quantization)Sound IntensityQuantization IndexCS 414 - Spring 2011Non-uniform QuantizationCS 414 - Spring 2011Perceptual Quantization (u-Law)Want intensity values logarithmically mapped over N quantization units Sound IntensityQuantization IndexCS 414 - Spring 2011Differential Pulse Code Modulation (DPCM)What if we look at sample differences, not the samples themselves?dt = xt-xt-1Differences tend to be smallerUse 4 bits instead of 12, maybe?CS 414 - Spring 2011Differential Quantization (DPCM)Changes between adjacent samples smallSend value, then relative changesvalue uses full bits, changes use fewer bitsE.g., 220, 218, 221, 219, 220, 221, 222, 218,.. (all values between 218 and 222)Difference sequence sent: 220, +2, -3, 2, -1, -1, -1, +4....Result: originally for encoding sequence 0..255 numbers need 8 bits; Difference coding: need only 3 bitsCS 414 - Spring 2011Adaptive Differential Pulse Code Modulation (ADPCM)Adaptive similar to DPCM, but adjusts the width of the quantization stepsEncode difference in 4 bits, but vary the mapping of bits to difference dynamicallyIf rapid change, use large differencesIf slow change, use small differencesCS 414 - Spring 2011Signal-to-Noise RatioCS 414 - Spring 2011Signal To Noise RatioMeasures strength of signal to noiseSNR (in DB)= Given sound form with amplitude in [-A, A]Signal energy = )(log1010energyNoiseenergySignalA0-A22ACS 414 - Spring 2011Quantization ErrorDifference between actual and sampled valueamplitude between [-A, A]quantization levels = Ne.g., if A = 1,N = 8, = 1/4 NA2CS 414 - Spring 2011Compute Signal to Noise RatioSignal energy = ; Noise energy = ; Noise energy = Signal to noise =Every bit increases SNR by ~ 6 decibels122NA2223 NA23log102N22ACS 414 - Spring 2011ExampleConsider a full load sinusoidal modulating signal of amplitude A, which utilizes all the representation levels providedThe average signal power is P= A2/2The total range of quantizer is 2A because modulating signal swings between –A and A. Therefore, if it is N=16 (4-bit quantizer), Δ = 2A/24 = A/8The quantization noise is Δ2/12 = A2/768The S/N ratio is (A2/2)/(A2/768) = 384; SNR (in dB) 25.8 dBCS 414 - Spring 2011Data Rates Data rate = sample rate * quantization * channelCompare rates for CD vs. mono audio8000 samples/second * 8 bits/sample * 1 channel= 8 kBytes / second44,100 samples/second * 16 bits/sample * 2 channel = 176 kBytes / second ~= 10MB / minuteCS 414 - Spring 2011Comparison and Sampling/Coding TechniquesCS 414 - Spring 2011Summary CS 414 - Spring
View Full Document