Unformatted text preview:

Lecture 5: From Analog to Digital (cont.)AnnouncementsPlan for TodayAnalog vs. DigitalReminder of Key Sampling ResultIn the frequency domain…Hearing and Seeing AliasingHow to Avoid AliasingWhy are CDs sampled at 44.1kHz?QuantizationQuantization with a MapNext step: Use Binary NumbersBinary NumbersMore on Binary NumbersCombining Sampling & QuantizationLanguage is a signal too!Lecture 5: From Analog to Digital (cont.)The Digital World of MultimediaProf. Mari OstendorfReading: Orsak et al., Chapter 5EE299 Lecture 516 Jan 2008Announcements Assignments due this week:  Lab1 (Matlab intro) and HW1  Lab 2 is being updated to  ask for a CollectIt submission,  explain how to write out a sound file in Matlab fix a few typosNew version tonight.EE299 Lecture 516 Jan 2008Plan for Today Review main sampling result Frequency domain view of sampling Quantization Binary representationsEE299 Lecture 516 Jan 2008Analog vs. Digitalanalog signalx(t)digital signalx(n)tncontinuous in timediscrete in timeSAMPLINGcontinuous in amplitudediscrete in amplitudeQUANTIZATIONSound wave, heart beat, temperature fluctuation, image on film, …Audio file on a CD, signal on a digital computer, Dow Jones daily average, image from a digital cameraEE299 Lecture 516 Jan 2008Reminder of Key Sampling ResultTo represent an analog signal on a computer, and be able to recover it later, you need to sample at least twice as fast as the highest frequency: SampleA/DInterpolateD/AFs > 2Fctime signalx(t)sampling ratemax frequency in X(f)EE299 Lecture 516 Jan 2008In the frequency domain… Sampling effectively duplicates the frequency content of the signal (periodic in frequency) If the duplication isn’t spaced far enough apart, there’s overlap (or wraparound)SampleFs < 2FcFc-Fc……2FsFc-Fc-FsFs-2FsNote: Here we use complex exponentials instead of cosinescos(at)=0.5(ejat+e-jat)so we have positive & negative frequencyEE299 Lecture 516 Jan 2008Hearing and Seeing Aliasing Sound demo: higher frequencies sound lower, mixing with actual low frequencies can make it sound muffled See: sound_sampling.mEE299 Lecture 516 Jan 2008How to Avoid Aliasing Pick a desired sampling rate Fs Eliminate frequency content above Fc=Fs/2 with a low-pass filter Then sampleSampleA/DInterpolateD/AWFs > 2Fctime signalx(t)X(f)Anti-aliasingfilterFc < WZ(f)z(t)z(n)Note: We’ll learn about filters next lecture.EE299 Lecture 516 Jan 2008Why are CDs sampled at 44.1kHz? Sampling rate must be greater than 2*20kHz to get full hearing range of most listeners Since practical filters aren’t perfect, it’s a good idea to go a bit higher But why 44.1kHz exactly? Arguing over standards… inherited from a method for storing digital audio on analog video tapes. FcIdealfilterFcNon-idealfilterEE299 Lecture 516 Jan 2008Quantization Map continuous-valued amplitude of each sample into one of a finite set of numbers Levels can be… uniform -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5 or arbitrary-0.5, -0.32, -0.2, -0.1, -0.04, 0, 0.04, 0.1, 0.2, 0.32, 0.5EE299 Lecture 516 Jan 2008Quantization with a Map Represent that number with an index (e.g. 0,1,…,255) Use that index with a table of values when you play the sound or display the image Leverages human perception: some regions (or frequencies) need fewer levels than othersQ(X)computer or communicationschannelV(I’)Xmap values VX’I I’EE299 Lecture 516 Jan 2008Next step: Use Binary Numbers 1/0 is easy to store, e.g. Up/down direction of magnetization Smooth (reflective) surface vs. pit for CD On/off in memory 1/0 distinction is good for reliability in communications, can detect signal and resend at repeater before noise gets too great On/off switch is easy (fast) for computing In general, the binary representation is simple and reliableEE299 Lecture 516 Jan 2008Binary Numbers Binary numbers d3 d2 d1 d0 in binary = d3x23+ d2x22+ d1x21 + d0x1 k bits let you represent 2knumbers 8 levels Î 3 bits (23=8) 8 bits Î 256 levels (28=256) Examples: 10 in decimal = 1010 in binary 10 in binary = 2 in decimal In binary: 1+1=10 Question: what is 56 in binary? 111000EE299 Lecture 516 Jan 2008More on Binary Numbers To represent both positive and negative numbers, you need an extra “sign” bit To represent non-integer numbers, use bits to the right of an assumed “point” for negative powers Decimal:  753.25 = 7x102+ 5x10 + 3x1 + 2x10-1+ 5x10-2 Binary (=5.75 in decimal) 101.11 = 1x22 + 0x2 + 1x1 + 1x2-1+ 1x2-2EE299 Lecture 516 Jan 2008Combining Sampling & Quantization Number of bits to store a signal Duration of audio signal (or size of image,…)X sampling rateX bits per sample (depends on # of quantizer levels) Example 1:  how many bits are required to store 1 minute of stereo CD music? (44.1k sample rate, 16 bit samples) (60 sec)x(44.1k samples/sec)x(16 bits/sample)x(2 channels) = 84.7 Mbits Example 2:  how precise is the quantization telephone speech? (64kbs with a sample rate of 8k) (64k bits/sec)/(8k samples/sec) = 8 bits/sampleEE299 Lecture 516 Jan 2008Language is a signal too! How do we represent language on a computer? Via characters: In English, ASCII mapping between 7-bit binary code and characters (letters, numbers, space, symbols)You & I, 1011001 1101111 1110101 0100000 0100110 01000000 1001001 0101100 In other languages (e.g. Chinese), a longer code is needed Via words: A word corresponds to an index in a map, useful for search engines, text analysis,


View Full Document

UW EE 299 - Lecture Notes

Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?