clc;
clear all;
close all;
fc=30;
fm=2;
fs=100*fc;
ac=1;
am=1;
t=0:1/fs:2/fm;
ct=ac*cos(2*pi*fc*t);
mt=am*sin(2*pi*fm*t);
dev=10;
st_fm=fmmod(mt,fc,fs,dev);
dt_fm=fmdemod(st_fm,fc,fs,dev);
figure(1)
subplot(4,1,1);plot(t,ct);
xlabel('time period');
ylabel('amplitude');
title('carrier signal');
subplot(4,1,2);plot(t,mt);
xlabel('time period');
ylabel('amplitude');
title('message signal');
subplot(4,1,3);plot(t,st_fm);
xlabel('time period');
ylabel('amplitude');
title('modulated signal');
subplot(4,1,4);plot(t,dt_fm);
xlabel('time period');
ylabel('amplitude');
title('demodulatedsignal');
axis([0 1 -1 1 ])
clear all;
close all;
fc=30;
fm=2;
fs=100*fc;
ac=1;
am=1;
t=0:1/fs:2/fm;
ct=ac*cos(2*pi*fc*t);
mt=am*sin(2*pi*fm*t);
dev=10;
st_fm=fmmod(mt,fc,fs,dev);
dt_fm=fmdemod(st_fm,fc,fs,dev);
figure(1)
subplot(4,1,1);plot(t,ct);
xlabel('time period');
ylabel('amplitude');
title('carrier signal');
subplot(4,1,2);plot(t,mt);
xlabel('time period');
ylabel('amplitude');
title('message signal');
subplot(4,1,3);plot(t,st_fm);
xlabel('time period');
ylabel('amplitude');
title('modulated signal');
subplot(4,1,4);plot(t,dt_fm);
xlabel('time period');
ylabel('amplitude');
title('demodulatedsignal');
axis([0 1 -1 1 ])
This is FM modulation... It is mislabeled.
ReplyDeleteVery nicely done!