使用MATLAB分析连续信号频谱和采样信号频谱
- 格式:docx
- 大小:12.33 KB
- 文档页数:1
使用MATLAB分析连续信号频谱和采样信号频谱clc;
close all;
fs=150;
t=1/fs;
xmax=12;
n=0:0.05:xmax;
x1=sin(100*pi*n*t);
subplot(321);
plot(n,x1);
xlabel('sin(100*pi*t)','fontsize',16);
x2=sin(200*pi*n*t);
subplot(323);
plot(n,x2);
xlabel('sin(200*pi*t)','fontsize',16);
x3=sin(400*pi*n*t);
subplot(325);
plot(n,x3);
xlabel('sin(400*pi*t)','fontsize',16);
n1=0:1:xmax;
x1=sin(100*pi*n1*t);
subplot(322);
stem(n1,x1);
xlabel('sin(100*pi*n1*t)','fontsize',16);
x2=sin(200*pi*n1*t);
subplot(324);
stem(n1,x2);
xlabel('sin(200*pi*n1*t)','fontsize',16);
x3=sin(400*pi*n1*t);
subplot(326);
stem(n1,x3);
xlabel('sin(400*pi*n1*t)','fontsize',16);