Presentation is loading. Please wait.

Presentation is loading. Please wait.

Day 4 Encoding Data. So… We have analog and digital data, and analog and digital signals. –We can use any combination of the above –Why? Shouldn’t we.

Similar presentations


Presentation on theme: "Day 4 Encoding Data. So… We have analog and digital data, and analog and digital signals. –We can use any combination of the above –Why? Shouldn’t we."— Presentation transcript:

1 Day 4 Encoding Data

2 So… We have analog and digital data, and analog and digital signals. –We can use any combination of the above –Why? Shouldn’t we all just agree on one? It’s not that simple, each has benefits and drawbacks.

3 Analog Signals Pros: –The only true way to send analog data without loss. –Captures everything which happens. Information can be lost if captured with digital signal Cons: –Very susceptible to noise Once you have noise very difficult to separate noise from original data. Pops in AM radio –Signal loss over long distances

4 Digital Signals Pros: –Can be copied (repeated) almost infinitely without loss of data –Possible to filter out non valid data because you know what all the possible valid data points are. Cons: –You need a LOT of samples to make a close to true representation of original. –If not sampled correctly first time, difficult to go back and figure out how it should have been.

5 Transmitting Analog Data with Analog Signal Uses Modulation –Amplitude Modulation (AM) Super easy –Frequency Modulation (FM) Not as susceptible to lightning/noise –Phase Modulation (PM) Complex – never used for radio Carrier signal is transmitted on radio stations frequency –Data (talk/music) is added or subtracted from that carrier signal to transmit either AM or FM –Receiver tunes to carrier signal and figures out what data was sent.

6 Transmitting Analog Data with Digital Signal Pulse Code Modulation –Uses hardware/software (codec) to sample analog data into time slices –At each time interval you calculate the current amplitude of the wave –Encode that height and record it –Since you don’t actually record the original wave form, there is some amount of quantizing error, which is difference between actual wave and reproduced graph. Square vs Round.

7 How much to get? Sampling Rate –If you sample too slow the reproduced wave will sound “blocky”. –The higher you sample the more data you have to record/store Quantization levels –The number of different values you can distinguish for the amplitude of each sample –The more quantization levels you have the more accurate the reproduction and the more data you must save.

8 CD – 1980 – Sony/Philips Music/Voice are inherently analog data A CD encodes that data into a digital signal and records that signal as digital data on a CD. –44,100 samples per second –Each sample uses a 16 bit number 0 - 65,535 –Disk is stereo hence 2 separate streams of above are being recorded at once. –44100*16*2=1,411,200bits/second = 176.4kB/s –1 Minute music = 10MB.

9 Delta Modulation Instead of storing the current amplitude you store either a +1 or -1. –Plus 1 means the amplitude is going up –Minus 1 means it is going down A lot less storage is needed to encode this –However, it comes at the cost of precision. If data goes from max to min in 1 time period it’ll take many time periods for the encoded wave to catch up.

10 Transmitting digital data with a digital signal Sounds simple, however there are many different ways to do it. Each has its own pro/con. –Non return to Zero –Non return to Zero Inverted –Manchester Encoding –Differential Manchester Encoding –Bipolar AMI –4/5 Digital Encoding

11 Digital signal Basically we need a way to send a 1 or a 0 down a wire with electricity. Specifically we need to be able to send a stream of 1’s and 0’s in rapid succession without either side getting confused. No matter what we need a clock so both sides can stay in sink and know when one signal ends and another starts. –Keeping the clocks in sync is critical to understanding the signal.

12 Non return to Zero Simplest system –At the beginning of each clock cycle: If you want to send a 1, send low (no) voltage If you want to send a 0, send high voltage Easy to generate, simple to understand

13 Non-return to zero Inverted At the start of each clock signal –If you want to send a 1, change the current voltage Either low -> high or high -> low –If you want to send a 0, don’t change the current voltage. Easier for remote side to determine what you sent, looking for change is easier than having to check actual voltage.

14 NRZ & NRZI – Issues: Problems –What if you need to transmit 1million 1’s? You’d basically turn the voltage off for 1 million time periods How does the other side even know you are still here? What if the other sides clock goes just a little faster/slower than yours?

15 Manchester Encoding There is a change in EVERY clock cycle In the MIDDLE of each clock cycle: –If you wish to transmit a 1 Change voltage from Low -> High –If you wish to transmit a 0 Change voltage from High -> Low At the start of each clock signal you will have to anticipate what you’ll be transmitting and set yourself up –If you just sent a 0 and want to send another 0, you’ll quickly have to go back to high.

16 Differential Manchester Encoding Always have a transition in the middle of each bit. –At the BEGINNING of each bit If you wish to transmit a 0 –Change voltage (high->low or low->high) If you wish to transmit a 1 –No voltage change at beginning.

17 Pros/Cons Manchester Pros: –Clocks always stay in sync because there is a clock signal built into the data. –Highly reliable Used in Ethernet cabling (Manchester Encoding) Cons: –Complex to implement –2 changes per bit means your hardware is working twice as hard.

18 Baud rate Number of signal changes per second –This doesn’t tell you anything about how much data is transmitted! –Manchester encoding uses a baud rate of 2 to transmit 1 bit of data.

19 Bipolar AMI To transmit a 0 send no voltage during a clock cycle. To transmit a 1 send either a +1v or - 1v during a clock cycle. –You send a +1v if you last sent a -1v –You send a -1v if you last sent a +1v Advantage: –Over time, the total voltage transmitted is basically 0. Important in some military applications.

20 4B/5B Digital Encoding Each 4 bit possible value is assigned a unique 5 bit code. –0000 -> 11110 –0001 -> 01001 –0010 -> 10100 –0011 -> 10101 etc. The 5 bit codes are guaranteed to not have more than 2 consecutive 0’s. Now you can use NRZ to send with only a 20% overhead

21 Transmitting Digital Data with Analog Signals A Computer modem for example –3 basic possibilities Use Frequency to encode 1 or 0 –Frequency Shift Keying Use Amplitude to encode 1 or 0 –Amplitude Shift Keying Use Phase to encode 1 or 0 –Phase Shift Keying –To transmit a 1 during a time period you either: Send high amplitude Sent high frequency Send a particular phase shift (90, 180, 270…)

22 Bauds and bits A single baud can be used to transmit more than 1 bit of data. –E.g. (works for frequency/phase too) An amplitude of 0 means you are sending 00 An amplitude of 2 means you are sending 01 An amplitude of 4 means you are sending 10 An amplitude of 6 means you are sending 11 –The more different signals you can transmit in each baud, the more bits you can send at once. Hence a 9600 baud modem can transmit 56kbps

23 Combos You can also use frequency, amplitude and phase key shifting at once. –A 2400 baud modem with 4 bits per signal encoded with amplitude and phase = 9600bps Now very complex encoding schemes have been used to get that to 56k –This is the limit of the regular phone network. –There is 64K of bandwidth available per phone channel, only 56K is even theoretically usable


Download ppt "Day 4 Encoding Data. So… We have analog and digital data, and analog and digital signals. –We can use any combination of the above –Why? Shouldn’t we."

Similar presentations


Ads by Google