You are on page 1of 2

REG NO:

Name : Sagar Santosh More 2021BEC50


7
Sub : Digital Signal Processing
Roll No:
A71

PRACTICAL : 04
Aim : To Generate Composite Signal X(n).

Matlab Code:
clc ;
clear all; close all; n=0:10;
u1=(n>=3); subplot(3,2,1) stem(n,u1);
ylim([-1 3]); u2=4*(n>=-15);
subplot(3,2,2) stem(n,u2); ylim([-1 5]);
u3=5*(n>=10); subplot(3,2,3); stem(n,u3);
ylim([-1 6]); u4=(n>=1); r=(n-1).*u4;
subplot(3,2,4); stem(n,r); d=(n==0);
subplot(3,2,5) stem(n,d); ylim([-1 3]);
u5=(n>=-2); r2=(n+2).*u5; subplot(3,2,6)
stem(n,r2); figure() X=u1+u2+u3+r+d+r2;
stem(n,X); ylabel("X(n)"); xlabel("n");
title("Given Composite Signal"); ylim([-40
40]);
Output:

You might also like