ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
GENERATION OF DISCRETE TIME SIGNALS
clc;
clear all;
close all;
n=input('enter the length of step sequence');
n1=input('enter the length of ramp sequence');
n2=input('enter the length of exponential sequence');
a=input('enter the value');
t=-2:1:2;
y=[zeros(1,2),ones(1,1),zeros(1,2)];
subplot(2,2,1);
stem(t,y);
xlabel('A(n)-->impulse sequence');
ylabel('amplitude');
t=0:n-1;
y1=ones(1,n);
subplot(2,2,2);
stem(t,y1);
xlabel('B(n)----->step sequence');
ylabel('amplitude');
t=0:n1;
subplot(2,2,3);
stem(t,t);
xlabel('C(n)---->ramp sequencccce');
ylabel('amplitude');
t=0:1:n2;
e=exp(t);
subplot(2,2,4);
stem(t,e);
xlabel('D(n)----->exponential sequence');
ylabel('amplitude');
OUTPUT
enterthe lengthof stepsequence4
enterthe lengthof ramp sequence6
enterthe lengthof exponentialsequence6
enterthe value6
Generation of discrete time signals

More Related Content

Generation of discrete time signals

  • 1. GENERATION OF DISCRETE TIME SIGNALS clc; clear all; close all; n=input('enter the length of step sequence'); n1=input('enter the length of ramp sequence'); n2=input('enter the length of exponential sequence'); a=input('enter the value'); t=-2:1:2; y=[zeros(1,2),ones(1,1),zeros(1,2)]; subplot(2,2,1); stem(t,y); xlabel('A(n)-->impulse sequence'); ylabel('amplitude'); t=0:n-1; y1=ones(1,n); subplot(2,2,2); stem(t,y1); xlabel('B(n)----->step sequence'); ylabel('amplitude'); t=0:n1; subplot(2,2,3); stem(t,t); xlabel('C(n)---->ramp sequencccce'); ylabel('amplitude'); t=0:1:n2; e=exp(t); subplot(2,2,4); stem(t,e); xlabel('D(n)----->exponential sequence'); ylabel('amplitude'); OUTPUT enterthe lengthof stepsequence4 enterthe lengthof ramp sequence6 enterthe lengthof exponentialsequence6 enterthe value6