Professional Documents
Culture Documents
Lab 7
Lab 7
(BUBT)
LAB REPORT
Course Title: Digital Signal Processing Lab
Experiment no: 07
ID No:19202208023
Graph:
Figure: 01
Problem 2 :
clc
clear all
close all
n1=0;
n2=120;
[d1,nn]=delta(n1,n2,0)
[d2,nn]=delta(n1,n2,40)
[d3,nn]=delta(n1,n2,70)
[d4,nn]=delta(n1,n2,80)
[s1,n1]=signaladd(d1,nn,2*d2,nn)
[s2,n2]=signaladd(2*d3,nn,d4,nn)
[s,nx]=signaladd(s1,n1,s2,n2)
subplot(311)
stem(nx,s)
nh=0:24;
h=(0.95).^nh;
subplot(312)
stem(nh,h)
[y,ny]=correlation(s,nx,h,nh);
subplot(313) stem(ny,y)
Delta Function:
function[delta,n]=delta(n1,n2,n0)
n=n1:n2; delta=n>=n0;
end
Signaladd Function:
function[sum,n]=signaladd(x1,n1,x2,n2)
n=min(min(n1),min(n2)):max(max(n1),max(n2));
y1=zeros(1,length(n)); y2=y1;
y1((n>=min(n1))& (n<=max(n1)))=x1;
y2((n>=min(n2))& (n<=max(n2)))=x2;
sum=y1+y2;
end
Function of correlation:
function[Rxy,n]=c(x1,n1,x2,n2)
[Rxy,n]=xcorr(x1,x2)
end
Graph:
Figure: 2
Comment:
1. Submit the complete data sheet with the screenshots of MATLAB code
and Output Graphs.
2. Using various variables value complete the data table, observe the output
graphs and write a report.
Discussion:
In this lab we have learn about correlation operations and their properties and
purposes.Also learn about the autocorrelation and cross-correlation of signals
using MATLAB.
To create these signals we have used some funcition file.Along with the
function file the code was executed and captured the output graph.