xcha1.m
来自「dsp学习中matlab试验源代码」· M 代码 · 共 30 行
M
30 行
n=0:9;
x=sign(sign(10-n)+1);
close all;
subplot(3,2,1);
stem(n,x);
title('Xc(t)或Rn(t)信号序列');
k=-25:25;
X=x*(exp(-j*pi/25)).^(n'*k);
magX=abs(X);
subplot(3,2,2);
stem(magX);
title('Xc(t)或Rn(t)信号的幅度谱');axis([0,50,0,20]);
subplot(3,2,3);
stem(n,x);
title('Ha(t)或Rn(t)信号的幅度谱');axis([0,10,0,1]);
subplot(3,2,4);
stem(magX);
title('Ha(t)或Rn(t)信号的幅度谱');axis([0,50,0,20]);
y=conv(x,x);
subplot(3,2,5);stem(y);title('输出信号 y[n]');axis([0,21,0,20]);
p=0:18;
Z=y*(exp(-j*pi/12.5)).^(p'*k);
magZ=abs(Z); %绘制x(n)的幅度谱
subplot(3,2,6);stem(magZ);title('输出信号 y[n]的幅度谱');axis([0,51,0,150]);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?