我是靠谱客的博主 单纯小笼包,这篇文章主要介绍一、信号处理 ——1.序列(含matlab代码),现在分享给大家,希望可以做个参考。

 (1) 单位脉冲序列(单位采样序列)

n=[-5:5];
x1=impseq(0,-5,5);
subplot(2,2,1);stem(n,x1);title('单位脉冲序列')
xlabel('n');ylabel('x(n)');

*impseq函数:生成单位脉冲序列,-5,5为图像横坐标两端位置,0为脉冲序列的横坐标;

*subplot函数:(2,2,1)意为将图像现实界面分割为2*2=4部分,该图像显示在第1部分 。

(2) 单位阶跃序列

n=[0:10]
x2=stepseq(0,0,10);
subplot(2,2,2);stem(n,x2);title('单位阶跃序列');
xlabel('n');ylabel('x(n)');

 *stepseq函数:生成单位阶跃序列。

(3) 矩形序列

n=[0:10];
x3=stepseq(0,0,10)-stepseq(5,0,10);
subplot(2,2,3);stem(n,x3);title('矩形序列');
xlabel('n');ylabel('x(n)');

(4) 正弦序列 

n=[0:20];
x4=sin(0.3*n);
subplot(2,2,4);stem(n,x4);title('正弦序列');
xlabel('n');
ylabel('x(n)')

(5) 复指数序列

n=[0:1:20];
alpha=-0.1+0.5j;
x=exp(alpha*n);
subplot(2,2,1);
stem(n,real(x));
title('实部');
xlabel('n')
subplot(2,2,3);
stem(n,imag(x));
title('虚部');
xlabel('n')
subplot(2,2,2);
stem(n, abs(x));
title('振幅');
xlabel('n')
subplot(2,2,4);
stem(n,(180/pi)*angle(x));
title('相位');
xlabel('n')

 *stem函数中real():求复数的实部;

 *stem函数中real():求复数的虚部;

 *stem函数中abs():即sqrt(复数实部^2+复数虚部^2);

 *stem函数中angle():求复数相角。

———————————————————————————————————————————

仅用作学习记录~

 

最后

以上就是单纯小笼包最近收集整理的关于一、信号处理 ——1.序列(含matlab代码)的全部内容,更多相关一、信号处理内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(117)

评论列表共有 0 条评论

立即
投稿
返回
顶部