How to plot discrete signals (delta equation)
56 ビュー (過去 30 日間)
古いコメントを表示
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)
0 件のコメント
回答 (1 件)
Abraham Boayue
2018 年 6 月 4 日
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
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Fourier Analysis and Filtering についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!