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

📄 dm10404.m

📁 the code of the book come form the book of marlix laboratory with the book of singal
💻 M
字号:
% dm10404
% 傅里叶变换的频移特性
display('Please input the value of w0');
w0 = input('w0 = ');                                 %键盘输入载频
dt = 0.002;
t = -1:dt:1.01;
f = Heaviside(t+1)-Heaviside(t-1);                   %定义脉宽为2的门信号 
f1 = 1/2*f.*(exp(-j*w0*t)+exp(j*w0*t));              %定义矩形调幅信号
W1=1.5*pi*(w0/pi);
N = 500;
k = -N:N;
W = k*W1/N;
F = f*exp(-j*t'*W)*dt;                               %求门信号的傅里叶变换F(ω)
F1 = f1*exp(-j*t'*W)*dt;                             %求矩形调幅信号的傅里叶变换F1(ω)
F = real(F);
F1 = real(F1);
subplot(221);
plot(t,f,'r');                                      %用红色绘制时域门信号
axis([-1.5 1.5 0 1.1]);
title('门信号','Fontsize',8);
xlabel('t','Fontsize',8);
subplot(223);
plot(t,f1,'b');                                     %用蓝色绘制时域矩形调幅信号
axis([-1.5 1.5 -1.1 1.1]);
title('矩形调幅信号','Fontsize',8);
xlabel('t','Fontsize',8);
subplot(222);
plot(W,F,'r');                                     %用红色绘制门信号的幅度频谱
xlabel('w','Fontsize',8);
title('门信号的幅度频谱','Fontsize',8)
subplot(224);
plot(W,F1,'b');                                    %用蓝色绘制矩形调幅信号的幅度频谱
hold on;
plot(W,F,'r');                                     %绘制门信号的幅度频谱
xlabel('w');
title(strcat('矩形调幅信号的幅度频谱(w0 =  ',num2str(w0),')'));
%End

⌨️ 快捷键说明

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