信号处理基础实验1

1,绘制出冲激信号、复指数信号以及抽样信号的波形。(连续)

冲激信号:
函数形式,在命令行运行exp1_2(x)即可画出位于x处的冲激信号(范围在-5到5)
function exp1_2(n)
t=-5:0.01:5;
y=0*(t>=-5&t<0)+1*(t==n)+0*(t>0&t<=5);
plot(t,y)
axis([-5,5,-1,1.5])
end
复指数信号:
clear all;close all;
t0=0;
tf=5;
dt=0.01;
t=[t0:dt:tf];
alpha=-0.5;
w=10;
x=exp((alpha+j*w)*t);
subplot(2,2,1);
plot(t,real(x),‘linewidth’,2);
xlim([t(1) t(end)]);
grid on;
xlabel(‘t’);
ylabel(‘real part’);
subplot(2,2,2);plot(t,imag(x),‘linewidth’,2);
ylabel(‘imaginary part’);
subplot(2,2,3);plot(t,abs(x),‘linewidth’,2);
ylabel(‘abs’);
subplot(2,2,4);plot(t,angle(x),‘linewidth’,2);
ylabel(‘angle’);
抽样信号:
t=[0.01:0.01:10];
y=sin(t)./t;
plot(t,y)
xlabel(‘t’);
ylabel(‘sin(t)/t’);

2. 任意连续信号之间的运算并绘出结果波形。

clear all;close all;
t=[0.01:0.01:10];
y=sin(t)./t;
subplot(2,3,1);
plot(t,y)
grid on;
xlabel(‘t’);
ylabel(‘sin(t)/t’);
axis([0 max(t) -1.1 1.1]);

y=sin(t);
subplot(2,3,2);
plot(t,y)
grid on;
xlabel(‘t’);
ylabel(‘sin(t)’);
axis([0 max(t) -1.1 1.1]);

y=sin(t).*sin(t)./t;%乘
subplot(2,3,3);
plot(t,y)
grid on;
xlabel(‘t’);
ylabel(‘sin(t)*sin(t)/t’);
axis([0 max(t) -1.1 1.1]);

y=sin(t)+sin(t)./t;%加
subplot(2,3,4);
plot(t,y)
grid on;
xlabel(‘t’);
ylabel(‘sin(t)+sin(t)/t’);
axis([0 max(t) -2.1 2.1]);

y=sin(t+pi);%平移
subplot(2,3,5);
plot(t,y)
grid on;
xlabel(‘t’);
ylabel(‘sin(t)+sin(t)/t’);
axis([0 max(t) -1.1 1.1]);

3. 绘制出矩形脉冲序列、正弦序列以及阶跃序列的波形。(离散)

N=11;
n=(0:N-1);
w=window(@rectwin,N);
subplot(2,2,1);
stem(n,w,‘linewidth’,2);
xlabel(‘n’)
ylabel(‘R_N(n)’);
ylim([0 1.5]);

n=0:31;
w=pi/8;
x=sin(w*n);
subplot(2,2,2);
stem(n,x,‘linewidth’,2);
xlabel(‘n’);
axis([0 max(n) -1.1 1.1])

n=-10:10;
x=stepfun(n,0);
subplot(2,2,3);
stem(n,x,‘linewidth’,2);
xlabel(‘n’);
axis([-10 max(n) -0.5 1.5])

4. 任意离散信号之间的运算并绘出结果波形。

n=0:31;
w0=pi/8;

x=sin(w0*n);
subplot(2,3,1);
stem(n,x,‘linewidth’,2);
xlabel(‘n’);
ylabel(‘sin_N(n)’);
axis([0 max(n) -1.1 1.1]);

x=cos(w0*n);
subplot(2,3,2);
stem(n,x,‘linewidth’,2);
xlabel(‘n’);
ylabel(‘cos_N(n)’);
axis([0 max(n) -1.1 1.1]);

x=cos(w0n)+sin(w0n);%加
subplot(2,3,3);
stem(n,x,‘linewidth’,2);
xlabel(‘n’);
ylabel(‘cos*sin_N(n)’);
axis([0 max(n) -2.1 2.1]);

x=cos(w0*n).sin(w0n);%乘
subplot(2,3,4);
stem(n,x,‘linewidth’,2);
xlabel(‘n’);
ylabel(‘cos+sin_N(n)’);
axis([0 max(n) -1.1 1.1]);

x=sin(w0*n+pi);%平移
subplot(2,3,5);
stem(n,x,‘linewidth’,2);
xlabel(‘n’);
ylabel(‘sin_move_N(n)’);
axis([0 max(n) -1.1 1.1]);

  • 6
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值