0% found this document useful (0 votes)
82 views6 pages

Mid Term Project Submission Course: Data Communication (H) : Submitted by

The document is a mid-term project submission for a data communication course. It includes code for generating and analyzing signals in MATLAB. The code defines three signals with different frequencies and amplitudes, combines them into a composite signal, and performs a Fourier transform. It then defines noise and adds it to the signal to analyze SNR, THD, and bandwidth with and without noise. It calculates the channel capacity and maximum data rate based on the SNR.

Uploaded by

Mahi
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)
82 views6 pages

Mid Term Project Submission Course: Data Communication (H) : Submitted by

The document is a mid-term project submission for a data communication course. It includes code for generating and analyzing signals in MATLAB. The code defines three signals with different frequencies and amplitudes, combines them into a composite signal, and performs a Fourier transform. It then defines noise and adds it to the signal to analyze SNR, THD, and bandwidth with and without noise. It calculates the channel capacity and maximum data rate based on the SNR.

Uploaded by

Mahi
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/ 6

Mid Term Project Submission

Course: Data Communication [H]


SUMMER 2019-20

Submitted by:
Name ID
MAINUL ISLAM MAHI 18-38468-2

Marks Distribution:

Software Skill (Total Mark:20)


Level (10-6) Level (5-2) Level (1) Secured
Objectives
(Completely Attained) (Somewhat Attained) (Not Attained) Marks

Objectives are satisfied at


MATLAB Only few objectives are
All objectives are satisfied. major
Coding satisfied.
extent.

Objectives are satisfied at


Only few objectives are
Result All objectives are satisfied. major
satisfied.
extent.
Performance (Total Mark:20)

Level (20-15) Level (6-14) Level (1-5) Secured


Name
(Completely Attained) (Somewhat Attained) (Not Attained) Marks
Capable to do the analysis
Capable to do the analysis Not capable to do the
*Write Name but cannot develop full
independently analysis at all
model
CODE:

%question1

%18-38468-2
%AB-CDEFG-H

clc;
clear;
fs = 1000;
FREQ1 = 183;
FREQ2 = 384;
FREQ3 = 468;
AMP1 = 38;
AMP2 = 84;
AMP3=46;
%Define signal
t = 0:1/fs:1-1/fs;
deg1=deg2rad(30);
deg2=deg2rad(60);
x1 = AMP1*cos(2*pi*FREQ1*t); % First Signal
x2 = AMP2*cos(2*pi*FREQ2*t+deg1); % Second Signal
x3 = AMP3*cos(2*pi*FREQ3*t+deg2); % Third Signal
cx = x1+x2+x3;
%Plot to illustrate that it is a cosine wave
subplot(5,1,1);
plot(t, x1);
title('Input signal');
xlabel('Time (s)');
ylabel('amplitude');
subplot(5,1,2);
plot(t, x2);
title('Input signal');
xlabel('Time (s)');
ylabel('amplitude');
subplot(5,1,3);
plot(t, x3);
title('Input signal');
xlabel('Time (s)');
ylabel('amplitude');
subplot(5,1,4);
plot(t, cx);
title('Composite signal');
xlabel('Time (s)');
ylabel('amplitude');

%FourierTransform
fcx=fftshift(fcx)/(fs/2);
f = fs/2*linspace(-1,1,fs);
figure;
length(fcx);
fcx_mag=abs(fcx);
subplot(5,1,5);
plot(fcx_mag);
title('Time Domain');
axis([-1000 1500 0 100])
xlabel('Frequency (Hz)');
ylabel('magnitude');
RESULT:
%question3, 4

%18-38468-2
%AB-CDEFG-H

clear;
clc;
FREQ1 = 183;
FREQ2 = 384;
FREQ3 = 468;
AMP1 = 38;
AMP2 = 84;
AMP3=46;
fs1=10000;
t=0:1/fs1:0.001;
deg1=deg2rad(30);
deg2=deg2rad(60);
x1=AMP1*sin(2*pi*FREQ1*t);
x2=AMP2*sin(2*pi*FREQ2*t+deg1);
x3=AMP3*sin(2*pi*FREQ3*t+deg2);
cx=x1+x2+x3;
A = 1;
a=0.1;
powfund = A^2/2;

powharm = a^2/2;
varnoise = a^2;
noise = a*randn(size(cx));

noisySignal = cx + noise;
bandwidth_with=obw(noisySignal,fs1);
SNR = snr(noisySignal);

defSNR = 10*log10(powfund/varnoise);

THD = thd(noisySignal);
defTHD = 10*log10(powharm/a);

SINAD = sinad(cx);

SNR = snr(cx);
bandwidth_with = obw(noisySignal,fs1);
bandwidth_without = obw(cx,fs1);
C = bandwidth_without*log2(1+SNR); % Capacity of the
channel
L=2^(C/(2*bandwidth_without));
output =[bandwidth_with bandwidth_without;C L;SNR SINAD];

RESULT:

You might also like