Dulranga's Notes

Encoding & Modulation

Difference between encoding & modulation

Encoding means the process of converting RAW data into a format that can be transmitted through some medium. ex:

  • 1s1s and 0s0s of Digital world
  • Morse Code

Modulation means tweaking that signal in a way so it can be transmitted through the medium. ex:

  • If you have to send a signal 5 miles and 5 meters, we have to alter the physical properties such as Frequency, Amplitude etc so the signal does not die when reaching the receiver.
QuestionEncodingModulation
What problem does it solve?"How do I represent my data accurately without errors or confusion?""How do I make this signal physically travel through air, copper, or glass?"
Does it need a Carrier Wave?No. It creates logic pulses, codes, or bit patterns directly.Yes. It must have an existing high-frequency sine wave to modify.
Primary DomainDigital Logic & Data Formatting.Electromagnetic Physics & Signal Processing.
AnalogyTranslating text into Braille or Morse Code.Flashing a searchlight to beam that Morse code across a bay.

Main techniques of Encoding

  1. Digital Data to Digital Signal (Line Encoding)
  2. Digital Data to Analog Signal (Digital Modulation)
  3. Analog Data to Digital Signal (Digitization)
  4. Analog Data to Analog Signal (Analog Modulation)

Polarity of a Scheme

In Signals, polarity is referred to as the sign of "Charge" or "Voltage". ie, direction of the flow. If a voltage level is 0, then it does not have a polarity.

1. Unipolar - One Polarity

In this type, the signal has one voltage direction. +1V→1+1V \to 1 0V→00V \to 0 unipolar-signal.png

2. Polar - Two polarities

In this case, signal move between two polarities. +V→1+V \to 1 −V→0-V \to 0 polar-signal.png

3. Bipolar - Two Polarities + Nuetral

This is similar to #1. Unipolar - One Polarity, So 00 is denoted with no voltage. 0V→00V \to 0 +1V→first 1+1V \to \text{first} \, 1 −1V→second 1-1V \to \text{second} \, 1

bipolar-signal.png

Digital Data to Digital Signal

In this case, 1s1s and 0s0s will be mapped directly from source to signal.

NRZ vs RZ

The naming of these two schemes are defined with the question "Does the signal becomes zero in the middle of an interval?" No -> Non Return to Zero (NRZ) Yes -> Return to Zero (RZ)

In RZ schemes, the signal 1 comes down to zero in the middle of interval even when the next bit is 1.

rz-vs-nrz.png

SchemeMeaningBehavior in Middle of Bit SlotMain AdvantageMain Disadvantage
RZReturn-to-ZeroAlways drops to 0 V0\text{ V} halfway through.Self-synchronizing (built-in clock).Requires double the bandwidth.
NRZNon-Return-to-ZeroStays flat at the voltage level for the full bit period.Efficient bandwidth usage.Synchronization loss on repeated bits.

NRZ-L (Level)

In this scheme, Voltage Levels denote bit state. Unipolar - 1→+V1 \to +V and 0→0V0\to 0V Polar - 1→+V1 \to +V and 0→−V0\to -V

Main Idea is Level = State

nrz-L.png

NRZ-I (Inverted)

In this scheme, Voltage Transition at start of an Interval denotes one bit state. This does not mean transition flip bit state, transition means one bit state and no transition means the other bit state.

Transition -> Bit 11 (low to high OR high to low) No Transition -> Bit 00

Main Idea is Transition = Bit 1

nrz-I.png

Note

Differential Encoding This is a form of encoding where we use "Transition" from a voltage level to represent one bit state. No transition define the other bit state. rather than using levels directly to represent bit states. NRZ-I is a differential encoding.

Benefits of NRZ schemes

  • High use of bandwidth
  • Easy to engineer

Issues of NRZ schemes

  • has DC component
    • This means if a huge sequence of 1s occur in NRZ-L for example, the voltage will be high constant for a long time. resulting in a DC signal.
    • In NRZ-I long sequence of 1s avoid this issue, but still 1000000... will do it.
  • No synchronization
    • RZ schemes avoid this by coming to zero at the middle of interval.

