Borrar filtros
Borrar filtros

How to plot discrete signals (delta equation)

39 visualizaciones (últimos 30 días)
Jhon
Jhon el 3 de Jun. de 2018
Respondida: Abraham Boayue el 4 de Jun. de 2018
plot 2 discrete signals:
1.x[n]=delta[n]-delta[n-1]+delta[n+4]
2.y[n]=0.5^n*u[n]
also plot the convolution I don't know what the delta is supposed to be and how to approach these kind of signals
if I have a simple signal I know how to do it n = 0:7; x1 = cos(pi*n); subplot(1,2,1) stem(n,x1)

Respuestas (1)

Abraham Boayue
Abraham Boayue el 4 de Jun. de 2018
Take a look at this code. It shows how to plot the sequences that you are given.
n0 = 0;
n1 = 1;
n2 = -4;
n = -5:5;
xn = ((n-n0)==0)-((n-n1)==0)+((n-n2)==0); % The delta function
yn = 0.5*((n-n0)>=0);
figure
subplot(121)
stem(n,xn,'linewidth',3,'color','b')
a= title('Discrete time signal: Unit sample sequence');
set(a,'fontsize',14);
a= xlabel('n [-5 5]');
set(a,'fontsize',20);
a = ylabel('xn');
set(a,'fontsize',20);
grid
subplot(122)
stem(n,yn,'linewidth',3,'color','r')
a= title('Discrete time signal: Unit Step sequence');
set(a,'fontsize',14);
a= xlabel('n [-5 5]');
set(a,'fontsize',20);
a = ylabel('yn');
set(a,'fontsize',20);
grid

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by