调频是通过更改电波的立即频率来对载波中的数据进行编码。换句话说,在频率调制中,使频率(与载波的幅度相反)相对于调制信号的不同幅度而改变。
我们将使用fmmod()函数来获取信号的频率调制。
Syntax: a = fmmod(x, fc, fs, fdev)
Parameters:
- x is input sinusoidal message signal
- fc is carrier frequency
- fc is carrier frequency,
- fdev is frequency deviation
光谱:
代码:
% Sampling Frequency
fs = 400;
% Carrier Frequency
fc = 200;
% Time Duration
time = (0:1/fs:0.2)';
% Create two sinusoidal signal with frequencies 30 Hz and 60 Hz
x = sin(2*pi*30*time)+2*sin(2*pi*60*time);
% Frequency Deviation
fDev = 50;
% Frequency modulate x
y = fmmod(x,fc,fs,fDev);
% plotting
plot(time,x,'c',time,y,'b--')
xlabel('Time (s)')
ylabel('Amplitude')
legend('Original Signal','Modulated Signal')
输出: