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

📄 pm.m

📁 经典《信号与系统》教程的matlab例程,对深入理解信号与系统相关概念有很大帮助
💻 M
字号:
close all,clear;
kp=1;
t=-10:0.01:10;
x=cos(0.5*pi*t);
x1=sin(0.5*pi*t)/0.5;
c=cos(2*pi*t+x1);
subplot(221)
plot(t,x)
axis([-6,6,-1.2,1.2])
title('The modulating signal x(t)')
grid on;
subplot(222)
plot(t,c)
axis([-6,6,-1.2,1.2])
title('The modulated carrier c(t)')
grid on;
%=========================================================================
W1=4*pi;                             %确定信号的频率范围
N=512;           
k=-N:N;                              %对信号的角频率进行采样的点数为2N+1点
W=k*W1/N;                            %计算频率的采样间隔
X=c*exp(-j*t'*W)*0.01;                  %进行傅里叶数值积分运算(矩阵运算)
X1=abs(X);                           %求模——幅度谱
phi=57.3*angle(X);                     %求相位谱
%==========================================================================

subplot(212);plot(W/(2*pi),X1);grid on;
axis([-W1/(2*pi),W1/(2*pi),-0.3*max(X1),1.1*max(X1)])
title('The magnitude spectra ');
xlabel('w*2pi (radians/s)');

%===========================================================================

⌨️ 快捷键说明

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