AMI Scheme

AMI - Alternate Mark Inversion, (in early days Mark meant binary 11)

This is a Bipolar scheme. Adjacent 1s1s flip voltage while 00 remains 0v.

bipolar-signal.png

Advantages

  • Main advantage is No DC component as in NRZ, since 1s flip it cancels out over time.
  • Also this has built-in error detection. This signal can never have two consecutive same voltage pulses like +1V after +1V So if it happens it is a violation.

Disadvantages

  • Does not have a synchronization, same as NRZ
  • Long sequence of 0s will fail to detect if signal failure or actual sequence

Pseudoternary

This is basically opposite of AMI. This is also a bipolar signal. Adjacent 0s0s flip voltage while 11 remains 0v No Advantages over AMI

Tradeoffs of Bipolar signals

  • Less efficient than NRZ
  • 3 voltage levels can represent log23=1.58log_2{3}=1.58 bits
  • receiver have to distinguish 3 levels

Biphase Signals

These are Special type of Polar Schemes.

  • Has two voltage levels
    • positive one & negative one
  • Has a Mandatory transition in the exact middle of each interval

These are different from RZ schemes (which also have a transition to zero at middle) because RZ uses three levels sometimes.

Manchester

This is a biphase scheme. Transition at middle servers as BOTH clock and data.

Low to High →1\to 1 High to Low →0\to 0

Used by IEEE 802.3

manchester.png

Differential Manchester

This is a differential biphase scheme. Transition at the start define data. Transition at middle is for clock only.

Transition at start →0\to 0 No transition at start →1\to 1

Used by IEEE 802.5

diff-manchester.png

Advantages of BiPhase schemes

  • Built-in synchronization
  • Error detection
    • Missing clock pulse in middle means error
  • No DC component in the long average

Cons of Biphase schemes

  • Transitions per interval is minimum 1 and max 2
  • Modulation rate is twice as NRZ
  • More bandwidth needed

Digital Data to Analog Signal

In these we represent digital 00 and 11 states using analog properties (Amplitude, Phase, Frequency)

  1. Amplitude Shift Keying (ASK)
  2. Frequency Shift Keying (FSK)
  3. Phase Shift Keying (PSK)
    • Using phase to denote bit, or differential schemes where transition denote one bit

analog-signal.png

BFSK means binary frequency shift keying. only two frequencies used.

Multiple FSK

This is where Analog transmission shines. You can use multiple frequencies which can result in transmitting more than just a bit at a time. These are more bandwidth efficient.

Duplex Transmission

two different range of frequencies used by each party. Which will reduce interference of the signals in voice lines.

duplex-transmission.png

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

Analog Data to Digital Signal

  • AKA Digitization

Transforms Continuous signals such as Distance, Temperature, sound waves into quantized digital units. This is essential for any computations to be done using those.

Sampling (Time Discretization)

This is just slicing the signal nn times per second, we get a discrete set of values from the continuous signal. This is known as the sampling rate/frequency (fsf_s) Usually done at same time interval (TsT_s), fs=1/Tsf_s = 1/T_s

Nyquist Theorem States that to capture a signal without distortions, we must sample it at least as twice frequency than the max frequency in the signal itself.

sampling.png

Quantization (Amplitude Discretization)

This is defining different digital states (aka voltage levels) so each signal value can be stored. Using NN bits, we can define 2N2^N states.

quantization.png

Binary Mapping

This is assigning binary values for each state.

Pulse code Modulation

Telephony (G.711)CD AudioHigh-Res Audio
Sampling Rate (fsf_s)8 kHz44.1 kHz96 kHz
Bit Depth (nn)8 bits16 bits24 bits
Bit Rate (Rb=n⋅fsR_b = n \cdot f_s)64 kbps705.6 kbps (per channel)2,304 kbps (per channel)
![[pcm.png]]

Analog Data to Analog Signals

TODO

On this page