Upload
thedemonizer-pratik
View
17
Download
3
Embed Size (px)
DESCRIPTION
Data encoding slides data communicationm
Citation preview
Data Communication & Computer Network
Chapter -2Data Encoding
Definition - What does Encoding mean?1. Encoding is the process of converting data into a format
required for a number of information processing needs, including:-Program compiling and execution
-Data transmission, storage and compression/decompression -Application data processing, such as file conversion2.Encoding can have two meanings: In computer technology, encoding is the process of applying a
specific code, such as letters, symbols and numbers, to data for conversion into an equivalent cipher.
In electronics, encoding refers to analog to digital conversion.
Different Conversion Schemes
5
Analog Signals Carrying Analog and Digital Data
6
Digital Signals Carrying Analog and Digital Data
7
Digital to Digital Encoding
Types of Digital to Digital Encoding
04/27/2023 10
Line Coding
DIGITAL DATA INTO DIGITAL SIGNAL
04/27/2023 11
Parameters: Line coding
NO .OF SIGNAL LEVELS: NO OF VALUES ALLOWED IN A SIGNAL TO REPRESENT DATA
04/27/2023 12
Bit rate vs Baud rate
• The bit rate represents the number of bits sent per second, whereas the baud rate defines the number of signal elements per second in the signal.
• Depending on the encoding technique used, baud rate may be more than or less than the bit rate.
04/27/2023 13
DC Component• After line coding, the signal may have zero frequency
component in the spectrum of the signal, which is known as the direct-current (DC) component.
• DC component in a signal is not desirable because the DC component does not pass through some components of a communication system such as a transformer.
• This leads to distortion of the signal and may create error at the output.
• The DC component also results in unwanted energy loss on the line.
04/27/2023 14
04/27/2023 15
• A signal has two data levels with a pulse duration of 1 ms. We calculate the pulse rate and bit rate as follows:
Pulse Rate = 1/ 10-3= 1000 pulses/s
Bit Rate = Pulse Rate x log2 L
= 1000 x log2 2
= 1000 bps
Example 1
04/27/2023 16
Example 2
Pulse Rate = = 1000 pulses/s
Bit Rate = PulseRate x log2 L
= 1000 x log2 4
= 2000 bps
A signal has four data levels with a pulse duration of 1 ms. We calculate the pulse rate and bit rate as follows:
04/27/2023 17
Line Coding Techniques
Unipolar encoding uses only one voltage level.
Note:
04/27/2023 19
Unipolar encoding
Polar encoding uses two voltage levels (positive and negative).
Note:
Types of Polar Encoding
04/27/2023 22
Unipolar • It uses only one polarity
of the voltage level• Bit rate same as baud
rate• DC component present• Loss of synchronization
for longer sequences• Simple but obsolete
04/27/2023 23
NRZ (non return to zero)
• Two voltage levels for binary data• Usually, negative voltage represents one
binary data and positive represents another• Signal level remains same throughout the bit
period• Two schemes of NRZ
– NRZ-L– NRZ-I
04/27/2023 25
NRZ-L
04/27/2023 26
NRZ-I
NRZ-L and NRZ-I Encoding
04/27/2023 28
04/27/2023 29
RZ (Return to Zero)
Three levels Bit rate is double than that of data rate No dc component Good synchronization Main limitation is the increase in bandwidth
3004/27/2023
To ensure synchronization, there must be a signal transition in each bit as shown in Fig.
1: Positive to zero0: Negative to zero
04/27/2023 31
04/27/2023 32
Manchester Coding
In Manchester encoding, the transition at the middle of the bit is
used for both synchronization and bit representation.
Note:
04/27/2023 34
Differential Manchester
In differential Manchester encoding, the transition at the middle of the bit is
used only for synchronization. The bit representation is defined by the
inversion or noninversion at the beginning of the bit.
Note:
Manchester and Diff. Manchester Encoding
In bipolar encoding, we use three levels: positive, zero,
and negative.
Note:
04/27/2023 38
Bipolar encoding
Types of Bipolar Encoding
Bipolar AMI Encoding
B8ZS
• Bipolar With 8 Zeros Substitution• Based on bipolar-AMI• If octet of all zeros and last voltage pulse preceding
was positive encode as 000+-0-+• If octet of all zeros and last voltage pulse preceding
was negative encode as 000-+0+-• Causes two violations of AMI code• Unlikely to occur as a result of noise• Receiver detects and interprets as octet of all zeros
HDB3
• High Density Bipolar 3 Zeros• Based on bipolar-AMI• String of four zeros replaced with one or two
pulses
B8ZS and HDB3
Digital Data, Analog Signal
• Public telephone system– 300Hz to 3400Hz– Use modem (modulator-demodulator)
• Amplitude shift keying (ASK)• Frequency shift keying (FSK)• Phase shift keying (PK)
Figure : Digital-to-analog conversion
Figure : Types of digital-Modulation Techniques
Modulation Techniques
Amplitude Shift Keying (ASK)
• ASK is implemented by changing the amplitude of a carrier signal to reflect amplitude levels in the digital signal.
• For example: a digital “1” could not affect the signal, whereas a digital “0” would, by making it zero.
• The line encoding will determine the values of the analog waveform to reflect the digital data being carried.
Amplitude Shift Keying
• Values represented by different amplitudes of carrier
• Usually, one amplitude is zero– i.e. presence and absence of carrier is used
• Susceptible to sudden gain changes• Inefficient• Up to 1200bps on voice grade lines• Used over optical fiber
Bandwidth of ASK
• The bandwidth B of ASK is proportional to the signal rate S.
B = (1+d)S• “d” is due to modulation and filtering, lies
between 0 and 1.
Figure : Binary amplitude shift keying
Figure : Implementation of binary ASK
Example
We have an available bandwidth of 100 kHz which spans from 200 to 300 kHz. What are the carrier frequency and the bit rate if we modulated our data by using ASK with d = 1?SolutionThe middle of the bandwidth is located at 250 kHz. This means that our carrier frequency can be at fc = 250 kHz. We can use the formula for bandwidth to find the bit rate (with d = 1 and r = 1).
Frequency Shift Keying
• The digital data stream changes the frequency of the carrier signal, fc.
• For example, a “1” could be represented by f1=fc +f, and a “0” could be represented by f2=fc-f.
Frequency Shift Keying
• Values represented by different frequencies (near carrier)
• Less susceptible to error than ASK• Up to 1200bps on voice grade lines• High frequency radio• Even higher frequency on LANs using co-ax
Figure : Binary frequency shift keying
Bandwidth of FSK
• If the difference between the two frequencies (f1 and f2) is 2f, then the required BW B will be:
B = (1+d)xS +2f
Example
We have an available bandwidth of 100 kHz which spans from 200 to 300 kHz. What should be the carrier frequency and the bit rate if we modulated our data by using FSK with d = 1?
SolutionThis problem is similar to Example 5.3, but we are modulating by using FSK. The midpoint of the band is at 250 kHz. We choose 2Δf to be 50 kHz; this means
Figure : Implementation of BFSK
Example
We need to send data 3 bits at a time at a bit rate of 3 Mbps. The carrier frequency is 10 MHz. Calculate the number of levels (different frequencies), the baud rate, and the bandwidth.
SolutionWe can have L = 23 = 8. The baud rate is S = 3 Mbps/3 = 1 Mbaud. This means that the carrier frequencies must be 1 MHz apart (2Δf = 1 MHz). The bandwidth is B = 8 × 1M = 8M.
Figure : Bandwidth of MFSK
Phase Shift Keyeing
• We vary the phase shift of the carrier signal to represent digital data.
• The bandwidth requirement, B is:B = (1+d)xS
• PSK is much more robust than ASK as it is not that vulnerable to noise, which changes amplitude of the signal.
Phase Shift Keying
• Phase of carrier signal is shifted to represent data
• Differential PSK– Phase shifted relative to previous transmission
rather than some reference signal
Figure : Binary phase shift keying
Figure : Implementation of BPSK
Quadrature PSK
• To increase the bit rate, we can code 2 or more bits onto one signal element.
• In QPSK, we parallelize the bit stream so that every two incoming bits are split up and PSK a carrier frequency. One carrier frequency is phase shifted 90o from the other - in quadrature.
• The two PSKed signals are then added to produce one of 4 signal elements. L = 4 here.
Quadrature PSK
• More efficient use by each signal element representing more than one bit– e.g. shifts of /2 (90o)– Each element represents two bits– Can use 8 phase angles and have more than one
amplitude– 9600bps modem use 12 angles , four of which
have two amplitudes
Figure : QPSK and its implementation
Example
Find the bandwidth for a signal transmitting at 12 Mbps for QPSK. The value of d = 0.
SolutionFor QPSK, 2 bits is carried by one signal element. This means that r = 2. So the signal rate (baud rate) is S = N × (1/r) = 6 Mbaud. With a value of d = 0, we have B = S = 6 MHz.
Performance of Digital to Analog Modulation Schemes
• Bandwidth– ASK and PSK bandwidth directly related to bit rate– FSK bandwidth related to data rate for lower
frequencies, but to offset of modulated frequency from carrier at high frequencies
– (See Stallings for math)• In the presence of noise, bit error rate of PSK
and QPSK are about 3dB superior to ASK and FSK
Analog to Digital Encoding
PAM
PAM: Pulse Amplitude Modulation
Pulse amplitude modulation has some applications, but it is not used by itself in data communication. However, it is the first step in another very popular
conversion method called pulse code modulation.
Note:
Quantized PAM signal
Quantizing by using sign and magnitude
PCM
From analog signal to PCM digital code
According to the Nyquist theorem, the sampling rate must be at least 2 times
the highest frequency.
Note:
Nyquist theorem
Example 4
What sampling rate is needed for a signal with a bandwidth of 10,000 Hz (1000 to 11,000 Hz)?
Solution
The sampling rate must be twice the highest frequency in the signal:
Sampling rate = 2 x (11,000) = 22,000 samples/s
Example 5
A signal is sampled. Each sample requires at least 12 levels of precision (+0 to +5 and -0 to -5). How many bits should be sent for each sample?
Solution
We need 4 bits; 1 bit for the sign and 3 bits for the value. A 3-bit value can represent 23 = 8 levels (000 to 111), which is more than what we need. A 2-bit value is not enough since 22 = 4. A 4-bit value is too much because 24 = 16.
Example 6
We want to digitize the human voice. What is the bit rate, assuming 8 bits per sample?
Solution
The human voice normally contains frequencies from 0 to 4000 Hz. Sampling rate = 4000 x 2 = 8000 samples/s
Bit rate = sampling rate x number of bits per sample = 8000 x 8 = 64,000 bps = 64 Kbps
Analog to Analog Modulation
Amplitude Modulation
AM Bandwidth
AM Band Allocation
Frequency Modulation
FM Bandwidth
FM Band Allocation
Transmission Mode
Parallel Transmission
Serial Transmission
Data transmission
Parallel transmission
Serial transmission
In asynchronous transmission, we send 1 start bit (0) at the beginning
and 1 or more stop bits (1s) at the end of each byte. There may be a gap
between each byte.
Note:
Asynchronous transmission
In synchronous transmission, we send bits one after another without
start/stop bits or gaps. It is the responsibility of the receiver to
group the bits.
Note:
Synchronous transmission