Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
24 views4 pages

Data Comm EXP 3 Student Manual

Uploaded by

tanzeer evan
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)
24 views4 pages

Data Comm EXP 3 Student Manual

Uploaded by

tanzeer evan
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/ 4

Experiment 3 Student’s Manual

American International University- Bangladesh


Department of Electrical and Electronic Engineering
COE 3201: Data Communication Laboratory

Title: Study of Nyquist bit rate and Shannon capacity using MATLAB

Abstract:
This experiment is designed to-

1.To understand the use of MATLAB for solving communication engineering problems.
2.To develop understanding of Nyquist bit rate and Shannon capacity using MATLAB.

Introduction:
I. Nyquist Bit Rate: The Nyquist bit rate formula defines the theoretical maximum bit
rate for a noiseless channel.

𝐵𝑖𝑡𝑅𝑎𝑡𝑒 = 2 × 𝑏𝑎𝑛𝑑𝑤𝑖𝑑𝑡ℎ × 𝑙𝑜𝑔2 𝐿

In this formula, bandwidth is the bandwidth of the channel, L is the number of signal
levels used to represent data, and BitRate is the bit rate in bits per second.

II. Shannon capacity: Shannon capacity formula was introduced to determine the
theoretical highest data rate for a noisy channel:

𝐶𝑎𝑝𝑎𝑐𝑖𝑡𝑦 = 𝑏𝑎𝑛𝑑𝑤𝑖𝑑𝑡ℎ × 𝑙𝑜𝑔2 (1 + 𝑆𝑁𝑅)

In this formula, bandwidth is the bandwidth of the channel, SNR is the signal-to-noise
ratio, and capacity is the capacity of the channel in bits per second.

Signal-to-noise ratio (SNR): To find the theoretical bit rate limit, we need to know
the ratio of the signal power to the noise power. The signal-to-noise ratio is defined as

𝐴𝑣𝑒𝑟𝑎𝑔𝑒 𝑆𝑖𝑔𝑛𝑎𝑙 𝑃𝑜𝑤𝑒𝑟


𝑆𝑁𝑅 =
𝐴𝑣𝑒𝑟𝑎𝑔𝑒 𝑁𝑜𝑖𝑠𝑒 𝑃𝑜𝑤𝑒𝑟

We need to consider the average signal power and the average noise power because
these may change with time.
A high SNR means the signal is less corrupted by noise; a low SNR means the signal
is more corrupted by noise.

© Dept. of COE, Faculty of Engineering, American International University-Bangladesh (AIUB)


Experiment 3 Student’s Manual

Fig: Two cases of SNR: a high SNR and a low SNR

Because SNR is the ratio of two powers, it is often described in decibel units,
SNRdB, defined as

𝑆𝑁𝑅𝑑𝐵 = 10𝑙𝑜𝑔10 (𝑆𝑁𝑅)

Example of Nyquist bit rate calculation for a noiseless channel:

close all;
clc;
fs = 8000; % Sampling frequency
t = 0:1/fs:1-1/fs; % Time duration
cx = 1.1*sin(2*pi*100*t) + 1.3*cos(2*pi*300*t) +
1.5*sin(2*pi*2000*t);
bandwidth = obw(cx,fs); % Bandwidth of the signal
L=2; % Level of the signal
BitRate = 2*bandwidth*log2(L)

Output:
BitRate =

3.8019e+03

© Dept. of COE, Faculty of Engineering, American International University-Bangladesh (AIUB)


Experiment 3 Student’s Manual

Example: Calculation of SNR

close all;
clc;
%Define number of samples to take
fs = 8000; % Sampling frequency
f = 400; %Hz
%Define signal
t = 0:1/fs:1-1/fs;
A = 3.0;
powfund = A^2/2
s = 0.1;
varnoise = s^2;
signal = A*sin(2*pi*f*t);
%noise
noise = s*randn(size(signal));
%noisy signal
noisySignal = signal + noise;
SNR = snr(noisySignal) %Calculation of SNR using snr
function

defSNR = 10*log10(powfund/varnoise) %Calculation of


SNR following the definition

SNR =

26.2571

defSNR =

26.5321

Similar task can be done considering a noisy composite signal. Suppose our composite signal is,

signal = 1.5*sin(2*pi*2*t)+0.9*cos(2*pi*10*t)+1.1*sin(2*pi*20*t) + 0.13*randn(size(t));

*****Calculate the SNR value of the signal.

© Dept. of COE, Faculty of Engineering, American International University-Bangladesh (AIUB)


Experiment 3 Student’s Manual

Example of Shannon capacity calculation for a noisy channel:


clc
close all
fs = 8000; % Sampling frequency
f = 3; %Hz
%Define signal
t = 0:1/fs:1-1/fs;
A = 2;
s = 0.4;
%signal
x = A*sin(2*pi*f*t);
%noise
ns = s*randn(size(signal));
S_N_R = snr(x,ns);

bandwidth = obw(x,fs); % Bandwidth of the signal


%capacity
C = bandwidth*log2(1+SNR) % Capacity of the channel

C=

6.6576e+04

Performance Task for Lab Report: (your ID = AB-CDEFG-H)

**Generate a composite signal using two simple signals as,

x = A1 sin(2π((C+D+H)*100)t ) + A2 cos(2π((D+E+H)*100)t) + s*randn(size(t));

(a) Select the value of the amplitudes as follows: let A1 = (A+B+H), A2 = (B+C+H) and s =
(C+D+H)/30

(b) Calculate the SNR value of the composite signal.

(c) Find the bandwidth of the signal and calculate the maximum capacity of the channel.

(d) What will be the signal level to achieve the data rate?

© Dept. of COE, Faculty of Engineering, American International University-Bangladesh (AIUB)

You might also like