⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dm11101.m

📁 the code of the book come form the book of marlix laboratory with the book of singal
💻 M
字号:
% dm11101
% 时域采样定理
display('奈奎斯特周期1.5秒,Ts<1.5,过采样,Ts>1.5,欠采样');
display('Please input the value of sample period');
Ts = input('Ts = ');
%绘制有限长余弦信号y=cos(2/3*pi*t)
t = 0:0.01:40;
y = cos(2/3*pi*t);
subplot(221);
plot(t,y);
axis([0 6 -1.1 1.1]);
xlabel('t   单位:s','Fontsize',8);
title('f(t)');
line([0 6],[0 0],'color',[0 0 0]);
%数值求解余弦信号的频谱
N = 300;
W = 2*pi*5;
k = -N:N;
w = k*W/N;
Y = 0.01*y*exp(-j*t'*w);                               %求(t)的傅里叶变换F1(ω)
Y = abs(Y);
subplot(222);
plot(w/pi,Y)
axis([-2,2,0,pi*7+0.2]);
title('F(j\omega)');
xlabel('\omega   单位:pi');
%采样后的余弦信号
subplot(223);
plot(t,y,'b:');                                           %绘制包络
hold on
t2=0:Ts:40;
y2=cos(2/3*pi*t2);
stem(t2,y2);
axis([0 6 -1.1 1.1]);
xlabel('t   单位:s','Fontsize',8);
title('fs(t)');
hold off
%采样后余弦信号的频谱
Y2 = Ts*y2*exp(-j*t2'*w);
Y2 = abs(Y2);
subplot(224);
plot(w/pi,Y,'b')                                          %蓝色绘制原信号频谱
xlabel('\omega  单位:pi');
title('Fs(j\omega)');
hold on
plot(w/pi,Y2,'r');                                       %红色绘制采样信号频谱
axis([-2,2,0,pi*10]);
hold off
%end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -