?? mfm.m
字號:
%FM modulation and demodulation,mfm.n
clear all;
close all;
Kf=5;
fc=10;
T=5;
dt=0.001;
t=0:dt:T;
%信源
fm=1;
%mt=cos(2*pi*fm*t)+1.5*sin(2*pi*0.3*fm*t);
mt=cos(2*pi*fm*t);
%FM調制
A=sqrt(2);
%mti=1/2/pi/fm*sin(2*pi*fm*t)-3/4/pi/0.3/fm*cos(2*pi*0.3*fm*t);
%mt的積分函數
mti=1/2/pi/fm*sin(2*pi*fm*t); %mt的積分函數
st=A*cos(2*pi*fc*t+2*pi*Kf*mti);
figure(1);
subplot(311)
plot(t,st);hold on;
plot(t,mt,'r--');
xlabel('t');title('調頻信號')
subplot(312)
[f sf]=T2F(t,st);
plot(f,abs(sf));
axis([-25 25 0 3]);
xlabel('f');title('調頻信號頻譜');
%FM解調
for k=1:length(st)-1
rt(k)=(st(k+1)-st(k))/dt;
end
rt(length(st))=0;
subplot(313)
plot(t,rt);hold on;
plot(t,A*2*pi*Kf*mt+A*2*pi*fc,'r--');
xlabel('t');title('調頻信號的微分后包絡')
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -