SlideShare a Scribd company logo
Experiment No: 02
Experiment Name: Write a simple Matlab program to perform correlation of two signals:
1) Cross correlation
2) Auto correlation
Objectives:
 To learn about Cross and Auto Correlation.
 To learn about how to perform correlation using Matlab code.
Theory:
Correlation:
Correlation is a measure f similarity between two signals. The general formula for correlation is
∫ 𝒙𝟏(𝒕)𝒙𝟐(𝒕 − 𝝉)𝒅𝒕
∞
−∞
Cross correlation:
Cross correlation is a measure of similarity of two series as a function of the lag of one relative to the
other.
Auto correlation:
Autocorrelation is a mathematical representation of the degree of similarity between a given time
series and a lagged version of itself over successive time intervals
Auto Correlation Code:
clear all;
close all;
clc;
x=[1 2 3]
y=input('Initial position ');
yy=input('Initial position of 2nd signal ');
k=[];
m=length(x);
p=(y-1)*-1;
d=1;
for i= p:1:(m-y)
k (d)=i;
d=d+1;
k
end
figure (1)
subplot(3,1,1);
stem(k,x,'g','LineWidth',3);
title('Discrete Signal represntation ');
xlabel('Time(t) ');
ylabel('x(n)');
xx=[3 2 1]
kk=[];
mm=length(xx);
pp=(yy-1)*-1;
dd=1;
for ii= pp:1:(mm-yy)
kk (dd)=ii;
dd=dd+1;
kk
end
figure (1)
subplot(3,1,2);
r=[];
r=xcorr(xx,x);
stem(kk,xx,'g','LineWidth',3);
lx=m+mm-1;
rx=p+pp;
cx=[];
g=1;
for i=1:1:lx
cx(g)=rx;
rx=rx+1;
g=g+1;
end
cx
g
figure (2);
stem(cx,r,'g','LineWidth',3);
Input Signals:
1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3
0
2
4
Discrete Signal represntation
Time(t)
x(n)
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
0
2
4
Output Signal (Auto Correlated Signal):
Cross Correlation code
clear all;
close all;
m = input('length');
for i=1:m
x(i)=input('value');
end
p=input('initial');
n=input('length');
for i=1:m
y(i)=input('value');
end
q=input('initial');
l=m+n-1;
pp=-(p-1);
qq=-(q-1);
lower=pp+qq;
for i=1:1:1
rr(i)=lower;
lower=lower+1;
end
for i=1:1:1
if i<=m
x(i)=x(i);
else
1 1.5 2 2.5 3 3.5 4 4.5 5
0
2
4
6
8
10
12
x(i)=0;
end
end
for i=1:1:1
if i<=n
y(i)=y(i);
else
y(i)=0;
end
end
for j=1:1:1
p1=0;
q1=j;
for i=1:1:j
p1=p1+x(q1)*y(i);
q1=q1-1;
end
r(i)=p1;
end
stem(rr,r)
Input Output
Length 4
value1
value2
value3
value4
initial 1
length 4
value4
value3
value2
value1
initial 4
Comments: From this lab we know about Cross and Auto correlation and know how to implement these
correlations into Matlab code. This knowledge will help us in further lab work. This lab helps us to clear
our idea about correlation
-4 -3.8 -3.6 -3.4 -3.2 -3 -2.8 -2.6 -2.4 -2.2 -2
0
0.5
1
1.5
2
2.5
3
3.5
4

More Related Content

What's hot

BCH Codes
BCH CodesBCH Codes
BCH Codes
AakankshaR
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
Rishabh Soni
 
Randomized Algorithm- Advanced Algorithm
Randomized Algorithm- Advanced AlgorithmRandomized Algorithm- Advanced Algorithm
Randomized Algorithm- Advanced Algorithm
Mahbubur Rahman
 
error control coding
error control coding error control coding
error control coding
Suhad Malayshi
 
Branch and bound technique
Branch and bound techniqueBranch and bound technique
Branch and bound technique
ishmecse13
 
20181204i mlse discussions
20181204i mlse discussions20181204i mlse discussions
20181204i mlse discussions
Hiroshi Maruyama
 
Asymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using CAsymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using C
Meghaj Mallick
 
