EXP4 Final
EXP4 Final
EEE343L
Digital Signal Processing Laboratory
Experiment no:04
Name of the experiment: Sampling Rate Alteration, Response of LTI
Systems to Arbitrary Inputs: Convolution and Difference Equations
Prepared by:
Name: Munirun Nessa ID: 20321022
All Group members:
Sl. Name ID
1. Phub Gyem 20221037
Objective ._
Performing Up Sampling, Down Sampling, Convolution and generating system response from
difference equations using MATLAB. Observe the output.
Task-01 ._
Code ._
clc;
clear all;
close all;
nx = 0:3;
x = [2 3 5 -2];
nh1 = -2:1;
h1 = [-1 0 3 4];
nh2 = -1:3;
h2 = [2 3 0 7 1];
al_h = nh1(1) + nh2(1);
ah_h =nh1(end) + nh2(end);
idh=al_h:ah_h;
h=conv(h1,h2);
idmin = idh(1) + nx(1);
idmax =idh(end) + nx(end);
idy=idmin:idmax;
y=conv(x,h);
stem(idy,y),xlabel('index'),ylabel('y(n)')
Output ._
Task-02 ._
Output ._
Task-03 ._
Detailed Calculation ._
𝑛 𝑛
Now , 𝑦𝑐(n) = 𝐶14 + 𝐶2(− 1)
𝑛
𝑦𝑝(n) = k×n× 4 u(n)
And , y(n) = 𝑦𝑐(n) + 𝑦𝑝(n)..........................(i)
Again , y(n)-3y(n-1) -4y(n-2)=x(n)+2x(n-1)
𝑛 𝑛−1 𝑛−2 𝑛 𝑛−1
⇒ k×n×4 u(n) - 3×k(n-1)4 × u(n-1)-4×k(n-2)×4 ×u(n-2) = 4 ×u(n) + 2× 4 ×u(n-1)
When n = 2
2 2−1 2−2 2 2−1
k×2×4 u(2) - 3×k(2-1)4 × u(2-1)-4×k(2-2)×4 ×u(2-2) = 4 ×u(2) + 2× 4 ×u(2-1)
2 1 2 1
⇒ k ( 2× 4 ×u(2) - 3× 1× 4 ×u(1)-0 = 4 ×u(2) + 2× 4 ×u(1)
24 6
⇒k= 20
= 5
When n = 0
0 0 6 0
(i)⇒ y(0) = 𝐶1× 4 + 𝐶2(− 1) + 5
×0× 4 × 𝑢(0) = 𝐶1+ 𝐶2
Let , y(-1) = y(-2) = 0
So , y(0)-3y(-1)-4y(-2)=x(0)+2x(-1) [x(n)=u(n)]
⇒y(0)= 1+0 = 1
So , 𝐶1+ 𝐶2 =1 …………………………………………..(ii)
When n=1
y(1) -3y(0) - 4y(-1) = x(1) +2x(0)
⇒y(1) - 3×1 -4×0 = 0×2×1
⇒y(1) = 2+3 = 5
1 1
⇒ 𝐶1× 4 + 𝐶2(− 1) = 5 ………………………………..(iii)
Discussion ._
In this study, MATLAB was utilised. Use difference equations to do upsampling, downsampling,
convolution, and system response. In order to observe the step, impulse, and sinusoidal responses
of various systems, we also employed MATLAB. Despite several challenges, we were able to
complete the experiment successfully. In addition, we occasionally had difficulties with
MATLAB that required us to restart the programme. The experiment was successful other from
that.