fm.m

来自「Electronic Communication Systems的Matlab源」· M 代码 · 共 37 行

M
37
字号
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 + =
减小字号Ctrl + -
显示快捷键?