📄 理想采样序列.txt
字号:
n=0:50;
A=444.128;
a=50*sqrt(2.0)*pi;
T=0.001;
w0=50*sqrt(2.0)*pi;
x=A*exp(-a*n*T).*sin(w0*n*T);
close all
subplot(3,1,1);stem(x);
title('理想采样信号序列');
k=-25:25;
W=(pi/12.5)*k;
X=x*(exp(-j*pi/12.5)).^(n'*k);
magX=abs(X);
subplot(3,1,2);stem(magX);title('理想采样信号序列的幅度谱');
angX=angle(X);
subplot(3,1,3);stem(angX);
title('理想采样信号序列的相位谱');
n=0:50;
A=1;a=0.4;w0=2.0734;T=1;
x=A*exp(-a*n*t).sin(w0*n*T);
矩形序列
n=1:5;0x=sign(sign(10-n)+1);
close all;subplot(3,1,1);stem(x);title('单位冲击信号序列');
k=-25:25;X=x*(exp(-j*pi/25)).^(n'*k);
magX=abs(X);
subplot(3,1,2);stem(angX);title('单位冲击信号的幅度谱');
angX=angle(X);
subplot(3,1,3);stem(angX);title('单位冲击信号的相位谱');
单位脉冲序列
n=1:50;
x=zeros(1,50);
x(1)=1;close all;
subplot(3,1,1);stem(x);title('单位冲击信号序列');
k=-25:25;
X=x*(exp(-j*pi/12.5)).^(n'*k);
magX=abs(X);
subplot(3,1,2);stem(angX);title('单位冲击信号的幅度谱');
angX=angle(X);
subplot(3,1,3);stem(angX);title('单位冲击信号的相位谱');
特定冲击串
n=1:50;
x=zeros(1,50);
x(1)=1;x(2)=2.5;x(3)=2.5;x(4)=1;
close all;subplot(3,1,1);stem(x);title('单位冲击信号序列');
k=-25:25;X=x*(exp(-j*pi/25)).^(n'*k);
magX=abs(X);
subplot(3,1,2);stem(angX);title('单位冲击信号的幅度谱');
angX=angle(X);
subplot(3,1,3);stem(angX);title('单位冲击信号的相位谱');
卷积计算
n=1:50;
hb=zeros(1,50);
hb(1)=1;hb(2)=2.5;hb(3)=2.5;hb(4)=1;
close all;subplot(3,1,1);stem(hb);title('系统hb[n]');
m=1:50;T=0.001;
A=444.128;
a=50*sqrt(2.0)*pi;
w0=50*sqrt(2.0)*pi;
x=A*exp(-a*m*T).*sin(w0*m*T);
subplot(3,1,2);stem(x);
title('输入信号x[n]');
y=conv(x,hb);
subplot(3,1,3);stem(y);
title('输出信号y[n]');
卷积序列验证
k=-25:25;
X=x*(exp(-j*pi/12.5)).^(n'*k);
magX=abs(X);
subplot(3,2,1);stem(magX);title('输入信号的幅度谱');
angX=angle(X);
subplot(3,2,2);stem(angX);title('输入信号的相位谱')
Hb=hb*(exp(-j*pi/12.5)).^(n'*k);
magHb=abs(Hb);
subplot(3,2,3);stem(magHb);title('系统响应的幅度普');
angHb=angle(Hb);
subplot(3,2,4);stem(angHb);title('系统响应的相位普')
n=1:99;k=1:99;
Y=y*(exp(-j*pi/12.5)).^(n'*k);
magY=abs(Y);
subplot(3,2,5);stem(magY);title('输出信号的幅度普');
angY=angle(Y);
subplot(3,2,6);
stem(angY);title('输出信号的相位普')
XHb=X.*Hb;
subplot(2,1,1);stem(abs(XHb));title('x(n)的幅度普与hb(n)幅度普相乘');
subplot(2,1,2);stem(abs(Y));title('y(n)的幅度普');axis([0,60,0,8000])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -