📄 fm.m
字号:
function fm()
%
% FM simulation
%
% Instantaneous frequency = fc+m(fm)sin(2(pi)(fm)t)
%
% Given modulation index m, carrier and modulation frequencies
%
m = 10;
fc = 5e3;
fm = 250;
fs = 1e5;
tstep=1/fs;
t = 0:tstep:0.01;
% Generate the fm signal
fm_out = sin( (2*pi*fc*t) + m*sin(2*pi*fm*t) );
clf
figure(1)
% plot the modulating signal
subplot(5,1,1), plot(t,sin(2*pi*fm*t))
title('Modulating signal')
grid
%plot the carrier signal
subplot(5,1,3), plot(t,sin(2*pi*fc*t))
title('Carrier signal')
grid
%plot the modulated signal
subplot(5,1,5), plot(t,fm_out)
title('FM signal')
xlabel('time in seconds');
grid
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -