0% found this document useful (0 votes)
9 views18 pages

3 Ta Engg2310 Tut11

The document is a tutorial on Error Control Coding, focusing on basic concepts, linear binary block codes, and exercises related to these topics. It covers definitions, error detection and correction capabilities, and provides examples and exercises for understanding binary linear block codes. The tutorial also includes solutions to exercises, illustrating the application of concepts discussed.

Uploaded by

kelkw9121
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views18 pages

3 Ta Engg2310 Tut11

The document is a tutorial on Error Control Coding, focusing on basic concepts, linear binary block codes, and exercises related to these topics. It covers definitions, error detection and correction capabilities, and provides examples and exercises for understanding binary linear block codes. The tutorial also includes solutions to exercises, illustrating the application of concepts discussed.

Uploaded by

kelkw9121
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

IERG2310 Tutorial 11

Xiangyu Zhong

. . . . . .
Xiangyu Zhong (CUHK) IERG2310 Tutorial 11 1 / 12
Outline

Error Control Coding

I Basic Concepts

I Linear Binary Block Code

I Exercises

. . . . . .
Xiangyu Zhong (CUHK) IERG2310 Tutorial 11 2 / 12
Basic Concepts
Error Control Coding
I The coding procedure done to control the occurrences of errors,
including error detection, and/or error correction.

I Basic idea: add redundancy (i.e., extra bits). Or, put another way,
disallow some codewords; if you receive such an invalid codeword,
correct it to the closest valid codeword.

Binary Block Codes


I An (n, k) binary block code contains successive k message bits and
(n − k) check/partiy bits:

I Check bits are computed from the message bits according to the
specific encoding rule.
. . . . . .
Xiangyu Zhong (CUHK) IERG2310 Tutorial 11 3 / 12
Basic concepts

Let C is the set of all valid codewords for an (n, k) binary block code,
and c1 , c2 ∈ C are 2 valid codewords.

Concept Definition
Code Rate k/n
Hamming Distance dH (c1 , c2 ) := |c1 − c2 |
d∗H := min dH (c1 , c2 )
Minimum Distance c1 ̸=c2 ,
c1 ,c2 ∈C

Hamming Weight wH (c) := dH (c, 0)


∗ :=
Minimum Weight wH min wH (c)
c̸=0,
c∈C

. . . . . .
Xiangyu Zhong (CUHK) IERG2310 Tutorial 11 4 / 12
Basic concepts

Table: Error Detection and Correction Capabilities

Description Expression
A code can detect up to d errors
d∗H ≥ d + 1
per codeword if:
A code can correct up to c errors
d∗H ≥ 2c + 1
per codeword if:
A code can detect up to d errors
and correct up to c < d errors per d∗H ≥ d + c + 1
codeword if:

. . . . . .
Xiangyu Zhong (CUHK) IERG2310 Tutorial 11 5 / 12
Linear Binary Block Code

Linearity: Any linear combination of two valid codewords is also an valid


codeword.

The all-zero sequence 0 is always a codeword.

The minimum distance equals the minimum weight, i.e., d∗H = wH



.

Example:
Hamming codes — can detect up to two-bit errors or correct single-bit
errors.
Repetition codes (p.3) and single parity check bit codes (p.2).

. . . . . .
Xiangyu Zhong (CUHK) IERG2310 Tutorial 11 6 / 12
Exercise

Exercise 1:
Consider a binary linear block code of the form:
[d1 d2 d3 p1 p2 p3 ]
where d1 , d2 , d3 are message bits and p1 , p2 , p3 are check bits given by
p1 = d1 + d2 mod 2
p2 = d2 + d3 mod 2
p3 = d1 + d3 mod 2
list out all the codewords.

. . . . . .
Xiangyu Zhong (CUHK) IERG2310 Tutorial 11 7 / 12
Exercise
Exercise 1:
Consider a binary linear block code of the form:
[d1 d2 d3 p1 p2 p3 ]
where d1 , d2 , d3 are message bits and p1 , p2 , p3 are check bits given by
p1 = d1 + d2 mod 2
p2 = d2 + d3 mod 2
p3 = d1 + d3 mod 2
list out all the codewords.

Solution:
[0 0 0 0 0 0], [0 0 1 0 1 1]
[0 1 0 1 1 0], [0 1 1 1 0 1]
[1 0 0 1 0 1], [1 0 1 1 1 0]
[1 1 0 0 1 1], [1 1 1 0 0 0]
. . . . . .
Xiangyu Zhong (CUHK) IERG2310 Tutorial 11 8 / 12
Exercise

Exercise 2:
Consider an (8, 4) binary linear block code with minimum distance of 4.
I How many valid codewords are there?
I What is the code rate?
I What is the minimum weight of the code?
I If the code is used for error detection only, how many errors can it
detect?
I If the code is used for error correction, how many errors can it correct?

. . . . . .
Xiangyu Zhong (CUHK) IERG2310 Tutorial 11 9 / 12
Exercise
Exercise 2:
Consider an (8, 4) binary linear block code with minimum distance of 4.
I How many valid codewords are there?
I What is the code rate?
I What is the minimum weight of the code?
I If the code is used for error detection only, how many errors can it
detect?
I If the code is used for error correction, how many errors can it correct?

Solution:
I 24 = 16.
I 4/8 = 0.5.
∗ ∗
I wH = 4, since wH = d∗H for linear block codes.

I d = 4, by dH ≥ d + 1.
I c = 1, by d∗H ≥ 2c + 1.

. . . . . .
Xiangyu Zhong (CUHK) IERG2310 Tutorial 11 10 / 12
Exercise

Exercise 3:
Consider a binary linear block code of the form:
[d1 d2 p1 p2 p3 ]
where d1 , d2 are message bits and p1 , p2 , p3 are check bits given by
p1 = d1 + d2 mod 2
p2 = d1 mod 2
p3 = d2 mod 2
Get the error detecting and correcting capabilities.

. . . . . .
Xiangyu Zhong (CUHK) IERG2310 Tutorial 11 11 / 12
Exercise
Exercise 3:
Consider a binary linear block code of the form:
[d1 d2 p1 p2 p3 ]
where d1 , d2 are message bits and p1 , p2 , p3 are check bits given by
p1 = d1 + d2 mod 2
p2 = d1 mod 2
p3 = d2 mod 2
Get the error detecting and correcting capabilities.
Solution:
First, we can list all the valid codewords as follows:
[0 0 0 0 0], [0 1 1 0 1]
[1 0 1 1 0], [1 1 0 1 1]

As observed, the minimum weight wH = 3. Since this is a linear block code,
∗ ∗
we have dH = wH = 3.
Thus, the error detection capability is d = 2 and the code correction
capability is c = 1.
. . . . . .
Xiangyu Zhong (CUHK) IERG2310 Tutorial 11 12 / 12
Assignment 5

Xiangyu Zhong (CUHK) ENGG2310 Tutorial 4 13 / 18


Q16

The low-pass signal x(t) with bandwidth W is sampled with a sampling interval of
Ts , and the signal

X
xp (t) = x(nTs )p(t − nTs )
n=−∞

is generated, where p(t) is an arbitrary shaped pulse (not necessarily time-limited


to the interval [0, Ts ]).
(a) Find the Fourier transform of xp (t) in terms of the Fourier transform of p(t),
namely P (f ).
(b) Find the conditions for perfect reconstruction of x(t) from xp (t), and specify
the required reconstruction filter.

Xiangyu Zhong (CUHK) ENGG2310 Tutorial 4 14 / 18


Q17

Consider a quantizer. The output of the quantizer xQ is given by:




 −0.75, x < −0.5

 −0.25, −0.5 ≤ x < 0
xQ =


 0.25, 0 ≤ x < 0.5
0.75, 0.5 ≤ x

The input samples are distributed according to the probability density function:
(
|x|, 0 ≤ x ≤ 1
fX (x) =
0, else

(a) Determine the signal-to-quantization noise ratio (SQNR).


(b) Write a program to determine the optimal quantizer.

Xiangyu Zhong (CUHK) ENGG2310 Tutorial 4 15 / 18


Q17

clear; clc;

% PDF and range


pdf = @(x) abs(x) .* (x >= -1 & x <= 1); % PDF of X (symmetric |x| o
bins = 4; % Number of quantization levels
thresholds = linspace(-1, 1, bins+1); % Initial decision boundaries
delta = 1e-6; diff = 1; % Convergence criteria

while diff > delta


% Step 1: compute centroids (quantization levels)
for i = 1:bins
a = thresholds(i); b = thresholds(i+1);
num(i) = integral(@(x) x .* pdf(x), a, b); % \int x * f_X(x)
den(i) = integral(@(x) pdf(x), a, b); % \int f_X(x) dx
end
q = num ./ den; % Updated quantization levels

Xiangyu Zhong (CUHK) ENGG2310 Tutorial 4 16 / 18


Q17

% Step 2: update thresholds (except for first and last)


new_thresholds = thresholds;
for i = 2:bins
new_thresholds(i) = (q(i-1) + q(i)) / 2;
end

% Convergence check
diff = max(abs(new_thresholds - thresholds));
thresholds = new_thresholds; % Update thresholds
end

% Display results
disp(’Optimal Quantization Levels:’);
disp(q);
disp(’Optimal Decision Boundaries:’);
disp(thresholds);

Xiangyu Zhong (CUHK) ENGG2310 Tutorial 4 17 / 18


Q18

Simulate the sigma-delta modulation with MATLAB according to the following


steps:
Generate the signal x(t) = sin(πt) + 0.5 cos 3πt

1 2
R
2 Generate y(t) = x(t)dt
3 Apply delta modulation to y(t) at a very high sampling rate.
4 Apply 1-bit D/A, i.e., construct a pulse train using the outputs of the delta
modulator.
5 Smooth the resulting signal.

Xiangyu Zhong (CUHK) ENGG2310 Tutorial 4 18 / 18

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy