0% found this document useful (0 votes)
75 views8 pages

Correlation and Discrete Time Signals

1. The document describes an experiment to analyze correlation and discrete time signals using MATLAB. 2. The experiment aims to find the output cross and auto correlation of signals and generate graphs, as well as compute and sketch the graph of a modulated discrete-time signal. 3. MATLAB programs are provided to generate cross correlation, auto correlation, and frequency analysis of amplitude modulated discrete-time signals for varying values of n. Output graphs are generated as requested.

Uploaded by

Nathan Shankar
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)
75 views8 pages

Correlation and Discrete Time Signals

1. The document describes an experiment to analyze correlation and discrete time signals using MATLAB. 2. The experiment aims to find the output cross and auto correlation of signals and generate graphs, as well as compute and sketch the graph of a modulated discrete-time signal. 3. MATLAB programs are provided to generate cross correlation, auto correlation, and frequency analysis of amplitude modulated discrete-time signals for varying values of n. Output graphs are generated as requested.

Uploaded by

Nathan Shankar
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/ 8

Correlation and Discrete Time signals

Experiment No.: 2

Date: 3 / 09 / 2021

Name : Bhuvanagiri Prahal Bhagavath

Reg No : 19BEE0384

AIM:

1. To find the output cross and auto correlation and generate a graph
2. To compute and sketch the graph of a modulated discrete-time signal.

REQUIRED SOFTWARE:

System with MATLAB R2020a.


MATLAB PROGRAM:

1. Cross correlation

Clc;
clear all;
x=input('enter samples of x');
h=input('enter samples of h');
xlen=length(x);
hlen=length(h);
for i=1:xlen;
for j=1:xlen;
y(i,i+j-1)=x(i)*h(hlen-j+1);
end
end
z=sum(y);
disp('output');z
disp('output sequence');y
stem(x,y);

2.Auto correlation

clc
clear all;
x=input('enter samples of x');
xlen=length(x);
for i=1:xlen;
for j=1:xlen;
y(i,i+j-1)=x(i)*h(hlen-j+1);
end
end
z=sum(y);
disp('output');z
stem(x,y)
3. For 0≤n≤255 (Frequency analysis of amplitude modulated dicrete-time signal)

clc;
close all;
clear all;
f1=1/128; f2=5/128; fc=50/128; n=0:255;
x=cos(2*pi*f1*n)+cos(2*pi*f2*n);
xa=cos(2*pi*fc*n);
xamp=x.*xa;
subplot(2,2,1); plot(n,x); title('x(n)');
xlabel('n-->');ylabel('amplitude');
subplot(2,2,2); plot(n,xa); title('xa(n)');
xlabel('n-->'); ylabel('amplitude');
subplot(2,2,3); plot(n,xamp);
xlabel('n-->'); ylabel('amplitude');

4. For 0≤n≤127 (Frequency analysis of amplitude modulated dicrete-time signal)

clc;
close all;
clear all;
n=0:127; figure;n1=128;
f1=1/128; f2=5/128; fc=50/128;
x=cos(2*pi*f1*n)+cos(2*pi*f2*n);
xc=cos(2*pi*fc*n);
xa=cos(2*pi*fc*n);
xamp=x.*xa; xam=fft(xamp,n1);
stem(n,xam); title('xamp(n)');
xlabel('n-->'); ylabel('amplitude');

5. For 0≤n≤99 (Frequency analysis of amplitude modulated dicrete-time signal)

clc;
close all;
clear all;
n=0:99; figure; n1=128; n2=0:n1-1;
f1=1/128; f2=5/128; fc=50/128;
x=cos(2*pi*f1*n)+cos(2*pi*f2*n);
xc=cos(2*pi*fc*n);
xa=cos(2*pi*fc*n);
xamp=x.*xa;
for i=1:100
xamp1(i)=xamp(i);
end
xam=fft(xamp1,n1);
stem(n2,xam); title('xamp(n)');
xlabel('n-->'); ylabel('amplitude')
OUTPUT GRAPH:

1. Cross correlation
2. Auto correlation
3. DFT 0≤n≤255
4. DFT 0≤n≤127
5. DFT 0≤n≤99

RESULT & INFERENCE:

The comparison of two independent time series to see if there is a correlation between metrics with the
same maximum and minimum values is known as cross-correlation.The comparing of a time series with
itself at a separate time is known as auto-correlation. It seeks to find recurrent patterns or seasonality,
for example. The experiment to generate the above-mentioned signals using MATLAB2020a was
performed successfully and the output was verified.

You might also like