Encoding in sc
Encoding in scEncoding in sc
Encoding in sc
rajshreemuthiah
 
Linear block code
Linear block codeLinear block code
Linear block code
Manish Srivastava
 
parallelizing Trapezoidal rule
parallelizing Trapezoidal rule parallelizing Trapezoidal rule
parallelizing Trapezoidal rule
zainab mohammed
 
Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysis
Nisha Soms
 
Parallel algorithms
Parallel algorithmsParallel algorithms
Parallel algorithms
guest084d20
 
Information Theory and Coding Question Bank
Information Theory and Coding Question BankInformation Theory and Coding Question Bank
Information Theory and Coding Question Bank
miraclebabu
 
Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...
Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...
Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...
Madhumita Tamhane
 
Parallel algorithms
Parallel algorithms Parallel algorithms
Parallel algorithms
Dr Shashikant Athawale
 
#1 designandanalysis of algo
#1 designandanalysis of algo#1 designandanalysis of algo
#1 designandanalysis of algo
Brijida Charizma Ardoña-Navarro
 
Randomized algorithm min cut problem and its solution using karger's algorithm
Randomized algorithm min cut problem and its solution using karger's algorithmRandomized algorithm min cut problem and its solution using karger's algorithm
Randomized algorithm min cut problem and its solution using karger's algorithm
Gaurang Savaliya
 
Error Control coding
Error Control codingError Control coding
Error Control coding
Dr Naim R Kidwai
 
Daa notes 2
Daa notes 2Daa notes 2
Daa notes 2
smruti sarangi
 
09 bsc-17 dsp lab 10-1
09 bsc-17 dsp lab 10-109 bsc-17 dsp lab 10-1
09 bsc-17 dsp lab 10-1
Jannat41
 

What's hot (20)

BCH Codes
BCH CodesBCH Codes
BCH Codes
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
 
Randomized Algorithm- Advanced Algorithm
Randomized Algorithm- Advanced AlgorithmRandomized Algorithm- Advanced Algorithm
Randomized Algorithm- Advanced Algorithm
 
error control coding
error control coding error control coding
error control coding
 
Branch and bound technique
Branch and bound techniqueBranch and bound technique
Branch and bound technique
 
20181204i mlse discussions
20181204i mlse discussions20181204i mlse discussions
20181204i mlse discussions
 
Asymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using CAsymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using C
 
Encoding in sc
Encoding in scEncoding in sc
Encoding in sc
 
Linear block code
Linear block codeLinear block code
Linear block code
 
parallelizing Trapezoidal rule
parallelizing Trapezoidal rule parallelizing Trapezoidal rule
parallelizing Trapezoidal rule
 
Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysis
 
Parallel algorithms
Parallel algorithmsParallel algorithms
Parallel algorithms
 
Information Theory and Coding Question Bank
Information Theory and Coding Question BankInformation Theory and Coding Question Bank
Information Theory and Coding Question Bank
 
Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...
Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...
Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...
 
Parallel algorithms
Parallel algorithms Parallel algorithms
Parallel algorithms
 
#1 designandanalysis of algo
#1 designandanalysis of algo#1 designandanalysis of algo
#1 designandanalysis of algo
 
Randomized algorithm min cut problem and its solution using karger's algorithm
Randomized algorithm min cut problem and its solution using karger's algorithmRandomized algorithm min cut problem and its solution using karger's algorithm
Randomized algorithm min cut problem and its solution using karger's algorithm
 
Error Control coding
Error Control codingError Control coding
Error Control coding
 
Daa notes 2
Daa notes 2Daa notes 2
Daa notes 2
 
09 bsc-17 dsp lab 10-1
09 bsc-17 dsp lab 10-109 bsc-17 dsp lab 10-1
09 bsc-17 dsp lab 10-1
 

Viewers also liked

opnet lab report
opnet lab reportopnet lab report
opnet lab report
Sadia Shachi
 
Laboratory manual
Laboratory manualLaboratory manual
Laboratory manual
Asif Rana
 
Monte Carlo Simulation Of Heston Model In Matlab(1)
Monte Carlo Simulation Of Heston Model In Matlab(1)Monte Carlo Simulation Of Heston Model In Matlab(1)
Monte Carlo Simulation Of Heston Model In Matlab(1)
Amir Kheirollah
 
Ch9 failure mechanisms
Ch9 failure mechanismsCh9 failure mechanisms
Ch9 failure mechanisms
dhyun
 
Intro matlab and convolution islam
Intro matlab and convolution islamIntro matlab and convolution islam
Intro matlab and convolution islam
Islam Alabbasy
 
Introduction to Digital Image Processing Using MATLAB
Introduction to Digital Image Processing Using MATLABIntroduction to Digital Image Processing Using MATLAB
Introduction to Digital Image Processing Using MATLAB
Ray Phan
 

Viewers also liked (6)

opnet lab report
opnet lab reportopnet lab report
opnet lab report
 
Laboratory manual
Laboratory manualLaboratory manual
Laboratory manual
 
Monte Carlo Simulation Of Heston Model In Matlab(1)
Monte Carlo Simulation Of Heston Model In Matlab(1)Monte Carlo Simulation Of Heston Model In Matlab(1)
Monte Carlo Simulation Of Heston Model In Matlab(1)
 
Ch9 failure mechanisms
Ch9 failure mechanismsCh9 failure mechanisms
Ch9 failure mechanisms
 
Intro matlab and convolution islam
Intro matlab and convolution islamIntro matlab and convolution islam
Intro matlab and convolution islam
 
Introduction to Digital Image Processing Using MATLAB
Introduction to Digital Image Processing Using MATLABIntroduction to Digital Image Processing Using MATLAB
Introduction to Digital Image Processing Using MATLAB
 

Similar to Correlation

Dsp file
Dsp fileDsp file
Dsp file
Rakesh Thakur
 
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
Ravikiran A
 
Software Metrics
Software MetricsSoftware Metrics
Software Metrics
Ehsan Hessami
 
BS LAB Manual (1).pdf
BS LAB Manual  (1).pdfBS LAB Manual  (1).pdf
BS LAB Manual (1).pdf
ssuser476810
 
State-Space Realizations Using Control Canonical Form and Simulation Diagram
State-Space Realizations Using Control Canonical Form and Simulation DiagramState-Space Realizations Using Control Canonical Form and Simulation Diagram
State-Space Realizations Using Control Canonical Form and Simulation Diagram
MIbrar4
 
report
reportreport
report
murali vnv
 
Reed_Solomon_Implementation
Reed_Solomon_ImplementationReed_Solomon_Implementation
Reed_Solomon_Implementation
ramya c b
 
01 - DAA - PPT.pptx
01 - DAA - PPT.pptx01 - DAA - PPT.pptx
01 - DAA - PPT.pptx
KokilaK25
 
MESSAGE EMBEDDED CIPHER USING 2-D CHAOTIC MAP
MESSAGE EMBEDDED CIPHER USING 2-D CHAOTIC MAPMESSAGE EMBEDDED CIPHER USING 2-D CHAOTIC MAP
MESSAGE EMBEDDED CIPHER USING 2-D CHAOTIC MAP
ijccmsjournal
 
Message Embedded Cipher Using 2-D Chaotic Map
Message Embedded Cipher Using 2-D Chaotic MapMessage Embedded Cipher Using 2-D Chaotic Map
Message Embedded Cipher Using 2-D Chaotic Map
ijccmsjournal
 
Linear regression [Theory and Application (In physics point of view) using py...
Linear regression [Theory and Application (In physics point of view) using py...Linear regression [Theory and Application (In physics point of view) using py...
Linear regression [Theory and Application (In physics point of view) using py...
ANIRBANMAJUMDAR18
 
BLIND SIGNATURE SCHEME BASED ON CHEBYSHEV POLYNOMIALS
BLIND SIGNATURE SCHEME BASED ON CHEBYSHEV POLYNOMIALSBLIND SIGNATURE SCHEME BASED ON CHEBYSHEV POLYNOMIALS
BLIND SIGNATURE SCHEME BASED ON CHEBYSHEV POLYNOMIALS
IJNSA Journal
 
Convolution&Correlation
Convolution&CorrelationConvolution&Correlation
Convolution&Correlation
VenkateshPrasadV1
 
Neural Networks - How do they work?
Neural Networks - How do they work?Neural Networks - How do they work?
Neural Networks - How do they work?
Accubits Technologies
 
A Signature Algorithm Based On Chaotic Maps And Factoring Problems
A Signature Algorithm Based On Chaotic Maps And Factoring ProblemsA Signature Algorithm Based On Chaotic Maps And Factoring Problems
A Signature Algorithm Based On Chaotic Maps And Factoring Problems
Sandra Long
 
Matlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingMatlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processing
Dr. Manjunatha. P
 
Paper computer
Paper computerPaper computer
Paper computer
bikram ...
 
Paper computer
Paper computerPaper computer
Paper computer
bikram ...
 
Dsp lab manual
Dsp lab manualDsp lab manual
Dsp lab manual
Mukul Mohal
 
Parametric time domain system identification of a mass spring-damper
Parametric time domain system identification of a mass spring-damperParametric time domain system identification of a mass spring-damper
Parametric time domain system identification of a mass spring-damper
MidoOoz
 

Similar to Correlation (20)

Dsp file
Dsp fileDsp file
Dsp file
 
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
 
Software Metrics
Software MetricsSoftware Metrics
Software Metrics
 
BS LAB Manual (1).pdf
BS LAB Manual  (1).pdfBS LAB Manual  (1).pdf
BS LAB Manual (1).pdf
 
State-Space Realizations Using Control Canonical Form and Simulation Diagram
State-Space Realizations Using Control Canonical Form and Simulation DiagramState-Space Realizations Using Control Canonical Form and Simulation Diagram
State-Space Realizations Using Control Canonical Form and Simulation Diagram
 
report
reportreport
report
 
Reed_Solomon_Implementation
Reed_Solomon_ImplementationReed_Solomon_Implementation
Reed_Solomon_Implementation
 
01 - DAA - PPT.pptx
01 - DAA - PPT.pptx01 - DAA - PPT.pptx
01 - DAA - PPT.pptx
 
MESSAGE EMBEDDED CIPHER USING 2-D CHAOTIC MAP
MESSAGE EMBEDDED CIPHER USING 2-D CHAOTIC MAPMESSAGE EMBEDDED CIPHER USING 2-D CHAOTIC MAP
MESSAGE EMBEDDED CIPHER USING 2-D CHAOTIC MAP
 
Message Embedded Cipher Using 2-D Chaotic Map
Message Embedded Cipher Using 2-D Chaotic MapMessage Embedded Cipher Using 2-D Chaotic Map
Message Embedded Cipher Using 2-D Chaotic Map
 
Linear regression [Theory and Application (In physics point of view) using py...
Linear regression [Theory and Application (In physics point of view) using py...Linear regression [Theory and Application (In physics point of view) using py...
Linear regression [Theory and Application (In physics point of view) using py...
 
BLIND SIGNATURE SCHEME BASED ON CHEBYSHEV POLYNOMIALS
BLIND SIGNATURE SCHEME BASED ON CHEBYSHEV POLYNOMIALSBLIND SIGNATURE SCHEME BASED ON CHEBYSHEV POLYNOMIALS
BLIND SIGNATURE SCHEME BASED ON CHEBYSHEV POLYNOMIALS
 
Convolution&Correlation
Convolution&CorrelationConvolution&Correlation
Convolution&Correlation
 
Neural Networks - How do they work?
Neural Networks - How do they work?Neural Networks - How do they work?
Neural Networks - How do they work?
 
A Signature Algorithm Based On Chaotic Maps And Factoring Problems
A Signature Algorithm Based On Chaotic Maps And Factoring ProblemsA Signature Algorithm Based On Chaotic Maps And Factoring Problems
A Signature Algorithm Based On Chaotic Maps And Factoring Problems
 
Matlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processingMatlab for beginners, Introduction, signal processing
Matlab for beginners, Introduction, signal processing
 
Paper computer
Paper computerPaper computer
Paper computer
 
Paper computer
Paper computerPaper computer
Paper computer
 
Dsp lab manual
Dsp lab manualDsp lab manual
Dsp lab manual
 
Parametric time domain system identification of a mass spring-damper
Parametric time domain system identification of a mass spring-damperParametric time domain system identification of a mass spring-damper
Parametric time domain system identification of a mass spring-damper
 

Recently uploaded

一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
nyfuhyz
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
Sachin Paul
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
sameer shah
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
AlessioFois2
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
manishkhaire30
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
Social Samosa
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
rwarrenll
 
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging DataPredictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Kiwi Creative
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
Lars Albertsson
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
Social Samosa
 
DSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelinesDSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelines
Timothy Spann
 
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
bopyb
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
roli9797
 
Intelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicineIntelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicine
AndrzejJarynowski
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
Walaa Eldin Moustafa
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Aggregage
 
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
nuttdpt
 
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
74nqk8xf
 
State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023
kuntobimo2016
 

Recently uploaded (20)

一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
 
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
 
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging DataPredictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
 
DSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelinesDSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelines
 
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
 
Intelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicineIntelligence supported media monitoring in veterinary medicine
Intelligence supported media monitoring in veterinary medicine
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
 
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
 
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
一比一原版(Chester毕业证书)切斯特大学毕业证如何办理
 
State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023State of Artificial intelligence Report 2023
State of Artificial intelligence Report 2023
 

Correlation

  • 1. Experiment No: 02 Experiment Name: Write a simple Matlab program to perform correlation of two signals: 1) Cross correlation 2) Auto correlation Objectives:  To learn about Cross and Auto Correlation.  To learn about how to perform correlation using Matlab code. Theory: Correlation: Correlation is a measure f similarity between two signals. The general formula for correlation is ∫ 𝒙𝟏(𝒕)𝒙𝟐(𝒕 − 𝝉)𝒅𝒕 ∞ −∞ Cross correlation: Cross correlation is a measure of similarity of two series as a function of the lag of one relative to the other. Auto correlation: Autocorrelation is a mathematical representation of the degree of similarity between a given time series and a lagged version of itself over successive time intervals Auto Correlation Code: clear all; close all; clc; x=[1 2 3] y=input('Initial position '); yy=input('Initial position of 2nd signal '); k=[]; m=length(x); p=(y-1)*-1; d=1; for i= p:1:(m-y) k (d)=i; d=d+1; k end figure (1) subplot(3,1,1); stem(k,x,'g','LineWidth',3); title('Discrete Signal represntation '); xlabel('Time(t) '); ylabel('x(n)'); xx=[3 2 1]
  • 2. kk=[]; mm=length(xx); pp=(yy-1)*-1; dd=1; for ii= pp:1:(mm-yy) kk (dd)=ii; dd=dd+1; kk end figure (1) subplot(3,1,2); r=[]; r=xcorr(xx,x); stem(kk,xx,'g','LineWidth',3); lx=m+mm-1; rx=p+pp; cx=[]; g=1; for i=1:1:lx cx(g)=rx; rx=rx+1; g=g+1; end cx g figure (2); stem(cx,r,'g','LineWidth',3); Input Signals: 1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3 0 2 4 Discrete Signal represntation Time(t) x(n) 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 0 2 4
  • 3. Output Signal (Auto Correlated Signal): Cross Correlation code clear all; close all; m = input('length'); for i=1:m x(i)=input('value'); end p=input('initial'); n=input('length'); for i=1:m y(i)=input('value'); end q=input('initial'); l=m+n-1; pp=-(p-1); qq=-(q-1); lower=pp+qq; for i=1:1:1 rr(i)=lower; lower=lower+1; end for i=1:1:1 if i<=m x(i)=x(i); else 1 1.5 2 2.5 3 3.5 4 4.5 5 0 2 4 6 8 10 12
  • 4. x(i)=0; end end for i=1:1:1 if i<=n y(i)=y(i); else y(i)=0; end end for j=1:1:1 p1=0; q1=j; for i=1:1:j p1=p1+x(q1)*y(i); q1=q1-1; end r(i)=p1; end stem(rr,r) Input Output Length 4 value1 value2 value3 value4 initial 1 length 4 value4 value3 value2 value1 initial 4 Comments: From this lab we know about Cross and Auto correlation and know how to implement these correlations into Matlab code. This knowledge will help us in further lab work. This lab helps us to clear our idea about correlation -4 -3.8 -3.6 -3.4 -3.2 -3 -2.8 -2.6 -2.4 -2.2 -2 0 0.5 1 1.5 2 2.5 3 3.5 4