Professional Documents
Culture Documents
ACFrOgBi YGYumtfMnpMazyOwnGNA10DEe9bHKjID0fdv6NQFWfcn54EYJIGzsTK6dAyt1VLIjBnT7W LbZdCnYKtipFuUQ-rwo-csGert7EJphre41j2iP9oUyIVYY
ACFrOgBi YGYumtfMnpMazyOwnGNA10DEe9bHKjID0fdv6NQFWfcn54EYJIGzsTK6dAyt1VLIjBnT7W LbZdCnYKtipFuUQ-rwo-csGert7EJphre41j2iP9oUyIVYY
(BUBT)
LAB REPORT
Course Title: Digital Signal Processing Lab
Experiment no: 06
ID No:19202208007
Experiment No: 06
Code:
Problem 1 :
clc
clear all
nx = 0:399;
x = repmat([ones(1,40) zeros(1,40)],[1,5]);
subplot(3,1,1)
stem(nx,x)
nh=0:25;
h=0.25*0.75.^nh;
subplot(3,1,2)
stem(nh,h)
[y,ny] = convulation(x,nx,h,nh);
subplot(3,1,3)
stem(ny,y)
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]=convulation(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
Convulation Function:
function[y,n]=convulation(x1,n1,x2,n2)
n=min(n1)+min(n2):max(n1)+max(n2)
y=conv(x1,x2)
end
Graph:
Figure: 2.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:
Following the software instruction and lab manual for using the MATLAB
software. After running the different code, the output graph was observed .After
simulation collect all data and graph carefully and take screensort.