Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 4-Integrating Peripherals in Embedded Systems (cont.)

Similar presentations


Presentation on theme: "1 4-Integrating Peripherals in Embedded Systems (cont.)"— Presentation transcript:

1 1 4-Integrating Peripherals in Embedded Systems (cont.)

2 2 Analog-to-digital converters Why Analog? Not everything is digital! Even digital signaling has analog aspects (!?) Analog circuits and analysis are still necessary Physical phenomena (ie the real world) are usually analog Many sensors are analog (potentiometer, phototransistor, thermo-sensor, microphone) Many actuators are analog (solenoid, speakers) Some signals need to be processed in analog domain before conversion to digital (amplification, filtering, linearization)

3 3 Analog-to-digital converters proportionality V max = 7.5V 0V 1111 1110 0000 0010 0100 0110 1000 1010 1100 0001 0011 0101 0111 1001 1011 1101 0.5V 1.0V 1.5V 2.0V 2.5V 3.0V 3.5V 4.0V 4.5V 5.0V 5.5V 6.0V 6.5V 7.0V analog to digital 4 3 2 1 t1t2t3 t4 0100100001100101 time analog input (V) Digital output digital to analog 4 3 2 1 0100100001100101 t1t2t3 t4 time analog output (V) Digital input

4 4 Digital and Analog Conversion A/D transfer function:  10-bit ADC converter  1024 voltage levels between 0V and VREF  10-bit digital value Usually VDD=VREF e/Vmax=d/(2^n-1) How does D/A and A/D conversion work?

5 5 D/A Conversion D/A is simpler than A/D  Different resisters and an inverted OpAmp, to implement a weighted summer.  Example: 4-bit D/A  If D3D2D1D0=0001 (i.e., 0V,0V,0V,-5V) Vo=-1.1*(D0/17.6+D1/8.8+D2/4.4+D2/2.2) =0.3125V  If D3D2D1D0=1111 (i.e., -5V,-5V,-5V,-5V) Vo=-1.1*(D0/17.6+D1/8.8+D2/4.4+D2/2.2) =4.6875V

6 6 A/D Conversion Use D/A converter to generate different analog values and compare  Control logic decides which values to try  When comparison complete, best match is put on output How can D/A be matched to input in fewest steps?

7 7 Successive Approximation Matching strategies:  Counting conversion (slow)  Successive approximation (faster) Successive Approximation:  Basically binary search:  10 steps instead of 1024

8 8 Given an analog input signal whose voltage should range from 0 to 15 volts, and an 8-bit digital encoding, calculate the correct encoding for 5 volts. Then trace the successive-approximation approach to find the correct encoding. 5/15 = d/(2 8 - 1)=d/255 d= 85 Successive-approximation method Digital-to-analog conversion using successive approximation 01000000 Encoding: 01010101 ½(V max – V min ) = 7.5 volts V max = 7.5 volts. ½(7.5 + 0) = 3.75 volts V min = 3.75 volts. 0000000001000000 ½(7.5 + 3.75) = 5.63 volts V max = 5.63 volts ½(5.63 + 3.75) = 4.69 volts V min = 4.69 volts. 01010000 ½(5.63 + 4.69) = 5.16 volts V max = 5.16 volts. 01010000 ½(5.16 + 4.69) = 4.93 volts V min = 4.93 volts. 01010100 ½(5.16 + 4.93) = 5.05 volts V max = 5.05 volts. 01010100 ½(5.05 + 4.93) = 4.99 volts 01010101

9 9 Analog to Digital Recording Chain ADC Continuously varying electrical energy is an analog of the sound pressure wave. Microphone converts acoustic to electrical energy. It’s a transducer. ADC (Analog to Digital Converter) converts analog to digital electrical signal. Digital signal transmits binary numbers. DAC (Digital to Analog Converter) converts digital signal in computer to analog for your headphones.

10 10 Analog Representations of Sound Magnified phonograph grooves, viewed from above: When viewed from the side, channel 1 goes up and down, and channel 2 goes side to side.

11 11 Analog to Digital Conversion Instantaneous amplitudes of continuous analog signal, measured at equally spaced points in time. A series of “snapshots”

12 12 [a.k.a. “sample word length,” “bit depth”] Precision of numbers used for measurement: the more bits, the higher the resolution. Example: 16 bit Analog to Digital Overview Sampling Rate How often analog signal is measured Sampling Resolution [samples per second, Hz] Example: 44,100 Hz

13 13 Sampling Rate Nyquist Theorem: Sampling rate must be at least twice as high as the highest frequency you want to represent. Determines the highest frequency that you can represent with a digital signal. Capturing just the crest and trough of a sine wave will represent the wave exactly.

14 14 Common Sampling Rates Sampling RateUses 44.1 kHz (44100)CD, DAT 48 kHz (48000)DAT, DV, DVD-Video 96 kHz (96000)DVD-Audio 22.05 kHz (22050)Old samplers Most software can handle all these rates. Which rates can represent the range of frequencies audible by (fresh) ears?

15 15 3-bit Quantization A 3-bit binary (base 2) number has 2 3 = 8 values. 0 1 2 3 4 5 6 7 A rough approximation Amplitude Time — measure amp. at each tick of sample clock

16 16 Common Sampling Resolutions Word lengthUses 8-bit integerLow-res web audio 16-bit integerCD, DAT, DV, sound files 24-bit integerDVD-Video, DVD-Audio 32-bit floating point Software (usually only for internal representation)

17 17 The Digital Audio Stream It’s just a series of sample numbers, to be interpreted as instantaneous amplitudes: one for every tick of the sample clock. Previous example: 11 13 15 13 10 9 6 1 4 9 15 11 13 9 This is what appears in a sound file, along with a header that indicates the sampling rate, bit depth and other things.

18 18 Audio File Size CD characteristics… - Sampling rate: 44,100 samples per second (44.1 kHz) How big is a 5-minute CD-quality sound file? - Sample word length: 16 bits (i.e., 2 bytes) per sample - Number of channels: 2 (stereo)

19 19 Audio File Size 5 minutes * 60 seconds per minute = 300 seconds How big is a 5-minute CD-quality sound file? 44,100 samples * 2 bytes per sample * 2 channels = 176,400 bytes per second 300 seconds * 176,400 bytes per second = 52,920,000 bytes = c. 50.5 megabytes (MB)

20 20 MPEG Compression MPEG 1-Layer 3 (.mp3)  “Motion Picture Experts Group” Different levels for different purposes E.g. MPEG 2 used for DVDs  Takes out parts of the sound signal that humans can’t hear  How does the size change? Lossy compression Data Reduction LayerBitrate (kbps) for stereo 1:41384 1:6..1:82256..192 1:10..123128…112 More on MPEG Compression http://www.cs.wustl.edu/~jain/cis788-99/ftp/compression/index.html

21 21 MPEG 3 Audio Compression (mp3) http://www.iis.fraunhofer.de/amm/techinf/layer3/

22 22 MPEG Compression


Download ppt "1 4-Integrating Peripherals in Embedded Systems (cont.)"

Similar presentations


Ads by Google