Lab 4

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

______________________________________________________________________

TITLE : Correlation and Orthogonality

DATE OF
: 31 st Oct, 2022
EXPERIMENT

Lab Number : 4

NAME : ___Syeda Armish Subzwari___


___Asad Iqbal___
__Abdul Jabbar _

ROLL NO : __200401074____
__200401033____
__200401024____

Instructor : _Ma’am Saniya Zafar_

Communication Systems Lab Page 1


______________________________________________________________________

 Objective:
In this lab, we will learn to conduct simulation in Simulink/MATLAB to understand
the concepts of:
1. Correlation and its applications in communication systems.
2. Orthogonality and its application in communication systems.

 Introduction:
 Correlation of Signals
Correlation between signals indicates the measure up to which the given signal resembles
another signal. In other words, if we want to know how much similarity exists between the
signal 1 and signal 2, then we need to find out the correlation of signal 1 with respect to signal
2 or vice versa. Mathematically, correlation values lie between −1 and +1 where +1 is for
maximum correlation.
In autocorrelation, the given signal is correlated with itself, usually the time-shifted version
of itself. Mathematical expression for the autocorrelation of continuous time signal 𝑥(𝑡) is
given by
𝑅𝑥𝑥 (𝜏 ) = ∞
∫ 𝑥(𝑡)𝑥 ∗ (𝑡 − 𝜏)𝑑𝑡 ,
−∞
where ∗ denotes the complex conjugate.
In cross-correlation, the signal in-hand is correlated with another signal to know how much
resemblance exists between them. Mathematical expression for the cross-correlation of
continuous time signals 𝑥(𝑡) and 𝑦(𝑡) is given by:


𝑅𝑥𝑦 (𝜏 ) = ∫ 𝑥 (𝑡)𝑦 ∗ (𝑡 − 𝜏 )𝑑𝑡 .
−∞

• Orthogonality of Signals:
Two signals are orthogonal to each other when their inner product (also called the dot
product) is zero. Mathematically two continuous time signals 𝑥(𝑡) and 𝑦(𝑡) are orthogonal
when:

∫ 𝑥(𝑡) 𝑦(𝑡)𝑑𝑡 = 0,
−∞
A close resemblance can be observed between correlation equations and orthogonality
conditions Thus, signals that are orthogonal are uncorrelated and vice versa. An
important characteristic of signals that are orthogonal (i.e., uncorrelated) is that when they are
combined or added together, they do not interact with one another. Orthogonality is not
limited to just two signals. Whole families exist where each signal is orthogonal to all other
members in the family. Such families of orthogonal signals are called “orthogonal sets”.
 Lab Performance:
 Task 1:
In this task, you will test two applications of correlation in a RADAR communication system
that works by transmitting a signal from its transmitting antenna. The radio waves travel
outward from the antenna and keep going until they hit something. Then some of these waves
bounce back toward the antenna in a beam of reflected radio waves. At RADAR, the
transmitted and reflected waves are compared (CORRELATED) to compute distance between
transmitter and receiver.
Communication Systems Lab Page 2
______________________________________________________________________

• Results:

Communication Systems Lab Page 3


______________________________________________________________________

 Here we can see auto and cross correlation. The time can be determined as
100 units.
 Recovering a Noisy Signal:

clc
clear all
close all
% Transmitted Signal
t=1:400;
x_t=[ones(1,100),zeros(1,50),-
1*ones(1,100),zeros(1,150)];
plot(t,x_t), grid on
% Received Signal
noise=awgn(x_t,10);
x_r=x_t+noise;
figure(1)
subplot(2,1,1)
plot(t,x_r), grid on
% Auto and cross-correlations
[crossCorr_x_tx_r,lag12]=xcorr(x_t,x_r);
% Correlation plots
subplot(2,1,2);
plot(lag12,crossCorr_x_tx_r);
% Received Signal
noise1=awgn(x_t,5);

Communication Systems Lab Page 4


______________________________________________________________________

x_r1=x_t+noise1;
figure(2)
subplot(2,1,1)
plot(t,x_r1), grid on
% Auto and cross-correlations
[crossCorr_x_tx_r1,lag12]=xcorr(x_t,x_r1);
% Correlation plots
subplot(2,1,2);
plot(lag12,crossCorr_x_tx_r1);
% Received Signal
noise2=awgn(x_t,1);
x_r2=x_t+noise2;
figure(3)
subplot(2,1,1)
plot(t,x_r2), grid on
% Auto and cross-correlations
[crossCorr_x_tx_r2,lag12]=xcorr(x_t,x_r2);
% Correlation plots
subplot(2,1,2);
plot(lag12,crossCorr_x_tx_r2);

 SNR=10

Communication Systems Lab Page 5


______________________________________________________________________

 SNR=5

 SNR=1

Communication Systems Lab Page 6


______________________________________________________________________

 Task 2:

 Experiments:

Observations:
When plotting the random noise signal, we observed that every time we run the code random
N noise signals are generated between 0 to 100 with mean 0 and variance 16.5. By using
Communication Systems Lab Page 7
______________________________________________________________________

variance output returns an array of local k -point variance values, where each variance is
calculated over a sliding window of length k across neighboring elements of A.

1. For the model developed in tutorial #4.4, add Band-limited White Noise to the symbols-to-be-
transmitted (i.e. after the symbols get multiplied with their respective orthogonal signal). Set the
noise power to be 0.01 to 0.5 in 10 steps and your transmitted symbols to be [𝑠 0 − 𝑠]. Further,
set the Sample time: 1e-2 and Seed: 0. Record your results (received symbols) versus noise
power in tabular form. (Set 𝑠 to be the sum of last two digits of your registration number.)

 S=3+3=6

 Observations:

Communication Systems Lab Page 8


______________________________________________________________________

Sr. No Noise Power Received signal Received Received


1 signal 2 signal 3
1 0.01 6.056 -0.071 -6.016
2 0.05 6.198 -0.191 -6.011
3 0.10 6.201 -0.242 -6.015
4 0.15 6.395 -0.244 -6.018
5 0.20 6.432 -0.291 -6.021
6 0.25 6.499 -0.301 -6.025
7 0.30 6.574 -0.362 -6.029
8 0.35 6.625 -0.417 -6.033
9 0.45 6.732 -0.451 -6.036
10 0.50 6.882 -0.493 -6.041

 Conclusions:
From this lab report we conclude that with the help of MATLAB, we can correlate the
signals (auto and cross). We have analyzed the concept of orthogonality by applying
them on certain signals using Simulink.

/////////////////////////////////////////// The End///////////////////////////////////////

Communication Systems Lab Page 9

You might also like